Changeset 6f951ca in flex_extract.git for source/python/mods/get_mars_data.py


Ignore:
Timestamp:
Jan 15, 2019, 1:05:10 AM (5 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
d4696e0
Parents:
2625ca8
Message:

new style of docstring params and updates in docstrings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/python/mods/get_mars_data.py

    r9aefaad r6f951ca  
    2222#          online documentation)
    2323#        - use of UIFiles class for file selection and deletion
    24 #
     24#        - seperated get_mars_data function into several smaller pieces:
     25#          write_reqheader, mk_server, mk_dates, remove_old, do_retrievment
    2526#
    2627# @License:
    27 #    (C) Copyright 2014-2018.
    28 #
    29 #    This software is licensed under the terms of the Apache Licence Version 2.0
    30 #    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
    31 #
    32 # @Program Functionality:
    33 #    This program can be used as a module in the whole flex_extract process
    34 #    or can be run by itself to just extract MARS data from ECMWF. To do so,
    35 #    a couple of necessary parameters has to be passed with the program call.
    36 #    See documentation for more details.
    37 #
    38 # @Program Content:
    39 #    - main
    40 #    - get_mars_data
    41 #    - do_retrievement
    42 #
     28#    (C) Copyright 2014-2019.
     29#    Anne Philipp, Leopold Haimberger
     30#
     31#    This work is licensed under the Creative Commons Attribution 4.0
     32#    International License. To view a copy of this license, visit
     33#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
     34#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
    4335#*******************************************************************************
    44 """ToDo: Name of litte program
    45 
    46 ToDo: Add desccription
    47 
    48 ToDo: Add Conditions
    49 
    50 This script requires that `...` be installed within the Python
    51 environment you are running this script in.
     36'''This script extracts MARS data from ECMWF servers.
     37
     38At first, the necessary parameters from command line and CONTROL files are
     39extracted. They define the data set to be extracted from MARS.
    5240
    5341This file can also be imported as a module and contains the following
    5442functions:
    5543
    56     * get_mars_data -
    57     * do_retrievement -
    5844    * main - the main function of the script
    59 """
     45    * get_mars_data - overall control of ECMWF data retrievment
     46    * write_reqheader - writes the header into the mars_request file
     47    * mk_server - creates the server connection to ECMWF servers
     48    * mk_dates - defines the start and end date
     49    * remove_old - deletes old retrieved grib files
     50    * do_retrievement - creates individual retrievals
     51
     52Type: get_mars_data.py --help
     53to get information about command line parameters.
     54Read the documentation for usage instructions.
     55'''
    6056# ------------------------------------------------------------------------------
    6157# MODULES
     
    6763
    6864# software specific classes and modules from flex_extract
     65# add path to local main python path for flex_extract to get full access
    6966sys.path.append(os.path.dirname(os.path.abspath(
    7067    inspect.getfile(inspect.currentframe()))) + '/../')
     
    120117    Parameters
    121118    ----------
    122     c : :obj:`ControlFile`
     119    c : ControlFile
    123120        Contains all the parameters of CONTROL file and
    124121        command line.
     
    166163    Parameters
    167164    ----------
    168     marsfile : :obj:`string`
     165    marsfile : str
    169166        Path to the mars request file.
    170167
     
    189186    Parameters
    190187    ----------
    191     c : :obj:`ControlFile`
     188    c : ControlFile
    192189        Contains all the parameters of CONTROL file and
    193190        command line.
     
    195192    Return
    196193    ------
    197     server : :obj:`ECMWFDataServer` or :obj:`ECMWFService`
     194    server : ECMWFDataServer or ECMWFService
    198195        Connection to ECMWF server via python interface ECMWF WebAPI.
    199196
     
    230227    Parameters
    231228    ----------
    232     c : :obj:`ControlFile`
     229    c : ControlFile
    233230        Contains all the parameters of CONTROL file and
    234231        command line.
    235232
    236     fluxes : :obj:`boolean`, optional
     233    fluxes : boolean, optional
    237234        Decides if the flux parameter settings are stored or
    238235        the rest of the parameter list.
     
    241238    Return
    242239    ------
    243     start : :obj:`datetime`
     240    start : datetime
    244241        The start date of the retrieving data set.
    245242
    246     end : :obj:`datetime`
     243    end : datetime
    247244        The end date of the retrieving data set.
    248245
    249     chunk : :obj:`datetime`
     246    chunk : datetime
    250247        Time period in days for one single mars retrieval.
    251248
     
    271268    Parameters
    272269    ----------
    273     pattern : :obj:`string`
     270    pattern : str
    274271        The sub string pattern which identifies the files to be deleted.
    275272
    276     inputdir : :obj:`string`, optional
     273    inputdir : str, optional
    277274        Path to the directory where the retrieved data is stored.
    278275
     
    295292    Parameters
    296293    ----------
    297     c : :obj:`ControlFile`
     294    c : ControlFile
    298295        Contains all the parameters of CONTROL file and
    299296        command line.
    300297
    301     server : :obj:`ECMWFService`
     298    server : ECMWFService or ECMWFDataServer
    302299            The server connection to ECMWF.
    303300
    304     start : :obj:`datetime`
     301    start : datetime
    305302        The start date of the retrieval.
    306303
    307     end : :obj:`datetime`
     304    end : datetime
    308305        The end date of the retrieval.
    309306
    310     delta_t : :obj:`datetime`
     307    delta_t : datetime
    311308        Delta_t + 1 is the maximal time period of a single
    312309        retrieval.
    313310
    314     fluxes : :obj:`boolean`, optional
     311    fluxes : boolean, optional
    315312        Decides if the flux parameters are to be retrieved or
    316313        the rest of the parameter list.
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG