josephhardinee / PyDSD

Python Library for working with disdrometer data.
GNU Lesser General Public License v2.1
45 stars 33 forks source link

ATM4.txt files processing #106

Closed raffyjef closed 2 years ago

raffyjef commented 2 years ago

Hi! PyDSD seems a good tool for DSD processing and very much working when I tried it. However, what I have are files for every minute of disdrometer data. I would like to ask if it is possible to process multiple files of parsivel disdrometer in the form of ATM4.txt using PyDSD? Thank you very much!

josephhardinee commented 2 years ago

Hey @raffyjef we could probably add an ability to merge objects, but for this particular case it may be easier to just concatenate the files together and try reading it in. Because it is a record by record format with no actual header information I think that should work. If not let me know and we can put together something to merge time series.

josephhardinee commented 2 years ago

I haven't heard back so I'll assume this works out. Closing the issue, but feel free to re-open if it did not work.

raffyjef commented 2 years ago

@josephhardinee, sorry for not replying. I just started doing DSD processing again. And yes! it's working as of now, will give you an update if there will be problems. Thank you very much.

josephhardinee commented 2 years ago

I am glad to hear it works for you and thanks for using the library!

On Aug 17, 2022, at 1:39 AM, raffyjef @.***> wrote:

 @josephhardinee, sorry for not replying. I just started doing DSD processing again. And yes! it's working as of now, will give you an update if there will be problems. Thank you very much.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

raffyjef commented 2 years ago

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