GiniFile

class metpy.io.GiniFile(filename)[source]

A class that handles reading the GINI format satellite images from the NWS.

This class attempts to decode every byte that is in a given GINI file.

Notes

The internal data structures that things are decoded into are subject to change.

Create an instance of GiniFile.

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

channels

crafts

lc_ps_fmt

mercator_fmt

missing

nav_fmt

prod_desc2_fmt

prod_desc_fmt

sectors

wmo_finder

Methods Summary

__init__(filename)

Create an instance of GiniFile.

close()

get_attrs()

Get the global attributes.

get_dimensions()

get_encoding()

get_variables()

Get all variables in the file.

load()

This loads the variables and attributes simultaneously.

Attributes Documentation

channels = ['Unknown', 'Visible', 'IR (3.9 micron)', 'WV (6.5/6.7 micron)', 'IR (11 micron)', 'IR (12 micron)', 'IR (13 micron)', 'IR (1.3 micron)', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'LI (Imager)', 'PW (Imager)', 'Surface Skin Temp (Imager)', 'LI (Sounder)', 'PW (Sounder)', 'Surface Skin Temp (Sounder)', 'CAPE', 'Land-sea Temp', 'WINDEX', 'Dry Microburst Potential Index', 'Microburst Day Potential Index', 'Convective Inhibition', 'Volcano Imagery', 'Scatterometer', 'Cloud Top', 'Cloud Amount', 'Rainfall Rate', 'Surface Wind Speed', 'Surface Wetness', 'Ice Concentration', 'Ice Type', 'Ice Edge', 'Cloud Water Content', 'Surface Type', 'Snow Indicator', 'Snow/Water Content', 'Volcano Imagery', 'Reserved', 'Sounder (14.71 micron)', 'Sounder (14.37 micron)', 'Sounder (14.06 micron)', 'Sounder (13.64 micron)', 'Sounder (13.37 micron)', 'Sounder (12.66 micron)', 'Sounder (12.02 micron)', 'Sounder (11.03 micron)', 'Sounder (9.71 micron)', 'Sounder (7.43 micron)', 'Sounder (7.02 micron)', 'Sounder (6.51 micron)', 'Sounder (4.57 micron)', 'Sounder (4.52 micron)', 'Sounder (4.45 micron)', 'Sounder (4.13 micron)', 'Sounder (3.98 micron)', 'Sounder (3.74 micron)', 'Sounder (Visible)', 'Percent Normal TPW']
crafts = ['Unknown', 'Unknown', 'Miscellaneous', 'JERS', 'ERS/QuikSCAT', 'POES/NPOESS', 'Composite', 'DMSP', 'GMS', 'METEOSAT', 'GOES-7', 'GOES-8', 'GOES-9', 'GOES-10', 'GOES-11', 'GOES-12', 'GOES-13', 'GOES-14', 'GOES-15', 'GOES-16']
lc_ps_fmt = <metpy.io._tools.NamedStruct object>
mercator_fmt = <metpy.io._tools.NamedStruct object>
missing = 255
nav_fmt = <metpy.io._tools.NamedStruct object>
prod_desc2_fmt = <metpy.io._tools.NamedStruct object>
prod_desc_fmt = <metpy.io._tools.NamedStruct object>
sectors = ['NH Composite', 'East CONUS', 'West CONUS', 'Alaska Regional', 'Alaska National', 'Hawaii Regional', 'Hawaii National', 'Puerto Rico Regional', 'Puerto Rico National', 'Supernational', 'NH Composite', 'Central CONUS', 'East Floater', 'West Floater', 'Central Floater', 'Polar Floater']
wmo_finder = re.compile('(T\\w{3}\\d{2})[\\s\\w\\d]+\\w*(\\w{3})\r\r\n')

Methods Documentation

__init__(filename)[source]

Create an instance of GiniFile.

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.

close()
get_attrs()[source]

Get the global attributes.

This is used by xarray.open_dataset.

get_dimensions()
get_encoding()
get_variables()[source]

Get all variables in the file.

This is used by xarray.open_dataset.

load()

This loads the variables and attributes simultaneously. A centralized loading function makes it easier to create data stores that do automatic encoding/decoding.

For example:

class SuffixAppendingDataStore(AbstractDataStore):

    def load(self):
        variables, attributes = AbstractDataStore.load(self)
        variables = {'%s_suffix' % k: v
                     for k, v in variables.items()}
        attributes = {'%s_suffix' % k: v
                      for k, v in attributes.items()}
        return variables, attributes

This function will be called anytime variables or attributes are requested, so care should be taken to make sure its fast.

Examples using metpy.io.GiniFile