@@ -35,6 +35,10 @@ class Optimizer:
3535 >>> optr.srad('path/to/reference_data/measured_srad.csv', srad_hru)
3636
3737 '''
38+
39+ ## constant attributes for allowable range of solrad parameters
40+ dday_int = (- 60.0 , 10.0 )
41+ dday_slope = (0.2 , 0.9 )
3842
3943 def __init__ (self , parameters , data , control_file , working_dir ,
4044 title = None , description = None ):
@@ -50,12 +54,15 @@ def __init__(self, parameters, data, control_file, working_dir,
5054 else :
5155 raise TypeError ('data must be instance of Data' )
5256
57+ if not os .path .isdir (working_dir ):
58+ os .mkdir (working_dir )
59+
5360 self .control_file = control_file
5461 self .working_dir = working_dir
5562 self .title = title
5663 self .description = description
5764
58- def srad (self , reference_srad_path , station_nhru , method = '' ,
65+ def srad (self , reference_srad_path , station_nhru , method = '' ,
5966 dday_intcp_range = None , dday_slope_range = None ,
6067 intcp_delta = None , slope_delta = None , nproc = None ):
6168 '''
@@ -134,7 +141,7 @@ def _error(x, y):
134141 (
135142 output ['simulation_dir' ],
136143 _error (measured_srad ,
137- output ['statvar' ]['swrad ' + str (station_nhru )])
144+ output ['statvar' ]['swrad_ ' + str (station_nhru )])
138145 )
139146
140147 for output in outputs
0 commit comments