Changeset 6f951ca in flex_extract.git for source/python/mods/get_mars_data.py
- Timestamp:
- Jan 15, 2019, 1:05:10 AM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- d4696e0
- Parents:
- 2625ca8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/mods/get_mars_data.py
r9aefaad r6f951ca 22 22 # online documentation) 23 23 # - 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 25 26 # 26 27 # @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. 43 35 #******************************************************************************* 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 38 At first, the necessary parameters from command line and CONTROL files are 39 extracted. They define the data set to be extracted from MARS. 52 40 53 41 This file can also be imported as a module and contains the following 54 42 functions: 55 43 56 * get_mars_data -57 * do_retrievement -58 44 * 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 52 Type: get_mars_data.py --help 53 to get information about command line parameters. 54 Read the documentation for usage instructions. 55 ''' 60 56 # ------------------------------------------------------------------------------ 61 57 # MODULES … … 67 63 68 64 # software specific classes and modules from flex_extract 65 # add path to local main python path for flex_extract to get full access 69 66 sys.path.append(os.path.dirname(os.path.abspath( 70 67 inspect.getfile(inspect.currentframe()))) + '/../') … … 120 117 Parameters 121 118 ---------- 122 c : :obj:`ControlFile`119 c : ControlFile 123 120 Contains all the parameters of CONTROL file and 124 121 command line. … … 166 163 Parameters 167 164 ---------- 168 marsfile : :obj:`string`165 marsfile : str 169 166 Path to the mars request file. 170 167 … … 189 186 Parameters 190 187 ---------- 191 c : :obj:`ControlFile`188 c : ControlFile 192 189 Contains all the parameters of CONTROL file and 193 190 command line. … … 195 192 Return 196 193 ------ 197 server : :obj:`ECMWFDataServer` or :obj:`ECMWFService`194 server : ECMWFDataServer or ECMWFService 198 195 Connection to ECMWF server via python interface ECMWF WebAPI. 199 196 … … 230 227 Parameters 231 228 ---------- 232 c : :obj:`ControlFile`229 c : ControlFile 233 230 Contains all the parameters of CONTROL file and 234 231 command line. 235 232 236 fluxes : :obj:`boolean`, optional233 fluxes : boolean, optional 237 234 Decides if the flux parameter settings are stored or 238 235 the rest of the parameter list. … … 241 238 Return 242 239 ------ 243 start : :obj:`datetime`240 start : datetime 244 241 The start date of the retrieving data set. 245 242 246 end : :obj:`datetime`243 end : datetime 247 244 The end date of the retrieving data set. 248 245 249 chunk : :obj:`datetime`246 chunk : datetime 250 247 Time period in days for one single mars retrieval. 251 248 … … 271 268 Parameters 272 269 ---------- 273 pattern : :obj:`string`270 pattern : str 274 271 The sub string pattern which identifies the files to be deleted. 275 272 276 inputdir : :obj:`string`, optional273 inputdir : str, optional 277 274 Path to the directory where the retrieved data is stored. 278 275 … … 295 292 Parameters 296 293 ---------- 297 c : :obj:`ControlFile`294 c : ControlFile 298 295 Contains all the parameters of CONTROL file and 299 296 command line. 300 297 301 server : :obj:`ECMWFService`298 server : ECMWFService or ECMWFDataServer 302 299 The server connection to ECMWF. 303 300 304 start : :obj:`datetime`301 start : datetime 305 302 The start date of the retrieval. 306 303 307 end : :obj:`datetime`304 end : datetime 308 305 The end date of the retrieval. 309 306 310 delta_t : :obj:`datetime`307 delta_t : datetime 311 308 Delta_t + 1 is the maximal time period of a single 312 309 retrieval. 313 310 314 fluxes : :obj:`boolean`, optional311 fluxes : boolean, optional 315 312 Decides if the flux parameters are to be retrieved or 316 313 the rest of the parameter list.
Note: See TracChangeset
for help on using the changeset viewer.