Skip to content

Commit ccb57a4

Browse files
committed
fix statvar name typo
1 parent 989379b commit ccb57a4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

prms_python/optimizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def srad(self, reference_srad_path, station_nhru, n_sims=10, method='',\
109109
if station_nhru == 'basin':
110110
self.srad_hru = 'basin_swrad_1'
111111
else: # get variable at a specific hru
112-
self.srad_hru = 'swrad_{}'.format(station_hru)
112+
self.srad_hru = 'swrad_{}'.format(station_nhru)
113113

114114
srad_start_time = dt.datetime.now()
115115
srad_start_time = srad_start_time.replace(second=0, microsecond=0)
@@ -298,11 +298,11 @@ def plot_optimization(self, stage, freq='daily', method='time_series',\
298298
if (stage=='swrad'):
299299
if not self.srad_outputs:
300300
raise ValueError('You have not run any srad optimizations')
301-
var_name = self.srad_hru
301+
var_name = self.srad_hru # name in statvar file
302302
#indices that measured and simulated share (intersection)
303303
X = self.measured_srad
304304
idx = X.index.intersection(self.srad_outputs[0]['statvar']\
305-
['{}_{}'.format(stage, self.srad_hru)].index)
305+
['{}'.format(var_name)].index)
306306
X = X[idx]
307307
orig = load_statvar(OPJ(self.input_dir, 'statvar.dat'))['{}'\
308308
.format(var_name)][idx]

0 commit comments

Comments
 (0)