hectornieto / pyTSEB

A python Two Source Energy Balance model for estimation of evapotranspiration with remote sensing data
GNU General Public License v3.0
137 stars 62 forks source link

zero-size array error #57

Closed tuncaemre closed 1 year ago

tuncaemre commented 1 year ago

I am trying to using point time series, I used this datas as an input with Component temperature model in tseb: "year", "DOY", "time", "S_dn", "T_A1", "u" ,"T_S", "T_C", "RH", "ea", "LAI", "h_C", "f_c", "VZA".

However pytseb resulted this error given below. How can we solve this issue or what is the source of this error?

Processing... Iteration 0, max. L diff: inf Iteration 1, max. L diff: inf Iteration 2, max. L diff: inf Iteration 3, max. L diff: inf Iteration 4, max. L diff: inf c:\Work\coding\Python\pyTSEB\pyTSEB-master\pyTSEB\TSEB.py:1956: RuntimeWarning: invalid value encountered in divide L_diff = np.asarray(np.fabs(L - L_old) / np.fabs(L_old), dtype=np.float32)

ValueError Traceback (most recent call last) File c:\Work\coding\Python\pyTSEB\pyTSEB-master\pyTSEB\TSEBIPythonInterface.py:1101, in TSEBIPythonInterface._on_runmodel_clicked(self, b) 1099 self.get_data_TSEB_widgets(is_image=self.is_image) 1100 # run TSEB -> 1101 self.run(is_image=self.is_image) 1102 # Change the colour of the button to know it has finished 1103 self.w_runmodel.background_color = 'green'

File c:\Work\coding\Python\pyTSEB\pyTSEB-master\pyTSEB\TSEBConfigFileInterface.py:276, in TSEBConfigFileInterface.run(self, is_image) 274 model.process_local_image() 275 else: --> 276 in_data, out_data = model.process_point_series_array() 277 return in_data, out_data 278 else:

File c:\Work\coding\Python\pyTSEB\pyTSEB-master\pyTSEB\PyTSEB.py:412, in PyTSEB.process_point_series_array(self) 407 self.res_params['KN_C_dash'] = np.ones(dims) * self.p['KN_C_dash'] 409 # ====================================== 410 # Run the chosen model --> 412 out_data = self.run(in_data.to_records(index=False)) 413 out_data = pd.DataFrame(data=np.stack(out_data.values()).T, 414 index=in_data.index, 415 columns=out_data.keys()) 417 # ====================================== ... 83 else: 84 return reduction(axis=axis, out=out, passkwargs) ---> 86 return ufunc.reduce(obj, axis, dtype, out, passkwargs)

ValueError: zero-size array to reduction operation maximum which has no identity

hectornieto commented 1 year ago

Please provide the input data you are using. We have tested with the example data of the repository and the code seems to work fine

tuncaemre commented 1 year ago

I re-installed it, somehow it works now. Thanks for your interest.