nbproject/private/private.xml
@@ -24,7 +24,8 @@ |
<file>file:/od/projects/csip-all/csip-example/test/service_tests/externalexe/STest.java</file> |
</group> |
<group> |
- <file>file:/home/pattersd/work/csip-weather/test/service_tests/NARR_V1_0/narr-res.json</file> |
+ <file>file:/home/pattersd/work/csip-weather/test/service_tests/GHCND_V1_0/ghcnd-res.json</file> |
+ <file>file:/home/pattersd/work/csip-weather/test/service_tests/GHCND_V1_0/ghcnd-req.json</file> |
</group> |
</open-files> |
</project-private> |
nbproject/project.properties
src/java/python/driver.py
@@ -5,14 +5,15 @@ |
# test string: |
# python driver.py coagmet "[\"FTC01\",\"FTC03\"]" metric "1950-1-1" "2015-12-31" daily "[\"tmin\",\"tmax\",\"pp\"]" |
# python driver.py coagmet "[\"FTC01\",\"FTC03\"]" english "1950-1-1" "2015-12-31" daily "[\"tmin\",\"tmax\",\"pp\",\"sr\",\"rhave\",\"windspeed_avg\"]" |
+# python driver.py ghcnd "[\"USC00052635\",\"USC00244007\"]" metric 1950-1-1 2015-12-31 |
|
if __name__ == '__main__': |
we = weatherExtraction.weatherExtraction() |
ret = we.WEgetData(*sys.argv[1:]) |
- if len(ret) == 3: |
+ if isinstance(ret, dict): |
+ print json.dumps(ret) |
+ elif len(ret) == 3: |
# Return the GID of the tile so that the calling program can cache duplicate |
print json.dumps({ 'output': ret[0], 'cell_geojson': ret[1], 'cell_extent': ret[2] }) |
- elif isinstance(ret, dict): |
- print json.dumps(ret) |
else: |
print json.dumps({ 'output': ret }) |
src/java/python/weatherExtraction.py
@@ -551,7 +551,12 @@ |
for station_id, station_output in ret.iteritems(): |
climate_data += [[station_id, ] + r for r in station_output] |
|
- return { 'output': climate_data, 'metadata': metadata } |
+ # load climate version |
+ version = "No version file found" |
+ with open('/mnt/Climate/ghcnd-version.txt') as fp: |
+ version = fp.read() |
+ |
+ return { 'output': climate_data, 'metadata': metadata, 'version': version } |
|
def WEgetModels(self, climate_dataset): |
"""Return the list of available models and forecasting options as a list pair""" |