|
HWRF
trunk@4391
|
This is a helper class intended to be used internally by RegribMany. More...
This is a helper class intended to be used internally by RegribMany.
It performs a small number of GRIB manipulations intended to produce the result of a single GRIB expression.
Public Member Functions | |
| def | __init__ (self, result, op, workprefix=None, kwargs) |
| Creates a Regrib object whose result has the given name (in "result") and produces the output of the specified operation "op", prepending the given prefix "workprefix" to temporary and output filenames. More... | |
| def | set_workprefix |
| Sets the work directory and filename prefix to the given value, or sets it to a reasonable default if workprefix is None or missing. More... | |
| def | reset |
| Discards all temporary data, and re-initializes this object for the specified result name, operator and workprefix. More... | |
| def | getop (self) |
| Returns the GRIBBase object that performs this Regrib's work. More... | |
| def | is_ready (self, kwargs) |
| Returns True if this Regrib object's operator is "ready" (according to is_ready) and False otherwise. More... | |
| def | input_valid (self, kwargs) |
| Returns True if the specified kwargs are valid for this Regrib object's operator and False otherwise. More... | |
| def | make (self, kwargs) |
| Runs this Regrib object's operator's make function with the given keyword arguments, returning the results. More... | |
| def | indextemp (self, grib) |
| Generates a temporary filename to use for the specified GRIB1/2 file's index file. More... | |
| def | gribtemp |
| Returns a tuple (grib,index) containing a suggested GRIB1/2 filename and index filename. More... | |
| def | tempfile |
| Creates a name of a temporary file. More... | |
Public Member Functions inherited from hwrf.regrib.RegribBase | |
| def | __init__ |
| Creates a RegribBase. More... | |
| def | getcopygb (self) |
| Returns the copygb ImmutableRunner. | |
| def | getcnvgrib_g12 (self) |
| Returns the cnvgrib -p32 -g12 command, which should be an ImmutableRunner. | |
| def | getcnvgrib_g21 (self) |
| Returns the cnvgrib -g21 command, which should be an ImmutableRunner. More... | |
| def | getwgrib (self) |
| Returns the wgrib command, which should be an ImmutableRunner. More... | |
| def | getlog (self) |
| Returns the logger.Logging object to use for logging messages, or None if no logger was provided to the constructor. More... | |
| def | setlog (self, val) |
| Sets the logger.Logging object to use for logging messages. More... | |
| def | getprodargs (self) |
| Returns the array of arguments to send to the products iterators. More... | |
| def | getprodkwargs (self) |
| Returns a dict of keyword arguments to send to the products iterators. More... | |
| def | setsync_frequently (self, flag) |
| Sets the sync_frequently flag. More... | |
| def | getsync_frequently (self) |
| Returns the value of the sync_frequently flag. More... | |
Properties | |
| op | |
| The GRIBBase object that performs this Regrib's work. More... | |
Properties inherited from hwrf.regrib.RegribBase | |
| sync_frequently | |
| Boolean flag: should we call sync frequently? More... | |
| logger | |
| A logging.Logger for log messages. More... | |
| prodargs | |
| A list of additional positional arguments to send to Task.products. More... | |
| prodkwargs | |
| A dict of additional keyword arguments to send to Task.products. More... | |
| wgrib | |
| A produtil.prog.ImmutableRunner for running wgrib, or None if unavailable. More... | |
| copygb | |
| A produtil.prog.ImmutableRunner for running copygb, or None if unavailable. More... | |
| cnvgrib_g21 | |
| A produtil.prog.ImmutableRunner for running cnvgrib to convert from GRIB2 to GRIB1, or None if unavailable. More... | |
| cnvgrib_g12 | |
| A produtil.prog.ImmutableRunner for running cnvgrib to convert from GRIB1 to GRIB2, or None if unavailable. More... | |
| def hwrf.regrib.Regrib.__init__ | ( | self, | |
| result, | |||
| op, | |||
workprefix = None, |
|||
| kwargs | |||
| ) |
Creates a Regrib object whose result has the given name (in "result") and produces the output of the specified operation "op", prepending the given prefix "workprefix" to temporary and output filenames.
| result | the name of this operation result, for referencing it again in a RegribMany object after the operation is complete. |
| op | the operation to perform |
| workprefix | |
| kwargs | Additional keyword arguments are sent to RegribBase.__init__() |
| def hwrf.regrib.Regrib.getop | ( | self | ) |
| def hwrf.regrib.Regrib.gribtemp | ( | self, | |
what = None |
|||
| ) |
| def hwrf.regrib.Regrib.indextemp | ( | self, | |
| grib | |||
| ) |
| def hwrf.regrib.Regrib.input_valid | ( | self, | |
| kwargs | |||
| ) |
Returns True if the specified kwargs are valid for this Regrib object's operator and False otherwise.
| kwargs | Additional keyword arguments passed to GRIBBase.input_valid() called on self.op |
| def hwrf.regrib.Regrib.is_ready | ( | self, | |
| kwargs | |||
| ) |
Returns True if this Regrib object's operator is "ready" (according to is_ready) and False otherwise.
| kwargs | Additional keyword arguments passed to GRIBBase.is_ready(), called on self.op. |
Definition at line 240 of file regrib.py.
Referenced by hwrf.regrib.RegribMany.has_data().
| def hwrf.regrib.Regrib.make | ( | self, | |
| kwargs | |||
| ) |
Runs this Regrib object's operator's make function with the given keyword arguments, returning the results.
| kwargs | Additional keyword arguments passed to GRIBBase.make() called on self.op |
| def hwrf.regrib.Regrib.reset | ( | self, | |
| result, | |||
| op, | |||
workprefix = None |
|||
| ) |
Discards all temporary data, and re-initializes this object for the specified result name, operator and workprefix.
This is used by RegribMany to re-use a single Regrib object over and over.
| result | the new result object to return, if queried |
| op | the new operation to return if queried |
| workprefix | the new work directory and filename prefix |
| def hwrf.regrib.Regrib.set_workprefix | ( | self, | |
workprefix = None |
|||
| ) |
Sets the work directory and filename prefix to the given value, or sets it to a reasonable default if workprefix is None or missing.
The work prefix is not necessarily a directory: it can include additional text to prepend to the filename.
| workprefix | The new work directory and filename prefix. |
Definition at line 206 of file regrib.py.
Referenced by hwrf.regrib.Regrib.__init__(), and hwrf.regrib.Regrib.reset().
| def hwrf.regrib.Regrib.tempfile | ( | self, | |
what = None |
|||
| ) |
|
static |
The GRIBBase object that performs this Regrib's work.
Definition at line 238 of file regrib.py.
Referenced by hwrf.regrib.Regrib.make().
1.8.10