Former-commit-id: 487fa2ef99f721fd8888697343b6c84b83318a47
This commit is contained in:
AF1111
2020-02-07 10:44:28 -05:00
14 changed files with 15 additions and 17 deletions

View File

@@ -18,7 +18,7 @@ def temp_inc(init_data, year):
# Go through the json divided into lat,lon grid squares
for i in json1_data:
if 50 >= float(i) >= 23:
if 49 >= float(i) >= 23:
# Convert to format that plays nice with mongodb; only get U.S squares
single_year_US[i] = {}
for j in json1_data[i]:
@@ -26,7 +26,7 @@ def temp_inc(init_data, year):
mean_glob_temps.append(json1_data[i][j][year][3])
# Contiguous U.S bounded by (49 N, 122W), (24N 66W)
if 50 >= float(i) >= 23 and -65 >= float(j) >= -130:
if 49 >= float(i) >= 23 and -68 >= float(j) >= -128:
single_year_US[i][j] = (
json1_data[i][j][year][0], json1_data[i][j][year][1], json1_data[i][j][year][3]-273.15
)

View File

@@ -9,7 +9,7 @@ class InnerWrapper(OuterWrapper):
def __init__(self):
num_input_schemas = len(glob.glob("/opt/schemas/input/*.json"))
super().__init__(model_id="rcp_climate", num_expected_inputs=num_input_schemas)
super().__init__(model_id="gfdl_cm3", num_expected_inputs=num_input_schemas)
def configure(self, **kwargs):
self.raw_data = kwargs['rcp26data']
@@ -19,17 +19,15 @@ class InnerWrapper(OuterWrapper):
print('rcp data not found')
def increment(self, **kwargs):
self.global_temp, self.climate_data0, self.climate_data1 = temp_inc(self.raw_data, self.incstep)
self.global_temp, self.precipitation, self.evaporation = temp_inc(self.raw_data, self.incstep)
results ={'rcp_climate':
results ={'gfdl_cm3':
{'global_temp':
{'data':
{'temp': self.global_temp},
'granularity': 'global'},
{'data': {'temp': self.global_temp}, 'granularity': 'global'},
'precipitation':
{'data': self.climate_data0, 'granularity': 'climate'},
{'data': self.precipitation, 'granularity': 'climate'},
'evaporation':
{'data': self.climate_data1, 'granularity': 'climate'}
{'data': self.evaporation, 'granularity': 'climate'}
}
}
return results

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long