-
Notifications
You must be signed in to change notification settings - Fork 415
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
Dimensionality of MetPy NEXRAD level II Fields do not Match. Uncertain how to Conduct A Spatial Analysis. #3652
Comments
Can you share the code that gives you If this came from our examples, those arrays are intentionally bigger than the |
I added my sample script to this email... I did copy it from one of the examples (https://unidata.github.io/MetPy/latest/examples/formats/NEXRAD_Level_2_File.html#sphx-glr-examples-formats-nexrad-level-2-file-py). If the radar file doesn't upload to this reply, you can download it via this link: https://noaa-nexrad-level2.s3.amazonaws.com/2021/12/21/KTBW/KTBW20211221_104123_V06. This is the important part you're asking for,
I later attempt to determine the base reflectivity at a specific location given;
I'd be satisfied with the above if the dimensions of xlocs==ylocs==data. |
To accomplish what you want would require changing the range calculation, which is intentionally adding 1 to the size to: ref_range = np.arange(ref_hdr.num_gates) * ref_hdr.gate_width + ref_hdr.first_gate
ref_range = units.Quantity(ref_range, 'kilometers') Then also avoid modifying the collection of azimuths, but only have this line: az = np.array([ray[0].az_angle for ray in radar.sweeps[sweep]]) eliminate all the other lines that affect az. |
What can be better?
I'm trying to pair NEXRAD coordinates into a pandas (then geopandas) dataframe.
To do this, I,
The problem is, data.flatten() does not have the same dimensionality as ylocs.flatten()/xlocs.flatten(). For my case, the non-flattened dimensions are; ylocs = (721, 1833), xlocs = (721, 1833), and data = (720, 1832).
Bottom line, is there a way to pair ylocs/xlocs onto data's grid so that I can index what the coordinates are at cell data(x,y)? Since it was able to plot in pcolormesh, I'm sure there's a way. I just need to find it.
Thank you!
The text was updated successfully, but these errors were encountered: