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

Represents an E grid WRF-NMM GRIB1 file, and stores two metadata values: CENLA and CENLO which contain the domain center location. More...

Detailed Description

Represents an E grid WRF-NMM GRIB1 file, and stores two metadata values: CENLA and CENLO which contain the domain center location.

Definition at line 154 of file post.py.

Inheritance diagram for hwrf.post.EGRIB1Product:
hwrf.regrib.UpstreamGRIB1 produtil.datastore.UpstreamFile hwrf.regrib.GRIB1Op produtil.datastore.Product hwrf.regrib.GRIBOp produtil.datastore.Datum hwrf.regrib.GRIBBase

Public Member Functions

def deliver
 Copies the file to its destination, and sets the CENLA and CENLO metadata values to the domain center. More...
 
def make_location (self, outdir)
 Decides a filename which is of the format "outdir/category/prodname". More...
 
def make (self, regrib, args, kwargs)
 Delivers the file. More...
 
def getnscenter (self)
 The domain center latitude. More...
 
def getewcenter (self)
 The domain center longitude. More...
 
- Public Member Functions inherited from hwrf.regrib.UpstreamGRIB1
def __init__ (self, dstore, args, kwargs)
 UpstreamGRIB1 constructor. More...
 
def is_ready (self, args, kwargs)
 Runs the check function on the upstream product, and returns its results. More...
 
def input_valid (self, kwargs)
 Returns True. More...
 
def make (self, regrib, args, kwargs)
 Calls deliver_file to copy the file to a temporary location decided by regrib.gribtemp. More...
 
- Public Member Functions inherited from produtil.datastore.UpstreamFile
def check
 Checks the specified file to see if it is available. More...
 
def undeliver (self)
 Undelivering an UpstreamFile merely sets the internal "available" flag to False. More...
 
def deliver
 Raises InvalidOperation. More...
 
- Public Member Functions inherited from produtil.datastore.Product
def add_callback
 Adds a delivery callback function. More...
 
def has_callbacks (self)
 Returns True if this Product has any callback functions and False otherwise.
 
def call_callbacks
 Calls all delivery callback functions. More...
 
def check (self, kwargs)
 Asks the product to check its own availability and update the database. More...
 
def deliver (self, kwargs)
 Asks the Product to deliver itself. More...
 
def undeliver (self, kwargs)
 "Undelivers" a product. More...
 
def setavailable (self, val)
 Sets the availability to the specified value. More...
 
def is_available (self)
 Is the product available? More...
 
def validate (self)
 Validates this object's Datastore, prodname and category. More...
 
- Public Member Functions inherited from produtil.datastore.Datum
def __init__ (self, dstore, prodname, category, meta=None, cache=30, location=None, kwargs)
 Datum constructor. More...
 
def __enter__ (self)
 Acquires this object's thread lock. More...
 
def __exit__ (self, etype, evalue, traceback)
 Releases this object's thread lock. More...
 
def validate (self)
 Validates this object's Datastore, prodname and category. More...
 
def getid (self)
 Returns the database ID of this datum. More...
 
def getdatastore (self)
 Returns the datastore of this datum. More...
 
def transaction (self)
 Creates, but does not lock, a Transaction for this datum's datastore. More...
 
def getprodtype (self)
 Returns the product type of this Datum. More...
 
def getprodname (self)
 Returns the product name part of the database ID. More...
 
def getcategory (self)
 Returns the product category part of the database ID. More...
 
def getlocation (self)
 Returns the "location" field of this Datum's database entry. More...
 
def setlocation (self, v)
 Sets the "location" field of this Datum's database entry. More...
 
def __hash__ (self)
 Integer hash function. More...
 
def __str__ (self)
 Human-readable description of this Datum. More...
 
def __repr__ (self)
 Python code-like description of this Datum. More...
 
def __cmp__ (self, other)
 Compares two Datums' prodnames and categories. More...
 
def set_loc_avail (self, loc, avail)
 Sets the location and availability of this Datum in a single transaction. More...
 
def update (self)
 Discards all cached metadata and refreshes it from the Datastore. More...
 
def __getitem__ (self, k)
 Returns the value of the specified metadata key or raises KeyError. More...
 
def meta
 Return the value of a metadata key. More...
 
def get
 Alias for self.meta() Returns the value of the specified metadata key or returns default if it is unset. More...
 
def __setitem__ (self, k, v)
 Sets the value of the specified metadata key. More...
 
def __delitem__ (self, k)
 Deletes the specified metadata key, which must not be "available" or "location". More...
 
def __contains__ (self, k)
 Determines if a metadata key is set. More...
 
def iteritems (self)
 Iterates over all metadata (key,value) pairs for this Datum, including "available" and "location". More...
 
- 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...
 

Properties

 nscenter
 The domain center latitude or None if unknown. More...
 
 ewcenter
 The domain center longitude or None if unknown. More...
 
- Properties inherited from hwrf.regrib.UpstreamGRIB1
 resultfile
 The path to the result file, in this case self.location. More...
 
- Properties inherited from produtil.datastore.Product
 available
 Read-write property: is the product available? More...
 
- Properties inherited from produtil.datastore.Datum
 prodname = property(getprodname,None,None,)
 Read-only property, an alias for getprodname(): the product name part of the database ID. More...
 
 category = property(getcategory,None,None,)
 Read-only property, an alias for getcategory(), the category name part of the database ID. More...
 
 prodtype
 Read-only property, an alias for getprodtype(), the product type. More...
 
 did
 Read-only property, an alias for getid(). More...
 
 dstore
 Read-only property, an alias for getdatastore(), the Datastore in which this Datum resides. More...
 
 location
 Read-write property, an alias for getlocation() and setlocation(). More...
 
- Properties inherited from hwrf.regrib.GRIBOp
 action
 A read-only property: this objects action function. More...
 

Additional Inherited Members

- Public Attributes inherited from produtil.datastore.UpstreamFile
 available
 

Member Function Documentation

def hwrf.post.EGRIB1Product.deliver (   self,
  location,
  fileinfo,
  logger = None 
)

Copies the file to its destination, and sets the CENLA and CENLO metadata values to the domain center.

Parameters
locationthe destination location
fileinfoa dict containing fromloc, the location; CENLA, the domain center latitude; and CENLO, the domain center longitude.
loggera logging.Logger for log messages

Definition at line 158 of file post.py.

def hwrf.post.EGRIB1Product.getewcenter (   self)

The domain center longitude.

Definition at line 200 of file post.py.

def hwrf.post.EGRIB1Product.getnscenter (   self)

The domain center latitude.

Definition at line 197 of file post.py.

def hwrf.post.EGRIB1Product.make (   self,
  regrib,
  args,
  kwargs 
)

Delivers the file.

Returns
a hwrf.regrib.GRIB1File for the file.
Parameters
regribthe hwrf.regrib.Regrib with input information
args,kwargsignored

Definition at line 188 of file post.py.

def hwrf.post.EGRIB1Product.make_location (   self,
  outdir 
)

Decides a filename which is of the format "outdir/category/prodname".

Parameters
outdirthe output directory

Definition at line 183 of file post.py.

Property Documentation

hwrf.post.EGRIB1Product.ewcenter
static
Initial value:
1 = property(getewcenter,None,None,
2  'Returns None or the center longitude of this GRIB1 file.')

The domain center longitude or None if unknown.

Definition at line 207 of file post.py.

hwrf.post.EGRIB1Product.nscenter
static
Initial value:
1 = property(getnscenter,None,None,
2  'Returns None or the center latitude of this GRIB1 file.')

The domain center latitude or None if unknown.

Definition at line 204 of file post.py.


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