-
Notifications
You must be signed in to change notification settings - Fork 416
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
Level2File: 'IndexError: tuple index out of range' (older L2 data) #3719
Comments
This should work: ref = radar.sweeps[0][0][1]['REF'][1] |
Hello again, Ryan. Based on the online example, It'd be great if MetPy could create a dynamic function that selects the correct index based on a user specified sweep and field ('REF') for all older/newer files. Besides that, could you please elaborate what the 3rd (example - '[4]') and 5th (example - '[0]') tuple index denote? Could I simply write script that indexes the final option of both tuples ('[-1]')? So for example, Thanks again! |
The current NEXRAD interface is pretty low level and maps very directly to the layout of the files; an improved interface has been on the wishlist for awhile #49 but has never reached the top of the priority list. You may also want to look into PyART or xradar for improved interfaces; the latter can provide an xarray dataset/datatree view of NEXRAD data. The basic interface with Not sure why I didn't suggest that or write the docs with that. PRs updating are welcome. |
I initially looked at PyART, but it's near impossible to create an application with the library. There are too many scripts to pack into an executable... It is possible with MetPy, which is why I continue to use it. I may look into xradar although I didn't know about it until now. Is this correct for "message 31" data? For index 2 (radial header), why is '0' selected? Does this correspond to sweep? So if sweep == 0, index 2 == 0. Also, if the file doesn't contain "message 31" data, how would the indices change? |
What went wrong?
Hello,
The file I'm using can be obtained by the following Linux command, 'wget https://noaa-nexrad-level2.s3.amazonaws.com/2005/01/21/KBOX/KBOX20050121_010932.gz'
The script;
The problem;
I'd like to ask, how would I rewrite the script to index the correct tuples to retrieve base reflectivity?
This script works for newer L2 NEXRAD files, just not this one.
Operating System
Linux
Version
1.6.2
Python Version
3.9.19
Code to Reproduce
Errors, Traceback, and Logs
The text was updated successfully, but these errors were encountered: