Home | Trees | Indices | Help |
---|
|
object --+ | index
index(filename, *args)
returns grib index object given GRIB filename indexed by keys given in *args. The select or __call__ method can then be used to selected grib messages based on specified values of indexed keys. Unlike open.select, containers or callables cannot be used to select multiple key values. However, using index.select is much faster than open.select.
Example usage:
>>> import pygrib >>> grbindx=pygrib.index('sampledata/gfs.grb','shortName','typeOfLevel','level') >>> selected_grbs=grbindx.select(shortName='gh',typeOfLevel='isobaricInhPa',level=500) >>> for grb in selected_grbs: >>> grb 1:Geopotential height:gpm (instant):regular_ll:isobaricInhPa:level 500 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst >>> # __call__ method does same thing as select >>> selected_grbs=grbindx(shortName='u',typeOfLevel='isobaricInhPa',level=250) >>> for grb in selected_grbs: >>> grb 1:u-component of wind:m s**-1 (instant):regular_ll:isobaricInhPa:level 250 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst >>> grbindx.close()
Instance Methods | |||
|
|||
|
|||
a new object with type S, a subtype of T |
|
||
|
|||
|
|||
Inherited from |
Instance Variables | |
keys list of strings containing keys used in the index. |
|
types if keys are typed, this list contains the type declarations ( l , s or d ).
|
Properties | |
name | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
|
return a list of gribmessage instances from grib index object corresponding to specific values of indexed keys (given by kwargs). Unlike open.select, containers or callables cannot be used to select multiple key values. However, using index.select is much faster than open.select. Example usage: >>> import pygrib >>> grbindx=pygrib.index('sampledata/gfs.grb','shortName','typeOfLevel','level') >>> selected_grbs=grbindx.select(shortName='gh',typeOfLevel='isobaricInhPa',level=500) >>> for grb in selected_grbs: >>> grb 1:Geopotential height:gpm (instant):regular_ll:isobaricInhPa:level 500 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst >>> # __call__ method does same thing as select >>> selected_grbs=grbindx(shortName='u',typeOfLevel='isobaricInhPa',level=250) >>> for grb in selected_grbs: >>> grb 1:u-component of wind:m s**-1 (instant):regular_ll:isobaricInhPa:level 250 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst >>> grbindx.close() |
Instance Variable Details |
typesif keys are typed, this list contains the type declarations (l , s or d ). Type declarations are
specified by appending to the key name (i.e. level:l will
search for values of level that are longs).
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Mar 24 14:58:04 2012 | http://epydoc.sourceforge.net |