HWRF  trunk@4391
Public Member Functions | Public Attributes | List of all members
hwrf.init.FGATInit Class Reference

The FGATInit represents an array of InitBeforeGSI objects, each run for one forecast hour of some parent model (usually GDAS). More...

Detailed Description

The FGATInit represents an array of InitBeforeGSI objects, each run for one forecast hour of some parent model (usually GDAS).

Definition at line 779 of file init.py.

Inheritance diagram for hwrf.init.FGATInit:
hwrf.hwrftask.HWRFTask produtil.datastore.Task produtil.datastore.Datum

Public Member Functions

def __init__ (self, ds, conf, section, wrf, initlen, fcstlen, outdir=None, realfcst=False, wrfghost=None, prep=True, track=True, in_ftimes=None, in_atime=None, cycling_interval=6 *3600, gsi_d01=None, gsi_d02=None, gsi_d03=None, ibdystep=None, prepfcst=True, kwargs)
 Creates an FGATInit, passing most arguments to the child InitBeforeGSI objects' constructors. More...
 
def init_at_time (self, when)
 Get the subtask for one time. More...
 
def inputiter (self)
 Iterates over needed input data. More...
 
def get_ghosts (self, domain)
 Get all ghost output products. More...
 
def get_relocates
 Get hwrf.relocate.Stage3 objects or output products for each FGAT time. More...
 
def parent_fhrs (self)
 Iterates over all fgat times as datetime.datetime objects. More...
 
def fhr_and_init (self)
 Iterates over pairs of (fhr,init) where fhr is a fraction.Fraction FGAT hour, and init is an InitBeforeGSI object for that time. More...
 
def run (self)
 Runs all InitBeforeGSI.run() commands in sequence. More...
 
def run_through_anl (self)
 Runs all InitBeforeGSI.run_through_anl() commands in sequence. More...
 
def run_init_after_anl (self)
 Runs all InitBeforeGSI.run_after_anl() commands in sequence. More...
 
def run_real_bdy (self)
 Runs all InitBeforeGSI.run_real_bdy() commands in sequence. More...
 
def run_relocate (self)
 Runs all InitBeforeGSI.run_relocate() commands in sequence. More...
 
- Public Member Functions inherited from hwrf.hwrftask.HWRFTask
def __init__ (self, dstore, conf, section, taskname=None, workdir=None, outdir=None, storminfo=UNSPECIFIED, taskvars=UNSPECIFIED, kwargs)
 Creates an HWRFTask. More...
 
def isfakestorm (self)
 
def ismultistorm (self)
 
def get_workdir (self)
 Returns the directory the class should work in, as set by the "workdir" metadata value. More...
 
def set_workdir (self, val)
 Sets the directory the class should work in. More...
 
def get_outdir (self)
 Gets the directory that should receive output data. More...
 
def set_outdir (self, val)
 Sets the directory that should receive output data. More...
 
def realtime (self)
 Is this job a real-time forecast job? More...
 
def redirect (self)
 Should subprograms' outputs be redirected to separate files?
 
def scrub (self)
 Should temporary files be deleted as soon as they are not needed?
 
def tvset (self, opt, val)
 Sets a taskvar option's value. More...
 
def tvdel (self, opt)
 Deletes an object-local value set by tvset. More...
 
def tvget (self, opt)
 Gets a taskvar's value. More...
 
def tvhave
 Is a taskvar set? More...
 
def taskvars (self)
 The dict of object-local values used for string substitution. More...
 
def confint
 Alias for self.conf.getint for section self.section. More...
 
def confstr
 Alias for self.conf.getstr for section self.section. More...
 
def conffloat
 Alias for self.conf.getfloat for section self.section. More...
 
def confbool
 Alias for self.conf.getbool for section self.section. More...
 
def confget
 Alias for self.conf.get for section self.section. More...
 
def confitems
 Alias for self.conf.items for section self.section. More...
 
def confstrinterp (self, string, section=None, kwargs)
 Alias for self.icstr for backward compatibility. More...
 
def conftimestrinterp (self, string, ftime, atime=None, section=None, kwargs)
 Alias for self.timestr for backward comaptibility. More...
 
def confraw
 Get a raw configuration value before string expansion. More...
 
def icstr (self, string, section=None, kwargs)
 Expands a string in the given conf section. More...
 
def timestr (self, string, ftime, atime=None, section=None, kwargs)
 Expands a string in the given conf section, including time vars. More...
 
def getdir
 Alias for hwrf.config.HWRFConfig.get() for the "dir" section. More...
 
def getexe
 Alias for hwrf.config.HWRFConfig.get() for the "exe" section. More...
 
def getconf (self)
 Returns this HWRFTask's hwrf.config.HWRFConfig object. More...
 
def getsection (self)
 Returns this HWRFTask's section name in the HWRFConfig. More...
 
def log
 Obtain a logging domain. More...
 
def inputiter (self)
 Iterates over all inputs required by this task. More...
 
- Public Member Functions inherited from produtil.datastore.Task
def __init__ (self, dstore, taskname, logger=None, kwargs)
 Task constructor. More...
 
def jlogfile (self)
 returns the jlogfile logger. More...
 
def postmsg (self, message, args, kwargs)
 same as produtil.log.jlogger.info() More...
 
def setstate (self, val)
 Sets the state of this job. More...
 
def getstate (self)
 Returns the job state. More...
 
def strstate (self)
 A string representation of the job state. More...
 
def gettaskname (self)
 Returns the task name part of the database ID, which is the same as the prodname. More...
 
def products (self, args, kwargs)
 Iterate over the products this task produces. More...
 
def log (self)
 Returns the logger object for this task. More...
 
def clean (self)
 Cleans up any unneeded data used by this task. More...
 
def unrun (self)
 Undoes the effect of run(). More...
 
def run (self)
 Performs the work this Task should do and generates all products. More...
 
def is_completed (self)
 Is this task complete? More...
 
def completed (self)
 Read-only property: is this task completed? Same as is_completed() More...
 
def runpart (self)
 Run some of this task's work, deliver some products. 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

 outdir
 The directory in intercom to receive output. More...
 
 inits
 InitBeforeGSI objects for individual times. More...
 
 ftime2init
 A mapping from forecast time to InitBeforeGSI objects. More...
 
- Public Attributes inherited from hwrf.hwrftask.HWRFTask
 storminfo
 The hwrf.storminfo.StormInfo describing the vitals information for the storm processed by this HWRFTask. More...
 

Additional Inherited Members

- Properties inherited from hwrf.hwrftask.HWRFTask
 workdir
 The directory in which this task should be run. More...
 
 outdir
 The directory in which this task should deliver its final output. More...
 
 conf
 This HWRFTask's hwrf.config.HWRFConfig object. More...
 
 section
 The confsection in self.section for this HWRFTask (read-only) More...
 
- Properties inherited from produtil.datastore.Task
 state
 Read-write property: the job state. More...
 
 taskname
 Read-only property: the name of this task. 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...
 

Constructor & Destructor Documentation

def hwrf.init.FGATInit.__init__ (   self,
  ds,
  conf,
  section,
  wrf,
  initlen,
  fcstlen,
  outdir = None,
  realfcst = False,
  wrfghost = None,
  prep = True,
  track = True,
  in_ftimes = None,
  in_atime = None,
  cycling_interval = 6*3600,
  gsi_d01 = None,
  gsi_d02 = None,
  gsi_d03 = None,
  ibdystep = None,
  prepfcst = True,
  kwargs 
)

Creates an FGATInit, passing most arguments to the child InitBeforeGSI objects' constructors.

The cycling_interval is the time to subtract from this model's analysis time to get the parent model's analysis time. The default of six hours (6*3600 as an int) is correct for the operational HWRF and GDAS.

Parameters
dspassed to Datum: the Datastore object for this Task
confthe conf object for this task
sectionthe conf section for this task
wrf(required) the WRFSimulation representing the full WRF forecast
initlen(required) the length of the real_nmm run for the initialization
fcstlen(required) the length of the real_nmm run for the full forecast
outdirThe directory in intercom to receive output. Default: intercom/{taskname}. Individual initialization components will be in subdirectories.
outdirThe directory in intercom to receive output. Default: intercom/{taskname}. Individual initialization components will be in subdirectories.
realfcstFlag: do we need to run real for the full forecast length?
wrfghosthwrf.wrf.WRFSimulation object for the wrfghost files. If absent, no wrfghost-related jobs will be run
prepif True, use prep_hybrid input. This changes the way in which real_nmm, ungrib and metgrid are run.
trackRun a post, regribber and tracker on the wrfanl history file for domain 1, to find the location of the parent vortex.
in_ftimesarray of parent model forecast hours to treat as "time 0" for each FGAT time. This is used for the FGAT to use GDAS forecasts as input
in_atimeparent model analysis time. Default: start time of wrf
cycling_intervalHWRF cycling interval in seconds.
gsi_d01passed to the hwrf.relocate constructors' gsi_d01 argument
gsi_d02passed to the hwrf.relocate constructors' gsi_d02 argument
gsi_d03passed to the hwrf.relocate constructors' gsi_d03 argument
ibdystepOptional: the boundary input frequency for the ~1 minute forecasts. Default: bdystep.
prepfcstIf True AND prep=True, use prep_hybrid for boundary conditions. This changes how realfcst, ungribfcst and metgridfcst are run.
kwargsOther keyword arguments are passed to HWRFTask.__init__

Definition at line 797 of file init.py.

Member Function Documentation

def hwrf.init.FGATInit.fhr_and_init (   self)

Iterates over pairs of (fhr,init) where fhr is a fraction.Fraction FGAT hour, and init is an InitBeforeGSI object for that time.

Definition at line 973 of file init.py.

def hwrf.init.FGATInit.get_ghosts (   self,
  domain 
)

Get all ghost output products.

Parameters
domainThe domain of interest, an hwrf.wrf.WRFDomain

Returns a TimeMapping, mapping from init time to the ghost product output from the runghost member of each init time.

Definition at line 925 of file init.py.

def hwrf.init.FGATInit.get_relocates (   self,
  domain = None 
)

Get hwrf.relocate.Stage3 objects or output products for each FGAT time.

Returns a TimeMapping of objects, one per init time. If a domain is specified, the objects are the wrfinput or ghost product output by the relocation for that domain. If a domain is NOT specified, then the objects are the relocate stage 3 tasks.

Parameters
domainThe domain of interest.

Definition at line 939 of file init.py.

def hwrf.init.FGATInit.init_at_time (   self,
  when 
)

Get the subtask for one time.

Returns the initialization InitBeforeGSI object for the specified time (the earliest time not before the specified time). The time can be an absolute time (2015091418) or a forecast hour (12), as long as it is accepted by the first argument of to_datetime_rel. Raises an exception if the time has no InitBeforeGSI objects.

Definition at line 906 of file init.py.

Referenced by hwrf.init.FGATInit.get_ghosts(), and hwrf.init.FGATInit.get_relocates().

def hwrf.init.FGATInit.inputiter (   self)

Iterates over needed input data.

Calls all inputiter functions for all child objects, hence iterating over all input sources required for all FGAT hours.

Definition at line 917 of file init.py.

def hwrf.init.FGATInit.parent_fhrs (   self)

Iterates over all fgat times as datetime.datetime objects.

Definition at line 968 of file init.py.

Referenced by hwrf.init.FGATInit.fhr_and_init(), and hwrf.gsi.GSIBase.inputiter().

def hwrf.init.FGATInit.run (   self)

Runs all InitBeforeGSI.run() commands in sequence.

Definition at line 1049 of file init.py.

Referenced by produtil.datastore.Task.runpart().

def hwrf.init.FGATInit.run_init_after_anl (   self)

Runs all InitBeforeGSI.run_after_anl() commands in sequence.

Definition at line 1055 of file init.py.

def hwrf.init.FGATInit.run_real_bdy (   self)

Runs all InitBeforeGSI.run_real_bdy() commands in sequence.

Definition at line 1058 of file init.py.

def hwrf.init.FGATInit.run_relocate (   self)

Runs all InitBeforeGSI.run_relocate() commands in sequence.

Definition at line 1061 of file init.py.

def hwrf.init.FGATInit.run_through_anl (   self)

Runs all InitBeforeGSI.run_through_anl() commands in sequence.

Definition at line 1052 of file init.py.

Member Data Documentation

hwrf.init.FGATInit.ftime2init

A mapping from forecast time to InitBeforeGSI objects.

Definition at line 890 of file init.py.

Referenced by hwrf.init.FGATInit.fhr_and_init(), and hwrf.init.FGATInit.init_at_time().

hwrf.init.FGATInit.inits
hwrf.init.FGATInit.outdir

The directory in intercom to receive output.

Individual initialization components will be in subdirectories.

Definition at line 856 of file init.py.


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