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

a class that contains configuration information More...

Detailed Description

a class that contains configuration information

This class keeps track of configuration information for all tasks in a running HWRF model. It can be used in a read-only manner as if it was a ConfigParser object. All HWRFTask objects require an HWRFConfig object to keep track of registered task names via the register_task_name method, the current forecast cycle (cycle property) and the Datastore object (datastore property).

This class should never be instantiated directly. Instead, you should use the hwrf.config.from_string or hwrf.config.from_file to read configuration information from an in-memory string or a file.

Also note that this class should not be used to create a new config file for the first HWRF job in a workflow. The hwrf.launcher module does that for you.

Definition at line 396 of file config.py.

Inheritance diagram for hwrf.config.HWRFConfig:
hwrf.launcher.HWRFLauncher

Public Member Functions

def __init__
 HWRFConfig constructor. More...
 
def readstr (self, source)
 read config data and add it to this object More...
 
def read (self, source)
 reads and parses a config file More...
 
def readfp (self, source)
 read config data from an open file More...
 
def readstr (self, string)
 reads config data from an in-memory string More...
 
def set_options (self, section, kwargs)
 set values of several options in a section More...
 
def read_precleaned_vitfile (self, vitfile)
 reads tcvitals More...
 
def realtime (self)
 is this a real-time simulation? More...
 
def set (self, section, key, value)
 set a config option More...
 
def __enter__ (self)
 grab the thread lock More...
 
def __exit__ (self, a, b, c)
 release the thread lock More...
 
def register_hwrf_task (self, name)
 add an hwrf.hwrftask.HWRFTask to the database More...
 
def log
 returns a logging.Logger object More...
 
def getdatastore (self)
 returns the Datastore More...
 
def getcycle (self)
 get the analysis time More...
 
def setcycle (self, cycle)
 set the analysis time More...
 
def set_time_vars (self)
 internal function that sets time-related variables More...
 
def add_section (self, sec)
 add a new config section More...
 
def has_section (self, sec)
 does this section exist? More...
 
def has_option (self, sec, opt)
 is this option set? More...
 
def getdir
 query the "dir" section More...
 
def getloc
 search the config, exe and dir sections in that order More...
 
def getexe
 query the "exe" section More...
 
def __getitem__ (self, arg)
 convenience function; replaces self.items and self.get More...
 
def makedirs (self, args)
 calls produtil.fileop.makedirs() on directories in the [dir] section More...
 
def keys (self, sec)
 get options in a section More...
 
def items
 get the list of (option,value) tuples for a section More...
 
def write (self, fileobject)
 write the contents of this HWRFConfig to a file More...
 
def getraw
 return the raw value of an option More...
 
def strinterp (self, sec, string, kwargs)
 perform string expansion More...
 
def timestrinterp (self, sec, string, ftime, atime=None, kwargs)
 performs string expansion, including time variables More...
 
def getint
 get an integer value More...
 
def getfloat
 get a float value More...
 
def getstr
 get a string value More...
 
def get
 get the value of an option from a section More...
 
def options (self, sec)
 what options are in this section? More...
 
def getboolean
 alias for getbool: get a bool value More...
 
def getbool
 get a bool value More...
 

Properties

 datastore
 read-only property: the Datastore object for this HWRF simulation More...
 
 cycle
 the analysis cycle, a datetime.datetime object More...
 

Constructor & Destructor Documentation

def hwrf.config.HWRFConfig.__init__ (   self,
  conf = None 
)

HWRFConfig constructor.

Creates a new HWRFConfig object.

Parameters
confthe underlying ConfigParser.SafeConfigParser object that stores the actual config data

Definition at line 414 of file config.py.

Member Function Documentation

def hwrf.config.HWRFConfig.__enter__ (   self)

grab the thread lock

Grabs this HWRFConfig's thread lock. This is only for future compatibility and is never used.

Definition at line 525 of file config.py.

def hwrf.config.HWRFConfig.__exit__ (   self,
  a,
  b,
  c 
)

release the thread lock

Releases this HWRFConfig's thread lock. This is only for future compatibility and is never used.

Parameters
a,b,cunused

Definition at line 531 of file config.py.

def hwrf.config.HWRFConfig.__getitem__ (   self,
  arg 
)

convenience function; replaces self.items and self.get

This is a convenience function that provides access to the self.items or self.get functions.

  • conf["section"] – returns a dict containing the results of self.items(arg)
  • conf[a,b,c] – returns self.get(a,b,c) (b and c are optional)
    Parameters
    argthe arguments: a list or string

Definition at line 721 of file config.py.

def hwrf.config.HWRFConfig.add_section (   self,
  sec 
)

add a new config section

Adds a section to this HWRFConfig. If the section did not already exist, it will be initialized empty. Otherwise, this function has no effect.

Parameters
secthe new section's name

Definition at line 643 of file config.py.

def hwrf.config.HWRFConfig.get (   self,
  sec,
  opt,
  default = None,
  badtypeok = False,
  morevars = None,
  taskvars = None 
)

get the value of an option from a section

Gets option opt from section sec, expands it and converts to a string. If the option is not found and default is specified, returns default. If badtypeok, returns default if the option is found, but cannot be converted. The morevars is used during string expansion: if {abc} is in the value of the given option, and morevars contains a key abc, then {abc} will be expanded using that value. The morevars is a dict that allows the caller to override the list of variables for string extrapolation.

Parameters
sec,optthe section and option
defaultif specified and not None, then the default is returned if an option has no value or the section does not exist
badtypeokis True, and the conversion fails, and a default is specified, the default will be returned.
morevars,taskvarsdicts of more variables for string expansion

Definition at line 1020 of file config.py.

Referenced by hwrf.wrfbase.WRFDomains.__contains__(), hwrf.config.HWRFConfig.__getitem__(), hwrf.wrfbase.WRFDomains.__getitem__(), hwrf.wrfbase.WRFDomains.add(), hwrf.wrf.WRFSimulation.analysis_name(), produtil.datastore.UpstreamFile.check(), hwrf.regrib.GRIB1Product.getgrib1grbindex(), hwrf.regrib.GRIB1Product.getgrib1grid(), hwrf.regrib.GRIB1Product.getgrib1index(), hwrf.regrib.GRIB2Product.getgrib2grid(), hwrf.regrib.GRIB2Product.getgrib2index(), and hwrf.launcher.HWRFLauncher.sanity_check().

def hwrf.config.HWRFConfig.getbool (   self,
  sec,
  opt,
  default = None,
  badtypeok = False,
  morevars = None,
  taskvars = None 
)

get a bool value

Gets option opt from section sec and expands it; see "get" for details. Attempts to convert it to a bool

Parameters
sec,optthe section and option
defaultif specified and not None, then the default is returned if an option has no value or the section does not exist
badtypeokis True, and the conversion fails, and a default is specified, the default will be returned.
morevars,taskvarsdicts of more variables for string expansion

Definition at line 1070 of file config.py.

Referenced by hwrf.config.HWRFConfig.getboolean(), hwrf.launcher.HWRFLauncher.make_holdvars(), hwrf.config.HWRFConfig.realtime(), hwrf.launcher.HWRFLauncher.sanity_check(), hwrf.launcher.HWRFLauncher.sanity_check_archive(), hwrf.launcher.HWRFLauncher.sanity_check_config_files(), hwrf.launcher.HWRFLauncher.sanity_check_coupling(), hwrf.launcher.HWRFLauncher.sanity_check_da(), hwrf.launcher.HWRFLauncher.sanity_check_ensemble(), hwrf.launcher.HWRFLauncher.sanity_check_executables(), hwrf.launcher.HWRFLauncher.sanity_check_expt(), and hwrf.launcher.HWRFLauncher.sanity_check_fix_files().

def hwrf.config.HWRFConfig.getboolean (   self,
  sec,
  opt,
  default = None,
  badtypeok = False,
  morevars = None,
  taskvars = None 
)

alias for getbool: get a bool value

This is an alias for getbool for code expecting a ConfigParser. Gets option opt from section sec and expands it; see "get" for details. Attempts to convert it to a bool

Parameters
sec,optthe section and option
defaultif specified and not None, then the default is returned if an option has no value or the section does not exist
badtypeokis True, and the conversion fails, and a default is specified, the default will be returned.
morevars,taskvarsdicts of more variables for string expansion

Definition at line 1054 of file config.py.

def hwrf.config.HWRFConfig.getcycle (   self)

get the analysis time

Returns the analysis time of this HWRF workflow as a datetime.datetime.

Definition at line 585 of file config.py.

def hwrf.config.HWRFConfig.getdatastore (   self)

returns the Datastore

Returns the produtil.datastore.Datastore object for this HWRFConfig.

Definition at line 563 of file config.py.

def hwrf.config.HWRFConfig.getdir (   self,
  name,
  default = None,
  morevars = None,
  taskvars = None 
)
def hwrf.config.HWRFConfig.getexe (   self,
  name,
  default = None,
  morevars = None,
  taskvars = None 
)

query the "exe" section

Search the "exe" section.

Returns
the specified key (name) from the "exe" section. Other options are passed to self.getstr.
Parameters
defaultthe default value if the option is unset
morevarsmore variables for string substitution
taskvarseven more variables for string substitution
namethe option name to search for

Definition at line 707 of file config.py.

Referenced by hwrf.relocate.Merge.blend_gsi(), hwrf.tracker.TrackerTask.concat_grib(), hwrf.finalmergetask.FinalMergeTask.convert_wrfinput2bin(), hwrf.nhc_products.NHCProducts.deliver_wrfdiag(), hwrf.finalmergetask.FinalMergeTask.final_merge(), hwrf.finalmergetask.FinalMergeTask.finalmerge2netcdf(), hwrf.hycom.HYCOMInit.find_rtofs_data(), hwrf.wps.Ungrib.get_grib(), hwrf.relocate.Merge.inter_2to1ges(), hwrf.relocate.Merge.inter_3to2(), hwrf.multistorm.WRFAtmosMultiStorm.make_namelist(), hwrf.fcsttask.WRFTaskBase.make_namelist(), hwrf.fcsttask.RealNMM.make_namelist(), hwrf.copywrf.WRFCopyTask.ncks_path(), hwrf.ww3.WW3Post.ncks_path(), hwrf.bufrprep.Bufrprep.prep_prepbufr(), hwrf.ensda.CycleTDRCheck.readensdatrigger(), hwrf.bufrprep.Bufrprep.readtdrstmid(), hwrf.bufrprep.Bufrprep.readtdrtime(), hwrf.relocate.Stage1.relocate_storm(), hwrf.relocate.Stage2.relocate_storm(), hwrf.relocate.Merge.relocate_storm(), hwrf.fcsttask.WRFAnl4Trak.retime_wrfout(), hwrf.gsipost.GSIPost.run(), hwrf.ww3.WW3Init.run(), hwrf.nhc_products.NHCProducts.run(), hwrf.post.PostOneWRF.run(), hwrf.ww3.WW3Post.run(), hwrf.wps.Geogrid.run(), hwrf.wps.Ungrib.run(), hwrf.wps.Metgrid.run(), hwrf.tracker.TrackerTask.run(), hwrf.coupling.CoupledWRF.run_exe(), hwrf.finalmergetask.FinalMergeTask.run_exe(), hwrf.fcsttask.WRFTaskBase.run_exe(), hwrf.finalmergetask.FinalMergeTask.run_ext(), hwrf.relocate.RelocationTask.run_ext(), hwrf.gsi.GSIBase.run_gsi_exe(), hwrf.prep.PrepHybrid.run_ipiece(), hwrf.launcher.HWRFLauncher.sanity_check_executables(), hwrf.relocate.Stage3.update_3dvar(), hwrf.relocate.Merge.update_3dvar(), and hwrf.gsi.GSIBase.wrfout_copier().

def hwrf.config.HWRFConfig.getfloat (   self,
  sec,
  opt,
  default = None,
  badtypeok = False,
  morevars = None,
  taskvars = None 
)

get a float value

Gets option opt from section sec and expands it; see "get" for details. Attempts to convert it to a float

Parameters
sec,optthe section and option
defaultif specified and not None, then the default is returned if an option has no value or the section does not exist
badtypeokis True, and the conversion fails, and a default is specified, the default will be returned.
morevars,taskvarsdicts of more variables for string expansion

Definition at line 990 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.decide_domain_center().

def hwrf.config.HWRFConfig.getint (   self,
  sec,
  opt,
  default = None,
  badtypeok = False,
  morevars = None,
  taskvars = None 
)

get an integer value

Gets option opt from section sec and expands it; see "get" for details. Attempts to convert it to an int.

Parameters
sec,optthe section and option
defaultif specified and not None, then the default is returned if an option has no value or the section does not exist
badtypeokis True, and the conversion fails, and a default is specified, the default will be returned.
morevars,taskvarsdicts of more variables for string expansion

Definition at line 975 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.gen_vitals(), hwrf.launcher.HWRFLauncher.make_holdvars(), hwrf.launcher.HWRFLauncher.sanity_check_coupling(), hwrf.launcher.HWRFLauncher.sanity_check_ensemble(), and hwrf.launcher.HWRFLauncher.sanity_check_forecast_length().

def hwrf.config.HWRFConfig.getloc (   self,
  name,
  default = None,
  morevars = None,
  taskvars = None 
)

search the config, exe and dir sections in that order

Find the location of a file in the named option. Searches the [config], [exe] and [dir] sections in order for an option by that name, returning the first one found.

Parameters
defaultthe default value if the option is unset
morevarsmore variables for string substitution
taskvarseven more variables for string substitution
namethe option name to search for
Returns
the resulting value

Definition at line 686 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.sanity_check_archive().

def hwrf.config.HWRFConfig.getraw (   self,
  sec,
  opt,
  default = None 
)

return the raw value of an option

Returns the raw value for the specified section and option, without string interpolation. That is, any {...} will be returned unmodified. Raises an exception if no value is set. Will not search other sections, unlike other accessors.

Parameters
secthe section
optthe option name
defaultthe value to return if the option is unset. If unspecified or None, NoOptionError is raised

Definition at line 791 of file config.py.

def hwrf.config.HWRFConfig.getstr (   self,
  sec,
  opt,
  default = None,
  badtypeok = False,
  morevars = None,
  taskvars = None 
)

get a string value

Gets option opt from section sec and expands it; see "get" for details. Attempts to convert it to a str

Parameters
sec,optthe section and option
defaultif specified and not None, then the default is returned if an option has no value or the section does not exist
badtypeokis True, and the conversion fails, and a default is specified, the default will be returned.
morevars,taskvarsdicts of more variables for string expansion

Definition at line 1005 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.choose_vitbase(), hwrf.launcher.HWRFLauncher.gen_vitals(), hwrf.config.HWRFConfig.getdatastore(), hwrf.config.HWRFConfig.getdir(), hwrf.config.HWRFConfig.getexe(), hwrf.config.HWRFConfig.getloc(), hwrf.launcher.HWRFLauncher.make_holdvars(), hwrf.config.HWRFConfig.makedirs(), hwrf.launcher.HWRFLauncher.read_fake_tcvitals(), hwrf.launcher.HWRFLauncher.read_tcvitals_and_messages(), hwrf.launcher.HWRFLauncher.sanity_check(), hwrf.launcher.HWRFLauncher.sanity_check_config_files(), hwrf.launcher.HWRFLauncher.sanity_check_coupling(), hwrf.launcher.HWRFLauncher.sanity_check_expt(), and hwrf.launcher.HWRFLauncher.sanity_get_fix_version().

def hwrf.config.HWRFConfig.has_option (   self,
  sec,
  opt 
)

is this option set?

Determines if an option is set in the specified section

Returns
True if this HWRFConfig has the given option in the specified section, and False otherwise.
Parameters
secthe section
optthe name of the option in that section

Definition at line 662 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.decide_domain_center(), hwrf.config.HWRFConfig.getloc(), and hwrf.launcher.HWRFLauncher.guess_default_values().

def hwrf.config.HWRFConfig.has_section (   self,
  sec 
)

does this section exist?

Determines if a config section exists (even if it is empty)

Returns
True if this HWRFConfig has the given section and False otherwise.
Parameters
secthe section to check for

Definition at line 653 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.sanity_check_sanity_check().

def hwrf.config.HWRFConfig.items (   self,
  sec,
  morevars = None,
  taskvars = None 
)

get the list of (option,value) tuples for a section

Returns a section's options as a list of two-element tuples. Each tuple contains a config option, and the value of the config option after string interpolation. Note that the special config section inclusion option "@inc" is also returned.

Parameters
secthe section
morevarsvariables for string substitution
taskvarsyet more variables
Returns
a list of (option,value) tuples, where the value is after string expansion

Definition at line 761 of file config.py.

Referenced by hwrf.config.HWRFConfig.__getitem__().

def hwrf.config.HWRFConfig.keys (   self,
  sec 
)

get options in a section

Returns a list containing the config options in the given section.

Parameters
secthe string name of the section

Definition at line 753 of file config.py.

def hwrf.config.HWRFConfig.log (   self,
  sublog = None 
)

returns a logging.Logger object

Returns a logging.Logger object. If the sublog argument is provided, then the logger will be under that subdomain of the "hwrf" logging domain. Otherwise, this HWRFConfig's logger (usually the "hwrf" domain) is returned.

Parameters
sublogthe logging subdomain, or None
Returns
a logging.Logger object

Definition at line 550 of file config.py.

Referenced by hwrf.init.HWRFInit.__init__(), hwrf.post.PostOneWRF.__init__(), hwrf.post.PostManyWRF.__init__(), hwrf.init.FGATInit.__init__(), hwrf.multistorm.RealInit.add_wrfinput(), hwrf.relocate.Stage3.anl_4x(), hwrf.relocate.Stage3.anl_bogus_10m(), hwrf.relocate.Stage3.anl_cs_10m(), hwrf.relocate.Merge.blend_gsi(), hwrf.gribtask.GRIBTask.call_completed_callbacks(), hwrf.tracker.TrackerTask.call_completed_callbacks(), hwrf.post.PostOneWRF.can_run(), hwrf.nhc_products.NHCProducts.canrun(), hwrf.coupling.CoupledWRF.check_all_inputs(), hwrf.relocate.Stage1.check_atcf_hours(), hwrf.wps.Ungrib.check_outfiles(), hwrf.post.PostOneWRF.check_post(), hwrf.relocate.Stage1.check_prior_cycle(), hwrf.relocate.Merge.check_storm_radius(), hwrf.copywrf.WRFCopyTask.compression_copier(), hwrf.tracker.TrackerTask.concat_grib(), hwrf.finalmergetask.FinalMergeTask.convert_wrfinput2bin(), hwrf.relocate.Stage1.copy_ensda_track(), hwrf.relocate.RelocationTask.copy_fixed(), hwrf.relocate.Stage1.copy_hdas(), hwrf.finalmergetask.FinalMergeTask.copy_inputs(), hwrf.relocate.RelocationTask.copy_inputs(), hwrf.relocate.Stage1.copy_namelist(), hwrf.gsi.GSIBase.copy_wrf_inout(), hwrf.gsi.FGATGSI.copy_wrf_inout(), hwrf.relocate.RelocationTask.create_atcf(), hwrf.relocate.Stage2.create_nest(), hwrf.relocate.Stage2.create_track(), hwrf.relocate.Stage3.create_track(), hwrf.relocate.Stage3.cycled_or_weak_run(), hwrf.launcher.HWRFLauncher.decide_domain_center(), hwrf.copywrf.WRFCopyTask.decompression_copier(), hwrf.relocate.RelocationTask.delete_temp(), scripts.exhwrf_output.Deliverer.deliver_file(), hwrf.copywrf.WRFCopyTask.deliver_group(), hwrf.nhc_products.NHCProducts.deliver_outlist(), hwrf.mpipomtc.POMInit.deliver_products(), hwrf.bufrprep.Bufrprep.deliver_products(), hwrf.wps.WPSTask.deliver_products(), hwrf.finalmergetask.FinalMergeTask.deliver_products(), hwrf.relocate.RelocationTask.deliver_products(), hwrf.gsi.GSIBase.deliver_products(), hwrf.fcsttask.WRFAnl.deliver_products(), hwrf.fcsttask.WRFAnl4Trak.deliver_products(), hwrf.fcsttask.AnalysisCycle.deliver_products(), hwrf.nhc_products.NHCProducts.deliver_wrfdiag(), hwrf.relocate.Stage3.ensda_relocate_run(), hwrf.init.FGATInit.fhr_and_init(), hwrf.finalmergetask.FinalMergeTask.final_merge(), hwrf.finalmergetask.FinalMergeTask.finalmerge2netcdf(), hwrf.hycom.HYCOMInit.find_rtofs_data(), hwrf.launcher.HWRFLauncher.gen_vitals(), hwrf.multistorm.FakeInit.geodat(), hwrf.gribtask.GRIBTask.get_data(), hwrf.relocate.Stage3.get_ghost(), hwrf.wps.Ungrib.get_grib(), hwrf.mpipomtc.POMInit.get_inputs(), hwrf.ensda.FromPriorCycle.get_product(), hwrf.config.HWRFConfig.getdatastore(), hwrf.bufrprep.Bufrprep.getstormid(), hwrf.gsi.GSIBase.grab_fix_parm(), hwrf.gsi.GSIBase.grab_gfs_enkf(), hwrf.tracker.TrackerTask.grab_gribs(), hwrf.gsi.FGATGSI.grab_more_inputs(), hwrf.bufrprep.Bufrprep.grab_obstype_section(), hwrf.gsi.GSIBase.grab_obstype_section(), hwrf.bufrprep.Bufrprep.grab_prepbufr(), hwrf.gsi.GSIBase.grab_prepbufr(), hwrf.gsi.GSIBase.grab_wrf_enkf(), hwrf.launcher.HWRFLauncher.guess_default_values(), hwrf.relocate.Stage1.guess_track(), hwrf.fcsttask.RealNMM.initial_prerun(), hwrf.prep.PrepHybrid.input_at(), hwrf.wps.Ungrib.input_at(), hwrf.relocate.Merge.inter_2to1(), hwrf.relocate.Merge.inter_2to1ges(), hwrf.relocate.Stage3.inter_2to2(), hwrf.relocate.Merge.inter_2to2(), hwrf.relocate.Stage3.inter_2to2_again(), hwrf.relocate.Merge.inter_2to3(), hwrf.relocate.Merge.inter_2to6(), hwrf.relocate.Merge.inter_3to2(), hwrf.relocate.Stage3.inter_4to6(), hwrf.wps.WPSTask.io_suffix(), hwrf.coupling.CoupledWRF.link_all_inputs(), hwrf.wps.WPSTask.link_fix(), hwrf.post.PostOneWRF.link_fix(), hwrf.wps.WPSTask.link_geogrid(), hwrf.tracker.TrackerTask.link_grib(), hwrf.fcsttask.FcstTask.link_input(), hwrf.relocate.RelocationTask.make_analysis_namelist(), hwrf.post.PostOneWRF.make_control(), hwrf.coupling.CoupledWRF.make_coupler_namelist(), hwrf.gsi.GSIBase.make_diag_files(), hwrf.relocate.RelocationTask.make_ghost_namelist(), hwrf.gsi.GSIBase.make_gsi_namelist(), hwrf.launcher.HWRFLauncher.make_holdvars(), hwrf.multistorm.WRFAtmosMultiStorm.make_namelist(), hwrf.fcsttask.WRFTaskBase.make_namelist(), hwrf.fcsttask.RealNMM.make_namelist(), hwrf.hycom.HYCOMInit.make_products(), hwrf.gribtask.GRIBTask.make_products(), hwrf.wps.Geogrid.make_products(), hwrf.fcsttask.AnalysisCycle.make_products(), hwrf.fcsttask.WRFAtmos.make_wrf(), hwrf.fcsttask.AnalysisCycle.make_wrf(), hwrf.relocate.Stage1.merge_nest(), hwrf.relocate.Stage2.merge_nests(), hwrf.relocate.Stage1.pert_ct(), hwrf.relocate.Stage3.pert_ct_gfs(), hwrf.relocate.Stage3.pert_ct_weak(), hwrf.bufrprep.Bufrprep.prep_prepbufr(), hwrf.ww3.WW3Init.products(), hwrf.relocate.Stage3.products(), hwrf.launcher.HWRFLauncher.read_fake_tcvitals(), hwrf.config.HWRFConfig.read_precleaned_vitfile(), hwrf.launcher.HWRFLauncher.read_tcvitals_and_messages(), hwrf.ensda.CycleTDRCheck.read_trigger_file(), hwrf.ensda.CycleTDRCheck.readensdatrigger(), hwrf.bufrprep.Bufrprep.readtdrstmid(), hwrf.bufrprep.Bufrprep.readtdrtime(), hwrf.relocate.Stage1.relocate_storm(), hwrf.relocate.Stage2.relocate_storm(), hwrf.relocate.Merge.relocate_storm(), hwrf.fcsttask.WRFAnl4Trak.retime_wrfout(), hwrf.relocate.RelocationTask.rinfo(), hwrf.gsipost.GSIPost.run(), hwrf.mpipomtc.POMInit.run(), hwrf.ww3.WW3Init.run(), hwrf.hycom.HYCOMInit.run(), hwrf.finalmergetask.FinalMergeTask.run(), hwrf.prep.PrepHybrid.run(), hwrf.bufrprep.Bufrprep.run(), hwrf.nhc_products.NHCProducts.run(), hwrf.copywrf.WRFCopyTask.run(), hwrf.post.PostOneWRF.run(), hwrf.ww3.WW3Post.run(), hwrf.hycom.HYCOMPost.run(), hwrf.ensda.FromGFSENKF.run(), hwrf.tracker.TrackerView.run(), hwrf.wps.Geogrid.run(), hwrf.relocate.Stage1.run(), hwrf.gsi.GSIBase.run(), hwrf.wps.Ungrib.run(), hwrf.wps.Metgrid.run(), hwrf.tracker.TrackerTask.run(), hwrf.relocate.Stage2.run(), hwrf.relocate.Stage3.run(), hwrf.relocate.Merge.run(), hwrf.coupling.CoupledWRF.run_exe(), hwrf.finalmergetask.FinalMergeTask.run_exe(), hwrf.fcsttask.WRFTaskBase.run_exe(), hwrf.fcsttask.RealNMM.run_exe(), hwrf.finalmergetask.FinalMergeTask.run_ext(), hwrf.relocate.RelocationTask.run_ext(), hwrf.gsi.GSIBase.run_gsi_exe(), hwrf.copywrf.WRFCopyTask.run_helper(), hwrf.gribtask.GRIBTask.run_helper(), hwrf.mpipomtc.POMInit.run_init(), hwrf.init.HWRFInit.run_init_after_anl(), hwrf.prep.PrepHybrid.run_ipiece(), hwrf.init.HWRFInit.run_real_bdy(), hwrf.init.HWRFInit.run_through_anl(), hwrf.prep.PrepHybrid.runpart(), hwrf.launcher.HWRFLauncher.sanity_check(), hwrf.launcher.HWRFLauncher.sanity_check_directory(), hwrf.coupling.CouplingStatus.set(), hwrf.gribtask.GRIBTask.set_data(), hwrf.bufrprep.Bufrprep.set_tdrstatus(), hwrf.ensda.AlwaysRunENSDA.should_run_ensda(), hwrf.relocate.Stage1.split_wrf(), hwrf.ensda.CycleTDRCheck.tdr_this_cycle(), hwrf.bufrprep.Bufrprep.tdrdump(), hwrf.gribtask.GRIBTask.uncomplete(), hwrf.wps.WPSTask.undeliver_products(), hwrf.hycom.HYCOMPost.unrun(), hwrf.relocate.Stage3.update_3dvar(), hwrf.relocate.Merge.update_3dvar(), hwrf.wrf.ExternalWRFTask.update_state(), hwrf.relocate.Stage3.weak_cold_run(), hwrf.relocate.Stage2.wrf_split(), hwrf.relocate.RelocationTask.wrfanl_at_time(), hwrf.relocate.Stage3.wrfanl_at_time(), hwrf.relocate.RelocationTask.wrfinput_at_time(), hwrf.relocate.Stage3.wrfinput_at_time(), hwrf.gsi.GSIBase.wrfout_copier(), hwrf.post.PostManyWRF.wrftask(), hwrf.bufrprep.Bufrprep.write_vitals(), hwrf.gsi.GSIBase.write_vitals(), and hwrf.relocate.RelocationTask.write_vitals().

def hwrf.config.HWRFConfig.makedirs (   self,
  args 
)

calls produtil.fileop.makedirs() on directories in the [dir] section

This is a simple utility function that calls produtil.fileop.makedirs() on some of the directories in the [dir] section.

Parameters
argsthe keys in the [dir] section for the directories to make.

Definition at line 741 of file config.py.

def hwrf.config.HWRFConfig.options (   self,
  sec 
)

what options are in this section?

Returns a list of options in the given section

Parameters
secthe section

Definition at line 1046 of file config.py.

def hwrf.config.HWRFConfig.read (   self,
  source 
)

reads and parses a config file

Opens the specified config file and reads it, adding its contents to the configuration. This is used to implement the from_file module-scope function. You can use it again on an HWRFConfig object to read additional files.

Parameters
sourcethe file to read
Returns
self

Definition at line 444 of file config.py.

def hwrf.config.HWRFConfig.read_precleaned_vitfile (   self,
  vitfile 
)

reads tcvitals

WARNING: This is presently unused and may be removed. It does not belong in HWRFConfig.

Reads tcvitals from the specified file if specified, or from the current cycle's vitals storage area if not. Does not parse, clean or otherwise modify the vitals: they are assumed to contain output for only one storm, with no duplicate cycles. Ideally, the file should have been created by the hwrf.launcher module. Returns an hwrf.revital.Revital object.

Definition at line 491 of file config.py.

def hwrf.config.HWRFConfig.readfp (   self,
  source 
)

read config data from an open file

Reads a config file from the specified file-like object. This is used to implement the readstr.

Parameters
sourcethe opened file to read
Returns
self

Definition at line 456 of file config.py.

def hwrf.config.HWRFConfig.readstr (   self,
  source 
)

read config data and add it to this object

Given a string with conf data in it, parses the data.

Parameters
sourcethe data to parse
Returns
self

Definition at line 433 of file config.py.

Referenced by hwrf.config.HWRFConfig.readstr().

def hwrf.config.HWRFConfig.readstr (   self,
  string 
)

reads config data from an in-memory string

Reads the given string as a config file. This is used to implement the from_string module-scope function. You can use it again to read more config data into an existing HWRFConfig.

Parameters
stringthe string to parse
Returns
self

Definition at line 466 of file config.py.

def hwrf.config.HWRFConfig.realtime (   self)

is this a real-time simulation?

Is this configuration for a real-time simulation? Defaults to True if unknown. This is the same as doing getbool('config','realtime',True).

Definition at line 511 of file config.py.

Referenced by hwrf.bufrprep.Bufrprep.deliver_products(), hwrf.wps.Ungrib.get_grib(), hwrf.gsi.GSIBase.grab_gfs_enkf(), hwrf.gsi.GSIBase.grab_obstype_section(), hwrf.gsi.GSIBase.grab_wrf_enkf(), hwrf.ww3.WW3Init.products(), hwrf.bufrprep.Bufrprep.run(), hwrf.prep.PrepHybrid.run_ipiece(), and hwrf.ensda.CycleTDRCheck.tdr_this_cycle().

def hwrf.config.HWRFConfig.register_hwrf_task (   self,
  name 
)

add an hwrf.hwrftask.HWRFTask to the database

Checks to ensure that there is no other task by this name, and records the fact that there is now a task. This is used by the hwrf.hwrftask.HWRFTask to ensure only one task is made by any name.

Definition at line 538 of file config.py.

def hwrf.config.HWRFConfig.set (   self,
  section,
  key,
  value 
)

set a config option

Sets the specified config option (key) in the specified section, to the specified value. All three are converted to strings via str() before setting the value.

Definition at line 518 of file config.py.

Referenced by hwrf.config.HWRFConfig.__init__(), hwrf.launcher.HWRFLauncher.decide_domain_center(), hwrf.launcher.HWRFLauncher.gen_vitals(), hwrf.launcher.HWRFLauncher.guess_default_values(), hwrf.launcher.HWRFLauncher.make_holdvars(), hwrf.launcher.HWRFLauncher.sanity_check(), hwrf.launcher.HWRFLauncher.sanity_check_da(), and hwrf.config.HWRFConfig.timestrinterp().

def hwrf.config.HWRFConfig.set_options (   self,
  section,
  kwargs 
)

set values of several options in a section

Sets the value of several options in one section. The keywords arguments are the names of the options to set and the keyword values are the option values.

Parameters
sectionthe section being modified
kwargsadditional keyword arguments are the option names and values

Definition at line 478 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.set_storm().

def hwrf.config.HWRFConfig.set_time_vars (   self)

internal function that sets time-related variables

Sets many config options in the [config] section based on this HWRF workflow's analysis time. This is called automatically when the cycle property is assigned. You never need to call this function directly.

YMDHM - 201409171200 = forecast time September 17, 2014 at 12:00 UTC YMDH - 2014091712 YMD - 20140917 year - 2014 YYYY - 2014 YY - 14 (year % 100) CC - 20 (century) cen - 20 month - 09 MM - 09 day - 17 DD - 17 hour - 12 cyc - 12 HH - 12 minute - 00 min - 00

Definition at line 610 of file config.py.

Referenced by hwrf.config.HWRFConfig.setcycle().

def hwrf.config.HWRFConfig.setcycle (   self,
  cycle 
)

set the analysis time

Sets the analysis time of this HWRF workflow. Also sets the [config] section's "cycle" option. Accepts anything that hwrf.numerics.to_datetime recognizes.

Definition at line 593 of file config.py.

def hwrf.config.HWRFConfig.strinterp (   self,
  sec,
  string,
  kwargs 
)

perform string expansion

Performs this HWRFConfig's string interpolation on the specified string, as if it was a value from the specified section.

Parameters
secthe section name
stringthe string to expand
kwargsmore variables for string substitution

Definition at line 807 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.make_holdvars().

def hwrf.config.HWRFConfig.timestrinterp (   self,
  sec,
  string,
  ftime,
  atime = None,
  kwargs 
)

performs string expansion, including time variables

Performs this HWRFConfig's string interpolation on the specified string, as self.strinterp would, but adds in additional keys based on the given analysis and forecast times. The keys are the same as the keys added to [config] for the cycle, except with "a" prepended for the analysis time, or "f" for the forecast time. There are three more keys for the difference between the forecast an analysis time. The famin is the forecast time in minutes, rounded down. The fahr and fahrmin are the forecast hour, rounded down, and the remainder in minutes, rounded down to the next nearest minute.

If the analysis time is None or unspecified, then self.cycle is used. The atime can be anything understood by hwrf.numerics.to_datetime and the ftime can be anything understood by hwrf.numerics.to_datetime_rel, given the atime (or, absent atime, self.cycle) as the second argument.

This is implemented as a wrapper around the self._time_formatter object, which knows how to expand the a* and f* variables without having to generate all of them.

Parameters
secthe section name
stringthe string to expand
ftimethe forecast time or None
atimethe analysis time or None
kwargsmore variables for string expansion

Definition at line 826 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.gen_vitals().

def hwrf.config.HWRFConfig.write (   self,
  fileobject 
)

write the contents of this HWRFConfig to a file

Writes the contents of an HWRFConfig to the specified file, without interpolating (expanding) any strings. The file will be suitable for reading in to a new HWRFConfig object in a later job. This is used by the hwrf.launcher module to create the initial config file.

Parameters
fileobjectan opened file to write to

Definition at line 780 of file config.py.

Property Documentation

hwrf.config.HWRFConfig.cycle
static
Initial value:
1 = property(getcycle,setcycle,None,
2  )

the analysis cycle, a datetime.datetime object

Definition at line 607 of file config.py.

Referenced by hwrf.launcher.HWRFLauncher.gen_vitals(), hwrf.launcher.HWRFLauncher.guess_default_values(), hwrf.launcher.HWRFLauncher.sanity_check(), and hwrf.config.HWRFConfig.timestrinterp().

hwrf.config.HWRFConfig.datastore
static
Initial value:
1 = property(getdatastore,None,None, \
2  )

read-only property: the Datastore object for this HWRF simulation

Definition at line 580 of file config.py.


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