-
Notifications
You must be signed in to change notification settings - Fork 267
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
An error occurred while reading CAPPI file:ValueError: negative dimensions are not allowed #1585
Comments
@hanzhe910 Hello! Currently there is no CAPPI functionality in Py-ART. However If the file is gridded, you could try pyart.io.read_grid instead for the file and see if that works? If that doesn't we would have to see where the negative dimensions are coming from? |
Thank you very much for your reply. I am thrilled to receive a response from the developer of pyart. My CAPPI file is not in netCDF4 format, so it doesn't have a grid, but that's okay. I have communicated with the relevant personnel and am preparing to process the RAW file. Pyart is the best radar data processing package I have ever used. Now, I would like to convert radar data into gridded data. Could you please let me know what formula is used in pyart to convert upper-level winds to surface winds? |
@zssherman I have another question that I would greatly appreciate your help with. Due to the elevation angle coverage of my radar, three files are generated: PPIVOL_A: 0.1 deg Read the three raw files. Thank you very much for your assistance!!!!!! |
@hanzhe910 In terms of converting upper level winds to surface winds, I'm not entirely sure. Someone else might have an idea on that. For joining radars, we do have a pyart.utils.join_radar that will allow you to join radars together. You could join them by the order of the sweeps so ppi_volA with B then those two with C i think would work. You could also use the pyart.correct.region_delias to correct velocities. The pyart horizontal wind profile class could help possibly as well if i understand the problem correctly. Or could use the vad_browning pyart.retrieve function and specify the height you want to obtain a VAD ? |
@zssherman However, I have one more question. When reading the radar wind data, I understand that it refers to the radial wind, which forms an angle with the ground and is not the horizontal wind. How can I obtain the horizontal wind from this data? Does Py-ART provide functionality to achieve this, or can the projection feature in pyart.map.map_to_grid be used for this purpose? Thank you so much once again for your invaluable help and prompt response. |
@hanzhe910 Hmm I would maybe try tweaking the ROI (but might not be ideal) of the gridding etc. But if I had to take a guess it might be something along the lines of this or the link could be helpful in pinpointing why that's the case: |
I'm very sorry, I have a very simple question that I hope someone can help me with, I'm trying to open a CAPPI file with pyart, but my code is reporting an error as follows:
ValueError Traceback (most recent call last)
Cell In[11], line 9
3 #pyart.map.grid
5 radar_file_path = '/Users/cuihanzhe/Desktop/ai_downscaling/radardata/CAP_V_030_256_20180916110009.CAPSPTC'
----> 9 radar = pyart.io.read(radar_file_path)
12 display = pyart.graph.RadarDisplay(radar)
15 plt.figure(figsize=(10, 6))
File ~/anaconda3/envs/pyart/lib/python3.10/site-packages/pyart/io/auto_read.py:125, in read(filename, use_rsl, **kwargs)
123 return read_rsl(filename, **kwargs)
124 else:
--> 125 return read_sigmet(filename, **kwargs)
126 if filetype == "UF":
127 if use_rsl:
File ~/anaconda3/envs/pyart/lib/python3.10/site-packages/pyart/io/sigmet.py:147, in read_sigmet(filename, field_names, additional_metadata, file_field_names, exclude_fields, include_fields, time_ordered, full_xhdr, noaa_hh_hdr, debug, ignore_xhdr, ignore_sweep_start_ms, **kwargs)
144 full_xhdr = False
146 # read data
--> 147 sigmet_data, sigmet_metadata = sigmetfile.read_data(full_xhdr=full_xhdr)
148 first_data_type = sigmetfile.data_type_names[0]
149 if first_data_type == "XHDR": # don't use XHDR as the first data type
File ~/anaconda3/envs/pyart/lib/python3.10/site-packages/pyart/io/_sigmetfile.pyx:133, in pyart.io._sigmetfile.SigmetFile.read_data()
File ~/anaconda3/envs/pyart/lib/python3.10/site-packages/numpy/ma/core.py:8442, in _convert2ma.call(self, *args, **params)
8440 _extras[p] = params.pop(p)
8441 # Get the result
-> 8442 result = self._func.call(*args, **params).view(MaskedArray)
8443 if "fill_value" in common_params:
8444 result.fill_value = _extras.get("fill_value", None)
ValueError: negative dimensions are not allowed
========================================================================================
Meanwhile, my code is:
import matplotlib.pyplot as plt
import pyart
radar_file_path = '/Users/cuihanzhe/Desktop/ai_downscaling/radardata/CAP_V_030_256_20180916110009.CAPSPTC'
radar = pyart.io.read(radar_file_path)
display = pyart.graph.RadarDisplay(radar)
plt.figure(figsize=(10, 6))
sweep = 0
display.plot('reflectivity', sweep=sweep, title='Radar Reflectivity', colorbar_label='dBZ')
plt.show()
I don't know if this is because my file is from an official organization and they identify it as cappi, or maybe it is because I don't have the TRMM Radar Software Library(RSL) installed. But I do not know how to install RSL, this does not seem to be a python package, could someone please help me, thank you very much!!!!
The text was updated successfully, but these errors were encountered: