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

FIX: use max_num_gates for calculation of data shape #1337

Merged
merged 1 commit into from
Nov 26, 2022

Conversation

kmuehlbauer
Copy link
Contributor

solves #1336

But only if range resolution is same for all sweeps.

Copy link
Collaborator

@zssherman zssherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good @kmuehlbauer! Thanks for putting this together!

@zssherman zssherman merged commit 97ca799 into ARM-DOE:main Nov 26, 2022
@tsbiscaro
Copy link

#1337

That works for reading the data, but it will crash during the plot (I am trying to plot the first elevation):

File "dual_pol.py", line 15, in
display.plot('corrected_reflectivity', 0, vmin=20, vmax=70., colorbar_label='dBZ', axislabels_flag=False)
File "/home/tbiscaro/anaconda3/envs/radar/lib/python3.8/site-packages/pyart/graph/radardisplay.py", line 138, in plot
self.plot_ppi(field, sweep, **kwargs)
File "/home/tbiscaro/anaconda3/envs/radar/lib/python3.8/site-packages/pyart/graph/radardisplay.py", line 337, in plot_ppi
pm = ax.pcolormesh(
File "/home/tbiscaro/anaconda3/envs/radar/lib/python3.8/site-packages/matplotlib/init.py", line 1423, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/home/tbiscaro/anaconda3/envs/radar/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 6133, in pcolormesh
X, Y, C, shading = self._pcolorargs('pcolormesh', *args,
File "/home/tbiscaro/anaconda3/envs/radar/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 5661, in _pcolorargs
raise TypeError('Dimensions of C %s are incompatible with'

A sample file can be downloaded at: https://1drv.ms/u/s!AjzwFqty9OKPiPwNlxYAGzNyHDoLfQ?e=WUk03I

@kmuehlbauer
Copy link
Contributor Author

Yes, what a pity, I've missed to fix the range as well. I'll add the needed changes.

Thanks for the data file. I can confirm, that the range resolution changes in your file between sweeps. That contradicts the current Py-ART CfRadial1-based datamodel.

@zssherman @mgrover what's the current workaround in that case?

@tsbiscaro
Copy link

Yes, the range varies too. I've contacted the radar operator to change this because it doesn't make sense to me, but I've sent the file anyway as a good test file for reading a really bad-formatted file...

@kmuehlbauer
Copy link
Contributor Author

kmuehlbauer commented Nov 28, 2022

I would not say it's bad formatted. It makes sense to increase the range resolution with increasing elevation which results in better height resolution for higher angles. That's one reason CfRadial2 was invented, a data model also Py-Art will switch to, with the help of xradar.

Update: fix decrease -> increase

@tsbiscaro
Copy link

Good to know about that improvement in CFRadial2. This file I've sent also changes the azimuth number between elevations (360/361). It's a good test file I guess.

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

Successfully merging this pull request may close these issues.

3 participants