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

This object produces a GRIB1Op from a call to a Task object's Task.product. More...

Detailed Description

This object produces a GRIB1Op from a call to a Task object's Task.product.

This is the class that underlies the implementation of igrb1.

Definition at line 1889 of file regrib.py.

Inheritance diagram for hwrf.regrib.GRIB1Selector:
hwrf.regrib.GRIB1Op hwrf.regrib.GRIBOp hwrf.regrib.GRIBBase

Public Member Functions

def __init__ (self, task, kwargs)
 Creates a GRIB1Selector for the specified task. More...
 
def is_ready (self, kwargs)
 Returns True if the task's product is available. More...
 
def input_valid (self, kwargs)
 Returns True if select() is able to find a product and False if NoProductError is raised. More...
 
def make (self, regrib, kwargs)
 Calls self.select(kwargs) to get the product, and calls make on the result. More...
 
def __repr__ (self)
 Returns a Pythonic representation of self.
 
- Public Member Functions inherited from hwrf.regrib.GRIB1Op
def __init__ (self, action, args)
 Creates a new GRIB1Op, passing all arguments to the superclass constructor. More...
 
def to_grib1 (self)
 Returns self. More...
 
def to_grib2 (self)
 Returns a GRIB2Op that will make a GRIB2 version of this operation's output. More...
 
def regridmerge (self, grid, other)
 Returns a GRIB1Op that will ask copygb to merge the other grid on top of this one. More...
 
def make_grbindex (self)
 Returns a GRIB1Op that will run grbindex and save the results, unless that has already been done. More...
 
def __div__ (self, subsetter)
 Returns a GRIB1Op that will subset this one using the specified subsetter. More...
 
def __mul__ (self, grid)
 If the grid is a GRIBGridBase, returns a GRIB1Op that will regrid this GRIB1Op's output to that grid. More...
 
def __add__ (self, other)
 If the argument is a GRIBOp, returns a GRIB1Op that will paste a GRIB1 version of that operations output onto this operation's output. More...
 
- Public Member Functions inherited from hwrf.regrib.GRIBOp
def __init__ (self, action, args)
 Creates a GRIBOp that has a number of child GRIBBase objects, with a specified action to perform in the GRIBOp.make method. More...
 
def getaction (self)
 Returns the action, a function or callable object. More...
 
def args (self)
 Iterates over all child GRIBBase objects. More...
 
def is_ready (self, args, kwargs)
 Returns the logical "and" of is_ready(*args,**kwargs) called on all subobjects. More...
 
def input_valid (self, kwargs)
 Returns the logical "and" of input_valid(**kwargs) called on all subobjects. More...
 
def make (self, regrib, kwargs)
 Runs the action specified in the constructor, providing as arguments regrib, and the result of running make on all of the other arguments sent to the constructor. More...
 
def __repr__ (self)
 A string representation of this GRIB operation. More...
 
- Public Member Functions inherited from hwrf.regrib.GRIBBase
def is_ready (self, args, kwargs)
 Returns True if this object and its subobjects are all ready for a call to make, and False otherwise. More...
 
def input_valid (self, kwargs)
 Returns True if the specified kwargs are valid and False otherwise. More...
 
def make (self, regrib, kwargs)
 Runs the action this object should perform and returns another GRIBBase object. More...
 

Protected Member Functions

def select (self, kwargs)
 Attempts to attain a Product from the supplied Task. More...
 

Additional Inherited Members

- Properties inherited from hwrf.regrib.GRIBOp
 action
 A read-only property: this objects action function. More...
 

Constructor & Destructor Documentation

def hwrf.regrib.GRIB1Selector.__init__ (   self,
  task,
  kwargs 
)

Creates a GRIB1Selector for the specified task.

Parameters
taskThe task whose products function is called.
kwargsAll other arguments are sent to task.products.

Definition at line 1893 of file regrib.py.

Member Function Documentation

def hwrf.regrib.GRIB1Selector.input_valid (   self,
  kwargs 
)

Returns True if select() is able to find a product and False if NoProductError is raised.

Parameters
kwargsKeyword arguments are passed to select()

Definition at line 1905 of file regrib.py.

def hwrf.regrib.GRIB1Selector.is_ready (   self,
  kwargs 
)

Returns True if the task's product is available.

Parameters
kwargsAll keyword arguments are sent to select()

Definition at line 1900 of file regrib.py.

def hwrf.regrib.GRIB1Selector.make (   self,
  regrib,
  kwargs 
)

Calls self.select(kwargs) to get the product, and calls make on the result.

Parameters
regribA Regrib for data storage
kwargsKeyword arguments are passed to select()

Definition at line 1914 of file regrib.py.

def hwrf.regrib.GRIB1Selector.select (   self,
  kwargs 
)
protected

Attempts to attain a Product from the supplied Task.

Calls a Task's products function to get the Product of interest. The kwargs is a dict of keyword arguments to pass to task.products. Those will override any keyword arguments that were sent to the constructor. If more than one Product is yielded, then ProductAmbiguityError is raised. If no Product is yielded, NoProductError is raised. If the returned Product is not a GRIBBase, TypeError is raised. Otherwise, the result is returned.

Parameters
kwargsa dict to pass to task.products

Definition at line 1923 of file regrib.py.

Referenced by hwrf.regrib.GRIB1Selector.input_valid(), hwrf.regrib.GRIB1Selector.is_ready(), and hwrf.regrib.GRIB1Selector.make().


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