File Formats (I/O)¶
metpy.io¶
-
class
metpy.io.Level2File(filename)¶ A class that handles reading the NEXRAD Level 2 data and the various messages that are contained within.
This class attempts to decode every byte that is in a given data file. It supports both external compression, as well as the internal BZ2 compression that is used.
-
stid¶ str – The ID of the radar station
-
dt¶ Datetime instance – The date and time of the data
-
vol_hdr¶ namedtuple – The unpacked volume header
-
sweeps¶ list of tuples – Data for each of the sweeps found in the file
-
rda_status¶ namedtuple, optional – Unpacked RDA status information, if found
-
maintenance_data¶ namedtuple, optional – Unpacked maintenance data information, if found
-
maintenance_data_desc¶ dict, optional – Descriptions of maintenance data fields, if maintenance data present
-
vcp_info¶ namedtuple, optional – Unpacked VCP information, if found
-
clutter_filter_bypass_map¶ dict, optional – Unpacked clutter filter bypass map, if present
-
rda¶ dict, optional – Unpacked RDA adaptation data, if present
-
rda_adaptation_desc¶ dict, optional – Descriptions of RDA adaptation data, if adaptation data present
Notes
The internal data structure that things are decoded into is still to be determined.
-
__init__(filename)¶ Create instance of Level2File.
Parameters: fname (str or file-like object) – If str, the name of the file to be opened. Gzip-ed files are recognized with the extension ‘.gz’, as are bzip2-ed files with the extension .bz2 If fname is a file-like object, this will be read from directly.
-
msg1_data_hdr¶ alias of
Msg1DataHdr
-
-
class
metpy.io.Level3File(filename)¶ A class that handles reading the wide array of NEXRAD Level 3 (NIDS) product files.
This class attempts to decode every byte that is in a given product file. It supports all of the various compression formats that exist for these products in the wild.
-
metadata¶ dict – Various general metadata available from the product
-
header¶ namedtuple – Decoded product header
-
prod_desc¶ namedtuple – Decoded product description block
-
siteID¶ str – ID of the site found in the header, empty string if none found
-
lat¶ float – Radar site latitude
-
lon¶ float – Radar site longitude
-
height¶ float – Radar site height AMSL
-
product_name¶ str – Name of the product contained in file
-
max_range¶ float – Maximum range of the product, taken from the NIDS ICD
-
map_data¶ Mapper – Class instance mapping data int values to proper floating point values
-
sym_block¶ list, optional – Any symbology block packets that were found
-
tab_pages¶ list, optional – Any tabular pages that were found
-
graph_pages¶ list, optional – Any graphical pages that were found
Notes
The internal data structure that things are decoded into is still to be determined.
-
__init__(filename)¶ Create instance of Level3File.
Parameters: filename (str or file-like object) – If str, the name of the file to be opened. If file-like object, this will be read from directly.
-
-
metpy.io.is_precip_mode(vcp_num)¶ Determine if the NEXRAD radar is operating in precipitation mode
Parameters: vcp_num (int) – The NEXRAD volume coverage pattern (VCP) number Returns: True if the VCP corresponds to precipitation mode, False otherwise Return type: bool