Auto Generated Documentation

Tools.cleanup(c)[source]
@Description:
Remove all files from intermediate directory (inputdir from control file).
@Input:
c: instance of class Control

Contains all the parameters of control files, which are e.g.: DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME, STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT, LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY, OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT, ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR, MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR, BASETIME DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS

For more information about format and content of the parameter see documentation.

@Return:
<nothing>
Tools.getListAsString(listobj)[source]

@Description:

Tools.init128(fn)[source]
@Description:
Opens and reads the grib file with table 128 information.
@Input:
fn: string
Path to file of ECMWF grib table number 128.
@Return:
table128: dictionary
Contains the ECMWF grib table 128 information. The key is the parameter number and the value is the short name of the parameter.
Tools.interpret_args_and_control()[source]
@Description:
Assigns the command line arguments and reads control file content. Apply default values for non mentioned arguments.
@Input:
<nothing>
@Return:
args: instance of ArgumentParser
Contains the commandline arguments from script/program call.
c: instance of class Control
Contains all necessary information of a control file. The parameters are: DAY1, DAY2, DTIME, MAXSTEP, TYPE, TIME, STEP, CLASS, STREAM, NUMBER, EXPVER, GRID, LEFT, LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY, OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT, ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR, MAILOPS, MAILFAIL, GRIB2FLEXPART, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS For more information about format and content of the parameter see documentation.
Tools.myerror(c, message='ERROR')[source]
@Description:
Prints a specified error message which can be passed to the function before exiting the program.
@Input:
c: instance of class Control

Contains all the parameters of control files, which are e.g.: DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME, STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT, LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY, OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT, ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR, MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR, BASETIME DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS

For more information about format and content of the parameter see documentation.

message: string, optional
Error message. Default value is “ERROR”.
@Return:
<nothing>
Tools.normalexit(c, message='Done!')[source]
@Description:
Prints a specific exit message which can be passed to the function.
@Input:
c: instance of class Control

Contains all the parameters of control files, which are e.g.: DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME, STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT, LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY, OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT, ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR, MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR, BASETIME DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS

For more information about format and content of the parameter see documentation.

message: string, optional
Message for exiting program. Default value is “Done!”.
@Return:
<nothing>
Tools.product(*args, **kwds)[source]
@Description:

This method is taken from an example at the ECMWF wiki website. https://software.ecmwf.int/wiki/display/GRIB/index.py; 2018-03-16

This method combines the single characters of the passed arguments with each other. So that each character of each argument value will be combined with each character of the other arguments as a tuple.

Example: product(‘ABCD’, ‘xy’) –> Ax Ay Bx By Cx Cy Dx Dy product(range(2), repeat = 3) –> 000 001 010 011 100 101 110 111

@Input:
*args: tuple
Positional arguments (arbitrary number).
**kwds: dictionary
Contains all the keyword arguments from *args.
@Return:
prod: tuple
Return will be done with “yield”. A tuple of combined arguments. See example in description above.
Tools.silentremove(filename)[source]
@Description:
Removes the file which name is passed to the function if it exists. The function does not fail if the file does not exist.
@Input:
filename: string
The name of the file to be removed without notification.
@Return:
<nothing>
Tools.toparamId(pars, table)[source]
@Description:
Transform parameter names to parameter ids with ECMWF grib table 128.
@Input:
pars: string
Addpar argument from control file in the format of parameter names instead of ids. The parameter short names are sepearted with “/” and they are passed as one single string.
table: dictionary
Contains the ECMWF grib table 128 information. The key is the parameter number and the value is the short name of the parameter.
@Return:
ipar: list of integer
List of addpar parameters from control file transformed to parameter ids in the format of integer.
class Tools.Control

@Author: Leopold Haimberger (University of Vienna)

@Date: November 2015

@ChangeHistory:
February 2018 - Anne Philipp (University of Vienna):
  • applied PEP8 style guide
  • added documentation
  • applied some minor modifications in programming style/structure
  • moved Control class in a file for its own
@License:
  1. Copyright 2015-2018.

This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.

@Requirements:
A standard python 2.6 or 2.7 installation
@Description:
The Control files are the steering part of the FLEXPART extraction software. All necessary parameters needed to retrieve the data fields from the MARS archive for driving FLEXPART are set in a Control file. Some specific parameters like the start and end dates can be overwritten by the command line parameters, but in generel all parameters needed for a complete set of fields for FLEXPART can be set in the Control files.
class Control(filename)

Class containing the information of the ECMWFDATA control file.

Contains all the parameters of control files, which are e.g.: DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME, STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT, LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY, OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT, ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR, MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR, BASETIME, DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS

For more information about format and content of the parameter see documentation.

tolist()
@Description:
Just generates a list of strings containing the attributes and assigned values except the attributes “_expanded”, “exedir”, “ecmwfdatadir” and “flexpart_root_scripts”.
@Input:
self: instance of Control class
Description see class documentation.
@Return:
l: list
A sorted list of the all Control class attributes with their values except the attributes “_expanded”, “exedir”, “ecmwfdatadir” and “flexpart_root_scripts”.
Tools = <module 'Tools' from '/nas16/tmc/Anne/Interpolation/flexextract/flexextract/python/Tools.pyc'>
inspect = <module 'inspect' from '/opt/anaconda/lib/python2.7/inspect.pyc'>
os = <module 'os' from '/opt/anaconda/lib/python2.7/os.pyc'>