1 """!Exceptions raised by the hwrf package
3 This module contains exceptions raised by the hwrf package. The only
4 exceptions are the hwrf.revital and hwrf.storminfo modules which
5 contain their own exceptions for backward compatibility to old
9 """!Base class of all exceptions in this module.
11 This is the base class of exceptions raised by the HWRF module
12 due to HWRF-specific failures. It is possible to get other
13 exceptions from the StandardException hierarchy in certain failure
14 cases. For example, trying to obtain the fifth of three domains
15 may raise KeyError. Also, see pom.exceptions for exceptions that
16 may be raised from the pom package. See the produtil package for
17 exceptions that may come from lower levels."""
23 """!Raised when more than one task is registered with the same
24 name in an HWRFConfig object."""
27 """!Raised when one tries to use an invalid string for an option
38 """!Raised when hwrf.namelist cannot convert a value to or from
39 Fortran namelist format."""
41 """!Raised when an hwrf.namelist is asked for a key that does not
54 @param message the string message
55 @param section the section that was searched
56 @param var the option that was requested"""
57 super(NamelistKeyError,self).
__init__(message)
62 """!Generates a string description of this exception."""
64 return 'trait %s: %s' % (self.
var,self.
message)
68 """!Generates a string representation of this object."""
69 return 'NamelistError(%s,%s,%s)' % \
76 """!Base class of all sanity checker exceptions."""
77 class HWRFDirInsane(HWRFSanityError):
78 """!Raised when a directory is unspecified, missing or invalid."""
83 """!HWRFDirInsane constructor.
84 @param message a string explanation of the problem
85 @param dir the directory in question"""
86 super(HWRFDirInsane,self).
__init__(message)
89 """!Raised when the requested configuration conf or hwrf_expt files
90 fail a sanity check."""
91 class HWRFConfigUnsupported(HWRFConfigInsane):
92 """!Raised when the user requests a configuration that makes sense,
93 but is not supported."""
95 """!Raised when configuration files were specified in the wrong order."""
97 """!Raised when the configuration had a different storm than expected."""
99 """!Raised when the configuration had a different cycle than expected."""
101 """!Raised when a sanity check on a variable's value failed."""
103 """!Raised when input files to HWRF fail a sanity check."""
105 """!Raised when HWRF scripts fail a sanity check."""
107 """!Raised when the HWRF executables fail a sanity check."""
109 """!Raised when the HWRF fix files fail a sanity check."""
111 """!Raised when the sanity check of the HWRF archiving settings
119 """!Raised when the ocean init did not produce some expected outputs."""
121 """Raised when the parent global ocean model data was unavailable."""
123 """Raised when the HyCOM init foregets to choose an executable for
127 """Raised when the wave initialization failes."""
129 """Raised when the wavewatch 3 cannot find necessary input."""
135 """Superclass of atmosphere-ocean-wave-otherthings coupling
138 """Raised when one requests a coupled forecast without specifying
139 what is being coupled."""
141 """Raised when the NCEP Coupler is to be used for coupling but its
142 namelist file is empty or missing."""
148 """!Raised when GSI cannot find a required input file."""
154 """!Base class of hwrf.tracker exceptions."""
156 """!Raised when an impossible tracker configuration is requested,
157 such as running with a grid that is both regional and global."""
159 """!Raised when multiple storms are requested, but only one was
162 """!Base class of exceptions raised when the tracker's input files
163 are missing or invalid."""
165 """!Not currently used, this would be raised when GRIB inputs to
166 the tracker are missing."""
168 """!Raised when no location is specified for a tracker input GRIB
175 """!Base class used for time-related HWRF exceptions."""
179 """!Raised when a timestep is invalid, such as a negative timestep
180 for a situation that requires a positive one."""
182 """!Called when one hour is not divisable by the WRF output
185 """!Raised when an output time is specified in two redundant ways.
187 For example, one could specify a forecast time directly, and also
188 specify the analysis time and forecast time delta."""
190 """!Raised when a time was required, but none was provided."""
192 """!Raised when a timezone is provided. The hwrf package does not
193 support timezones: all times are in UTC."""
195 """!Raised when a time was requested with higher precision than available.
197 Raised when a time was provided that contained fractions of a
198 second, for a function that cannot handle that. For example, the
199 WRF output files must be exactly on a second boundary."""
201 """!Raised when a time is outside the range of times being
202 processed by a function."""
204 """!Raised when an operation has a set of known times, but another
205 provided time is not near one of those known times."""
208 """!Superclass of exceptions relating to groups of one or more
209 distinct times and relationships between them."""
217 """! Constructor for InvalidTimespan
219 @param message the string explanation of the problem
220 @param start the start of the timespan
221 @param end the end of the timespan"""
222 super(InvalidTimespan,self).
__init__(message)
226 """!Raised when the end of a timespan is before the beginning."""
227 class EndNotTimestep(InvalidTimespan):
228 """!Raised when the end of a timespan is not a timestep.
231 Presently unused, this was to indicate that the end of a timespan
232 is not on a timestep, for temporally discrete processes. Such end
233 times are allowed in WRF, so this exception is unused."""
235 """!Raised when a timespan's beginning is not at a timestep."""
237 """!Raised when a timestep is too long for the process under
240 """!Raised when a timestep is too short for the process under
243 """!Raised when a timespan was expected, but none was available."""
249 """!Superclass of errors used by Regrib."""
251 """!Raised when a GRIB file is invalid.
253 Raised when a GRIB file is provided, but that file is invalid.
254 This can be due to either an input to an operation, or the output
255 from the operation."""
257 """!Raised when a Regrib was expecting a GRIB subsetter function,
258 but no such function was provided."""
261 """!Debug assetion in hwrf.regrib used to detect type mismatches.
263 Part of debug assertions in hwrf.regrib, this is raised when the
264 wrong type is generated by the "make" function."""
267 """!Superclass of errors relating to regrib products."""
269 """!Raised when an operation that produces input to Regrib should
270 have produced a Product, but produced nothing at all."""
272 """!Raised when an operation that provides input to Regrib produces
273 more than one product."""
275 """!Raised when a GRIB file should have an index file already, but
279 """!Base class of errors from the hwrf.regrib.RegribMany"""
281 """!Raised when a RegribMany is given an invalid name: one that
282 does not match a known grid or operation."""
285 """!Base class of grid-related regrib errors."""
287 """!Raised when a grid was expected but none was provided."""
289 """!Raised when two GRIB files have non-matching grids, but a
290 matching grid is required."""
293 """!Exceptions for hwrf.regrib.GRIBTask for certain internal errors.
295 Raised by GRIBTask for unexpected errors that did not come from
296 the underlying RegribAll object. This is used in GRIBTask.run's
297 "run it now" mode, when setting raiseall=True."""
303 """!Base class of WRF-related errors."""
305 """!Raised when it is no longer possible to add domains, but the
306 caller tried to add one."""
308 """!Base class of errors related to a WRF domain."""
310 """! WRFDomainError constructor.
311 @param message the string description of the message
312 @param domainname the name of the hwrf.wrf.WRFDomain in question"""
313 super(WRFDomainError,self).
__init__(message)
319 """!Raised when the hwrf.wrf.WRFDomain start type is unrecognized.
321 Raised when the conf value specifying the type of domain parent
322 start information contains invalid data (not "fixed" or "auto.")"""
323 class DomainExists(WRFDomainError):
324 """!Raised when adding a domain, if a domain by the same name
327 """!Raised when attempting to obtain information about when a WRF
328 stream outputs, if the stream is disabled."""
330 """!Raised when failing to run the real_nmm program."""
332 """!Raised when failing to set the parent start location via the
333 set_nest (set_ij_start) program."""
339 """!Parent class of exceptions specific to the hwrf.fcsttask module"""
341 """!Raised when wrf or real want to run but needed input data is missing."""
343 """!Raised when wrf or real want to run but geogrid data is missing"""
345 """!Raised when wrf or real want to run, but metgrid data is missing."""
347 """!Raised when wrf or real want to run, but wrfinput files are missing."""
349 """!Raised when wrf or real want to run, but wrfbdy files are missing."""
351 """!Raised when wrf or real want to run, but wrfanl files are missing."""
353 """!Raised when real wants prep_hybrid data, but that data is missing"""
359 """!Base class of WPS-related exceptions."""
361 """!Raised when WPS inputs are implausable."""
363 """!Raised when geogrid did not create a log file."""
365 """!Raised when a geogrid output file is missing or empty."""
367 """!Raised when ungrib cannot find an input file it needs."""
369 """!Raised for hwrf.wps.Ungrib input problems.
371 Raised when ungrib cannot figure out if an input file is GRIB1 or
372 GRIB2. This error usually means it is neither file type (or it is
375 """!Raised when wgrib or wgrib2 generates an empty or invalid file."""
377 """!Raised when hwrf.wps.Ungrib cannot subset files as requested.
379 Raised when the caller wants to merge and subset GRIB files in
380 a single operation. The Ungrib class does not presently support
387 """!Base class of exceptions related to the prep_hybrid program."""
389 """!Raised when the prep_hybrid program cannot find WPS geogrid
392 """!Raised when the spectral input files to prep_hybrid do not
393 exist after some specified amount of time."""
399 """!Base class of exceptions related to the hwrf.input module."""
401 """!Raised when a configuration file requests a DataCatalog class
402 that does not exist."""
404 """!Raised when an input source is missing the location, or both
405 histprio and fcstprio."""
407 """!Raised when a file transfer, done by an InputSource, was
410 """!Raised when a configuration file requests an unsupported data
411 transfer method (such as carrier pigeon)."""
417 """!Raised upon errors that would cause a retry, in the
418 PostOneWRF.run when passed the raiseall=True argument."""
421 """!Raised when the post's input file is not available and
422 raiseall=True in PostOneWRF.run"""
428 """!Raised when something in the vortex relocation fails."""
430 """!Raised when required inputs to the relocation are missing."""
432 """!Raised when an impossible configuration is requested."""
434 """!Raised when a relocation program did not produce an expected
437 """!Raised when the relocation could not find the prior cycle's 6hr
438 forecast, but it expected to be able to."""
440 """!Raised when the merge cannot find the storm_radius file in the
441 relocate or fix directory."""
443 """!Raised by hwrf.input when trying to get the wrong domain from
444 its hwrf.relocate.Relocate child objects."""
446 """Raised when the relocation could not find the prior cycle's
447 ensemble forecast track, but it expected to be able to."""
Raised when failing to set the parent start location via the set_nest (set_ij_start) program...
def __init__
WRFDomainError constructor.
Raised when one tries to use an invalid string for an option name.
def __init__(self, message, dir)
HWRFDirInsane constructor.
Superclass of errors used by Regrib.
def __init__(self, message, section, var)
Constructor.
domainname
The domain in question, or None if unknown.
Raised when an operation that provides input to Regrib produces more than one product.
Raised when wgrib or wgrib2 generates an empty or invalid file.
Raised when configuration files were specified in the wrong order.
Raised when HWRF scripts fail a sanity check.
Raised when a timestep is too short for the process under consideration.
def __init__(self, message, start, end)
Constructor for InvalidTimespan.
Raised when the relocation could not find the prior cycle's 6hr forecast, but it expected to be able ...
Raised upon errors that would cause a retry, in the PostOneWRF.run when passed the raiseall=True argu...
Raised when geogrid did not create a log file.
Base class of WPS-related exceptions.
Raised when a Regrib was expecting a GRIB subsetter function, but no such function was provided...
Raised when hwrf.namelist cannot convert a value to or from Fortran namelist format.
Raised when a sanity check on a variable's value failed.
end
the end of the problematic timespan
Raised when the spectral input files to prep_hybrid do not exist after some specified amount of time...
Raised when wrf or real want to run but needed input data is missing.
Raised when wrf or real want to run, but wrfbdy files are missing.
start
the start of the problematic timespan
Raised when an impossible configuration is requested.
Base class of exceptions related to the prep_hybrid program.
Raised when a file transfer, done by an InputSource, was incomplete.
Raised when the HWRF executables fail a sanity check.
Raised when more than one task is registered with the same name in an HWRFConfig object.
Raised when it is no longer possible to add domains, but the caller tried to add one.
Raised when two GRIB files have non-matching grids, but a matching grid is required.
Raised when a geogrid output file is missing or empty.
Base class used for time-related HWRF exceptions.
Raised when a grid was expected but none was provided.
Raised when wrf or real want to run but geogrid data is missing.
Raised when the configuration had a different cycle than expected.
Raised when a configuration file requests an unsupported data transfer method (such as carrier pigeon...
Called when one hour is not divisable by the WRF output timestep.
Raised when attempting to obtain information about when a WRF stream outputs, if the stream is disabl...
Raised when an impossible tracker configuration is requested, such as running with a grid that is bot...
Raised when the configuration had a different storm than expected.
Base class of all exceptions in this module.
Raised when no location is specified for a tracker input GRIB file.
Raised when wrf or real want to run, but wrfanl files are missing.
Raised when an operation has a set of known times, but another provided time is not near one of those...
Raised when the merge cannot find the storm_radius file in the relocate or fix directory.
Raised when the sanity check of the HWRF archiving settings fails.
Raised when the end of a timespan is before the beginning.
Raised when a time was requested with higher precision than available.
section
Raised when an hwrf.namelist is asked for a key that does not exist.
Raised when failing to run the real_nmm program.
Raised when a relocation program did not produce an expected output file.
dir
The directory in question.
Raised when a timespan was expected, but none was available.
Raised when a timestep is invalid, such as a negative timestep for a situation that requires a positi...
def __str__(self)
Generates a string description of this exception.
var
the option that was requested
message
the exception message
Raised when something in the vortex relocation fails.
Raised when the ocean init did not produce some expected outputs.
Base class of WRF-related errors.
Raised when an operation that produces input to Regrib should have produced a Product, but produced nothing at all.
Raised when a time was required, but none was provided.
def __repr__(self)
Generates a string representation of this object.
Superclass of exceptions relating to groups of one or more distinct times and relationships between t...
Raised when hwrf.wps.Ungrib cannot subset files as requested.
Raised when the post's input file is not available and raiseall=True in PostOneWRF.run.
Raised when WPS inputs are implausable.
Raised when a timespan's beginning is not at a timestep.
Raised when a timezone is provided.
Base class of grid-related regrib errors.
Raised when an hwrf.namelist is asked for a key that does not exist.
Base class of errors related to a WRF domain.
Raised when wrf or real want to run, but metgrid data is missing.
Raised when a RegribMany is given an invalid name: one that does not match a known grid or operation...
Base class of hwrf.tracker exceptions.
Exceptions for hwrf.regrib.GRIBTask for certain internal errors.
Base class of all sanity checker exceptions.
Base class of errors from the hwrf.regrib.RegribMany.
Raised when a time is outside the range of times being processed by a function.
Raised when an output time is specified in two redundant ways.
Raised when the prep_hybrid program cannot find WPS geogrid output data.
Raised by hwrf.input when trying to get the wrong domain from its hwrf.relocate.Relocate child object...
Not currently used, this would be raised when GRIB inputs to the tracker are missing.
Raised when the HWRF fix files fail a sanity check.
Raised when multiple storms are requested, but only one was expected.
Raised when a GRIB file should have an index file already, but doesn't.
Raised when the requested configuration conf or hwrf_expt files fail a sanity check.
Raised when real wants prep_hybrid data, but that data is missing.
Debug assetion in hwrf.regrib used to detect type mismatches.
Superclass of errors relating to regrib products.
Raised when the hwrf.wrf.WRFDomain start type is unrecognized.