Releases: NOAA-MDL/grib2io
grib2io release 0.3.0
Release Notes
Class grib2io.open():
- New
select()
method for selection/filtering of GRIB2 Messages. Currently supported keyword arguments are:‘duration’
,‘leadTime’
,‘level’
,'refDate'
, and‘shortName’
. These arguments only accept single values at this time. Please see documentation for usage of these keyword arguments. Thelevel
keyword, only supports the following surfaces: isobaric surface, height above/below ground, and sigma are supported at this time. A future update will allow for multiple values per keyword. The following example will select GRIB2 Messages that are Geopotential Height at the 500mb level, with a lead time of 24-hours.
>>> import grib2io
>>> g = grib2io.open("test.grib2")
>>> msgs = g.select(shortName="HGT",level="500mb",leadTime=24)
-
New
_find_level()
“private” method to parse the user provided level= kwarg in the select() method. The value is parsed and searched for. -
New class attribute,
‘shortNames’
, containing a tuple of unique shortName strings contained in the GRIB2 file.
Class grib2io.Grib2Message():
-
New
latlons()
method that will return latitude and longitude values of thegrib2io.Grib2Message
instance. An alias for this method namedgrid()
is also available. -
Fixed an issue where the incorrect lead time would be set for GRIB2 message using Product Definition Templates 4.8,9,10,11,12. There are time interval messages (i.e. Accumulated Precipitation; "APCP").
Sub-module grib2io.utils:
-
New
getleadtime()
function to compute the lead time given GRIB2 Indentification Section (1), Product Definition Template (section 4) and Number. For time interval messages, the lead time value returned here is the ending hour. -
New
getduration()
function to compute the duration time given GRIB2 Product Definition Template (Section 4) and Number. GRIB2 Messages describing data at an instance in time have a duration = 0.
Miscellaneous:
-
Added directory
make_grib2_tables/
at the repository root that contains shell and Python scripts to scrape the NCEP GRIB2 HTML tables and generate Python dictionary-based tables. IMPORTANT: The Python scripts use Pandas for HTML reading and processing, but Pandas is not required forgrib2io
. Releases ofgrib2io
will contain the latest version of the tables at the time of release. The ability to update tables is provided here. -
Documentation generation has been changed to use pdoc.
-
Applied a temporary patch in grib2.h in the bundled NCEP g2c library. The patch adds function definitions for g2_unpack* functions. This allow for successful build using Apple's LLVM clang.
grib2io release 0.2.0
This is the first release of grib2io. Version 0.2.0 is also available on PyPI. As of this release grib2io can perform the following major functions:
- Read a file containing GRIB2 Messages. If a GRIB2 Message contains sub messages, grib2io will "flatten" into multiple GRIB2 Messages.
- When read, the GRIB2 file will "indexed". This is not the same as a GRIB2 Index file. The indexing keeps track of the location of a GRIB2 Message in the file and catalogs most GRIB2 metadata for filtering/parsing (to be implemented in a future release) and allows for reading of GRIB2 Messages in a random-access manner.
- Unpack GRIB2 data
- Where possible, GRIB2 integer code values are translated into descriptive text via NCEP GRIB2 tables.
IMPORTANT: At this time, grib2io cannot create a new GRIB2 Message nor can it write to a new file (to be implemented in a future release).