Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to obtain the final classification #67

Open
MohitDahliya opened this issue Dec 27, 2023 · 1 comment
Open

Not able to obtain the final classification #67

MohitDahliya opened this issue Dec 27, 2023 · 1 comment

Comments

@MohitDahliya
Copy link

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 ?

@tjlang
Copy link
Contributor

tjlang commented Oct 22, 2024

Sorry for taking so long to get to this. I just ran the demo notebook again as a test, after a number of recent updates, and had no issues with the HID routines. Can you try again with the updated code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants