Level2File#

class metpy.io.Level2File(filename, *, has_volume_header=True)[source]#

Handle reading the NEXRAD Level 2 data and its various messages.

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#

The ID of the radar station

Type:

str

dt#

The date and time of the data

Type:

datetime

vol_hdr#

The unpacked volume header

Type:

collections.namedtuple

sweeps#

Data for each of the sweeps found in the file

Type:

list[tuple]

rda_status#

Unpacked RDA status information, if found

Type:

collections.namedtuple, optional

maintenance_data#

Unpacked maintenance data information, if found

Type:

collections.namedtuple, optional

maintenance_data_desc#

Descriptions of maintenance data fields, if maintenance data present

Type:

dict, optional

vcp_info#

Unpacked VCP information, if found

Type:

collections.namedtuple, optional

clutter_filter_bypass_map#

Unpacked clutter filter bypass map, if present

Type:

dict, optional

rda#

Unpacked RDA adaptation data, if present

Type:

dict, optional

rda_adaptation_desc#

Descriptions of RDA adaptation data, if adaptation data present

Type:

dict, optional

Notes

The internal data structure that things are decoded into is still to be determined.

Create instance of Level2File.

Parameters:

filename (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 filename is a file-like object, this will be read from directly.

Attributes Summary

Methods Summary

__init__(filename, *[, has_volume_header])

Create instance of Level2File.

Attributes Documentation

AR2_BLOCKSIZE = 2432#
CTM_HEADER_SIZE = 12#
MISSING = nan#
RANGE_FOLD = nan#
data_block_fmt = <metpy.io._tools.NamedStruct object>#
msg15_code_map = {0: 'Bypass Filter', 1: 'Bypass map in Control', 2: 'Force Filter'}#
msg1_fmt = <metpy.io._tools.NamedStruct object>#
msg2_additional_fmt = <metpy.io._tools.NamedStruct object>#
msg2_fmt = <metpy.io._tools.NamedStruct object>#
msg31_data_hdr_fmt = <metpy.io._tools.NamedStruct object>#
msg31_el_const_fmt = <metpy.io._tools.NamedStruct object>#
msg31_vol_const_fmt = <metpy.io._tools.NamedStruct object>#
msg_hdr_fmt = <metpy.io._tools.NamedStruct object>#
rad_const_fmt_v1 = <metpy.io._tools.NamedStruct object>#
rad_const_fmt_v2 = <metpy.io._tools.NamedStruct object>#
vcp_el_fmt = <metpy.io._tools.NamedStruct object>#
vcp_fmt = <metpy.io._tools.NamedStruct object>#
vol_hdr_fmt = <metpy.io._tools.NamedStruct object>#

Methods Documentation

__init__(filename, *, has_volume_header=True)[source]#

Create instance of Level2File.

Parameters:

filename (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 filename is a file-like object, this will be read from directly.

Examples using metpy.io.Level2File#

NEXRAD Level 2 File

NEXRAD Level 2 File