You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @josephhardinee, I have a problem processing the file when I am trying to use functions with time. I am trying to use this codes using the ATM4.txt files
import pydsd
import matplotlib.pyplot as plt
import pydsd.plot
import pydsd.partition
File "/home/jeff/anaconda3/envs/wradlib/lib/python3.10/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec
exec(code, globals, locals)
File "/home/jeff/.config/spyder-py3/DSD_sample.py", line 21, in
pydsd.plot.plot_dsd(dsd)
File "/home/jeff/anaconda3/envs/wradlib/lib/python3.10/site-packages/PyDSD-1.0.6.2+5.g0a54715-py3.10.egg/pydsd/plot/plot.py", line 72, in plot_dsd
dsd.time["data"].filled(),
AttributeError: 'list' object has no attribute 'filled'
Do you have idea to fix this? My programming skills are not that advanced. Thank you
The text was updated successfully, but these errors were encountered:
Late but also had the same issue as well in that filled() is a numpy masked array method while dsd.time["data"] is just a list. Simple solution is to change the time attribute declarations in the ParsivelReader module to:
"data": np.ma.array(time_secs)
There also seems to be a bunch of other bugs related to the use of masked arrays. Had a similar issue again with dsd.calculate_radar_parameters() where masked Nd values where getting converted to NaN values so the radar params that were returned where just a bunch of NaNs. This was solved by using filled() on dsd.Nd["data"] before calling calculate_radar_parameters(). Llooking into the types of the variables you're dealing with should be the right direction if you ever encounter similar problems.
Hi @josephhardinee, I have a problem processing the file when I am trying to use functions with time. I am trying to use this codes using the ATM4.txt files
import pydsd
import matplotlib.pyplot as plt
import pydsd.plot
import pydsd.partition
filename = 'merged_file.txt'
dsd = pydsd.read_parsivel(filename)
dsd.calculate_dsd_parameterization()
pydsd.plot.plot_dsd(dsd)
plt.show()
Here is the error:
runfile('/home/jeff/.config/spyder-py3/DSD_sample.py', wdir='/home/jeff/.config/spyder-py3')
Traceback (most recent call last):
File "/home/jeff/anaconda3/envs/wradlib/lib/python3.10/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec
exec(code, globals, locals)
File "/home/jeff/.config/spyder-py3/DSD_sample.py", line 21, in
pydsd.plot.plot_dsd(dsd)
File "/home/jeff/anaconda3/envs/wradlib/lib/python3.10/site-packages/PyDSD-1.0.6.2+5.g0a54715-py3.10.egg/pydsd/plot/plot.py", line 72, in plot_dsd
dsd.time["data"].filled(),
AttributeError: 'list' object has no attribute 'filled'
Do you have idea to fix this? My programming skills are not that advanced. Thank you
The text was updated successfully, but these errors were encountered: