1

I'm trying to plot level2 radar data for a tornado outbreak in Michigan 2016. When I try calling the radar data file, it gives me a "File 'myfilename' is not in the registry". However, when I use the exact example KTLX file used in the Metpy website example, it works fine. They live in the same directory and everything. I get the same error whether I copy and paste the exact code from the Metpy site and change the file called, or if I'm simply just trying to read the data.

Second, I notice that the file used in the example is a .gz file. When I downloaded the same example file from NCEI, it came as a .gz, but the files for 2016 are not .gz. I turned one of my files into .gz for the sake of trying, and still no luck. Should I zip all my data to be a .gz file or is that not needed?

If you're curious, the radar data files are KGRR20160820_163004_V06 through KGRR20160820_170654_V06.

Thank you for any help you can provide!

Matt T.
  • 21
  • 2
  • Can you please post the line of code you're using to open the files? It sounds like you're trying to use `get_test_data`, which is only used to use our static data files. – DopplerShift Aug 06 '20 at 22:55
  • That would explain it. That's what I was using. Which would explain it not being in the registry. What's the best way to read the file? Sorry, for the probably very basic questions. It's my first time using metpy. – Matt T. Aug 07 '20 at 01:01
  • No worries, it's a perfectly fine question. My only advice next time is to include a minimal, reproducible example of what you're seeing: https://stackoverflow.com/help/minimal-reproducible-example It leads to much better answers. – DopplerShift Aug 07 '20 at 17:46

1 Answers1

1

For posterity of anyone searching for this issue, the proper way to handle this is to read the file like:

from metpy.io import Level2File
nexrad = Level2File('KGRR20160820_163004_V06')

Don't use the get_test_data function that is present in the metpy examples, as that's only used to get access to MetPy's demo/testing data files. Level2File can handle files that are using their native internal compression, or using bz2 or gz compression.

DopplerShift
  • 5,472
  • 1
  • 21
  • 20