|
HWRF
trunk@4391
|
A FileProduct that delivers a subset of a track. More...
A FileProduct that delivers a subset of a track.
This is part of the internal implementation of TrackerTask and should not be used directly. It is a FileProduct that delivers a cleaned-up, subsetted version of the tracker output.
Definition at line 415 of file tracker.py.
Public Member Functions | |
| def | __init__ (self, kwargs) |
| Create a CleanATCFSubsetProduct that will deliver a track with the specified last allowable forecast hour. More... | |
| def | deliver |
| Reads the tracker output, discarding everything after the specified forecast hour. More... | |
| def | process_line (self, tracker, lastfhr, freq, cut, line) |
| Processes one line of the track file. More... | |
Public Member Functions inherited from produtil.datastore.FileProduct | |
| def | undeliver |
| Undoes the effect of deliver() More... | |
| def | deliver |
| Delivers the file to a destination. 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 Attributes | |
| available | |
Public Attributes inherited from produtil.datastore.FileProduct | |
| available | |
Additional Inherited Members | |
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... | |
| def hwrf.tracker.CleanATCFSubsetProduct.__init__ | ( | self, | |
| kwargs | |||
| ) |
Create a CleanATCFSubsetProduct that will deliver a track with the specified last allowable forecast hour.
| kwargs | passed to produtil.datastore.FileProduct.__init__() |
Definition at line 421 of file tracker.py.
| def hwrf.tracker.CleanATCFSubsetProduct.deliver | ( | self, | |
| tracker, | |||
| fhr, | |||
logger = None |
|||
| ) |
Reads the tracker output, discarding everything after the specified forecast hour.
If an invalid line is found after time 0, that line and everything after it is discarded.
| tracker | the task that ran the tracker |
| fhr | the last forecast hour to include |
| logger | a logging.Logger for messages |
Definition at line 429 of file tracker.py.
| def hwrf.tracker.CleanATCFSubsetProduct.process_line | ( | self, | |
| tracker, | |||
| lastfhr, | |||
| freq, | |||
| cut, | |||
| line | |||
| ) |
Processes one line of the track file.
Decides if it is time to cease processing of the track file (cut off the track) or continue parsing.
| tracker | the task that ran the tracker |
| lastfhr | the last forecast hour to include |
| freq | the output frequency in hours. This allows one to turn an hourly track into a six hourly track |
| cut | index of the last character to include from each line For example, 112 would only include up to the RMW field. |
| line | the line to process. |
Definition at line 472 of file tracker.py.
Referenced by hwrf.tracker.CleanATCFSubsetProduct.deliver().
1.8.10