CSU-Radarmet / CSU_RadarTools

A module of independent functions to do precipitation retrievals from polarimetric radar data
GNU General Public License v2.0
88 stars 43 forks source link

Not able to obtain the final classification #67

Open MohitDahliya opened 8 months ago

MohitDahliya commented 8 months ago

TypeError Traceback (most recent call last) Cell In[18], line 3 1 ## We will start by using the temperature beta funcitons, and the hybrid scoring method. ----> 3 hid = csu_fhc.csu_fhc_summer(dz=filtered_dz, zdr=filtered_dr, rho=filtered_rh, kdp=kd, use_temp=True,T=radar_T, band=rband, 4 verbose=False,use_trap=False,method='hybrid')#,fdir ='/home/bdolan/python/CSU_RadarTools/csu_radartools/beta_function_parameters/') 7 ###Now add this back to the radar object. 9 radar = add_field_to_radar_object(hid, radar,field_name='HID',dz_field='corrected_reflectivity')

File ~\anaconda3pro\Lib\site-packages\csu_radartools-1.3.0.dev0-py3.11-win-amd64.egg\csu_radartools\csu_fhc.py:271, in csu_fhc_summer(use_temp, weights, method, dz, zdr, ldr, kdp, rho, T, verbose, plot_flag, use_trap, n_types, temp_factor, band, return_scores) 268 return None 270 # Now loop over every hydrometeor class --> 271 test_list = _get_test_list(fhc_vars, weights, radar_data, sets, varlist, 272 weight_sum, pol_flag, trap_flag,use_temp, method, sz) 273 if test_list is None: 274 return None

File ~\anaconda3pro\Lib\site-packages\csu_radartools-1.3.0.dev0-py3.11-win-amd64.egg\csu_radartools\csu_fhc.py:441, in _get_test_list(fhc_vars, weights, radar_data, sets, varlist, weight_sum, pol_flag, trap_flag, use_temp, method, sz) 438 if use_temp: 439 if pol_flag: 440 # = multiplies by new value and stores in test --> 441 test = hid_beta_f(sz, radar_data['T'], sets['T']['a'][c], 442 sets['T']['b'][c], sets['T']['m'][c]) 443 # print 'in loc 2' 444 # if test.max() > 1: #Maximum of test should never be > 1 445 # print 'Fail loc 2, test.max() =', test.max() 446 # return None 447 else: 448 test = hid_beta_f(sz, radar_data['T'], sets['T']['a'][c], 449 sets['T']['b'][c], sets['T']['m'][c])

File csu_radartools\calc_kdp_ray_fir.pyx:192, in csu_radartools.calc_kdp_ray_fir.hid_beta_f()

TypeError: Cannot convert 'complex' with non-zero imaginary component to 'double' (this most likely comes from the '**' operator; use 'cython.cpow(True)' to return 'nan' instead of a complex number).

I am getting this error while inserting the variables in the csu_hfc. What might be the possible reasons. Any suggestions ?