HWRF  trunk@4391
Public Member Functions | Properties | List of all members
hwrf.regrib.RegribBase Class Reference

This is the abstract base class of Regrib and RegribMany and should not be instantiated directly. More...

Detailed Description

This is the abstract base class of Regrib and RegribMany and should not be instantiated directly.

It exists only to reduce code duplication.

Definition at line 36 of file regrib.py.

Inheritance diagram for hwrf.regrib.RegribBase:
hwrf.regrib.Regrib hwrf.regrib.RegribMany

Public Member Functions

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

 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...
 

Constructor & Destructor Documentation

def hwrf.regrib.RegribBase.__init__ (   self,
  logger = None,
  prodargs = None,
  prodkwargs = None,
  _base = None,
  cnvgrib_g12 = None,
  cnvgrib_g21 = None,
  wgrib = None,
  copygb = None 
)

Creates a RegribBase.

Parameters
_baseDo not use. The _base should be another RegribBase to copy. If this is specified, all other arguments are ignored, and the _base is copied. This is the implementation of self.copy()
loggerthe logging.Logger that should be used when regribbing
prodargsa list of additional arguments to send to "products" iterators.
prodkwargsa dict of additional keyword arguments to send to "products" iterators.
cnvgrib_g12The "cnvgrib -p32 -g12" program (a produtil.prog.ImmutableRunner) to convert from GRIB1 to GRIB2. (Other compression types besides -p32 are okay.)
cnvgrib_g21The "cnvgrib -g21" program (a produtil.prog.ImmutableRunner) to convert from GRIB2 to GRIB1
wgribthe wgrib program, with no arguments, a produtil.prog.ImmutableRunner
copygbthe copygb program, with no arguments, a produtil.prog.ImmutableRunner

Definition at line 41 of file regrib.py.

Member Function Documentation

def hwrf.regrib.RegribBase.getcnvgrib_g21 (   self)

Returns the cnvgrib -g21 command, which should be an ImmutableRunner.

Definition at line 104 of file regrib.py.

def hwrf.regrib.RegribBase.getlog (   self)

Returns the logger.Logging object to use for logging messages, or None if no logger was provided to the constructor.

Definition at line 112 of file regrib.py.

def hwrf.regrib.RegribBase.getprodargs (   self)

Returns the array of arguments to send to the products iterators.

Definition at line 123 of file regrib.py.

def hwrf.regrib.RegribBase.getprodkwargs (   self)

Returns a dict of keyword arguments to send to the products iterators.

Definition at line 127 of file regrib.py.

def hwrf.regrib.RegribBase.getsync_frequently (   self)

Returns the value of the sync_frequently flag.

Returns
True if sync is to be called frequently, and False otherwise

Definition at line 136 of file regrib.py.

def hwrf.regrib.RegribBase.getwgrib (   self)

Returns the wgrib command, which should be an ImmutableRunner.

Definition at line 108 of file regrib.py.

def hwrf.regrib.RegribBase.setlog (   self,
  val 
)

Sets the logger.Logging object to use for logging messages.

Parameters
valthe new logger

Definition at line 117 of file regrib.py.

def hwrf.regrib.RegribBase.setsync_frequently (   self,
  flag 
)

Sets the sync_frequently flag.

Parameters
flagif True, the sync program is called frequently

Definition at line 132 of file regrib.py.

Property Documentation

hwrf.regrib.RegribBase.cnvgrib_g12
static
Initial value:
1 = property(getcnvgrib_g12,None,None,
2  )

A produtil.prog.ImmutableRunner for running cnvgrib to convert from GRIB1 to GRIB2, or None if unavailable.

Definition at line 181 of file regrib.py.

hwrf.regrib.RegribBase.cnvgrib_g21
static
Initial value:
1 = property(getcnvgrib_g21,None,None,
2  )

A produtil.prog.ImmutableRunner for running cnvgrib to convert from GRIB2 to GRIB1, or None if unavailable.

Definition at line 175 of file regrib.py.

hwrf.regrib.RegribBase.copygb
static
Initial value:
1 = property(getcopygb,None,None,
2  )

A produtil.prog.ImmutableRunner for running copygb, or None if unavailable.

Definition at line 169 of file regrib.py.

hwrf.regrib.RegribBase.logger
static
hwrf.regrib.RegribBase.prodargs
static
Initial value:
1 = property(getprodargs,None,None,
2  )

A list of additional positional arguments to send to Task.products.

Definition at line 154 of file regrib.py.

hwrf.regrib.RegribBase.prodkwargs
static
Initial value:
1 = property(getprodkwargs,None,None,
2  )

A dict of additional keyword arguments to send to Task.products.

Definition at line 159 of file regrib.py.

hwrf.regrib.RegribBase.sync_frequently
static
Initial value:
1 = property(getsync_frequently,setsync_frequently,None,
2  )

Boolean flag: should we call sync frequently?

Definition at line 144 of file regrib.py.

Referenced by pom.init.fbtr.setrun(), pom.init.g3.setrun(), pom.init.na.setrun(), and pom.init.phase.setrun().

hwrf.regrib.RegribBase.wgrib
static
Initial value:
1 = property(getwgrib,None,None,
2  )

A produtil.prog.ImmutableRunner for running wgrib, or None if unavailable.

Definition at line 164 of file regrib.py.


The documentation for this class was generated from the following file: