Changeset d727af2 in flex_extract.git for source/python/mods
- Timestamp:
- Mar 10, 2019, 4:48:16 PM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 90a1ca0
- Parents:
- 79729d5
- Location:
- source/python/mods
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/mods/checks.py
r79729d5 rd727af2 33 33 from datetime import datetime 34 34 import numpy as np 35 from .tools import my_error, silent_remove35 from mods.tools import my_error, silent_remove 36 36 # ------------------------------------------------------------------------------ 37 37 # FUNCTIONS -
source/python/mods/get_mars_data.py
r79729d5 rd727af2 67 67 inspect.getfile(inspect.currentframe()))) + '/../') 68 68 import _config 69 from .tools import (setup_controldata, my_error, normal_exit, get_cmdline_args,69 from mods.tools import (setup_controldata, my_error, normal_exit, get_cmdline_args, 70 70 read_ecenv, make_dir) 71 71 from classes.EcFlexpart import EcFlexpart -
source/python/mods/tools.py
r79729d5 rd727af2 69 69 except ImportError: 70 70 import builtins as exceptions 71 from datetime import datetime 71 from datetime import datetime, timedelta 72 72 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter 73 73 … … 869 869 870 870 return 871 872 873 def generate_retrieval_period_boundary(c): 874 '''Generates retrieval period boundary datetimes from CONTROL information. 875 876 Parameters 877 ---------- 878 c : ControlFile 879 Contains all the parameters of CONTROL file and 880 command line. 881 882 Return 883 ------ 884 start_period : datetime 885 The first timestamp of the actual retrieval period disregarding 886 the temporary times which were used for processing reasons. 887 888 end_period : datetime 889 The last timestamp of the actual retrieval period disregarding 890 the temporary times which were used for processing reasons. 891 ''' 892 # generate start and end timestamp of the retrieval period 893 start_period = datetime.strptime(c.start_date + c.time[0], '%Y%m%d%H') 894 start_period = start_period + timedelta(hours=int(c.step[0])) 895 end_period = datetime.strptime(c.end_date + c.time[-1], '%Y%m%d%H') 896 end_period = end_period + timedelta(hours=int(c.step[-1])) 897 898 899 return start_period, end_period
Note: See TracChangeset
for help on using the changeset viewer.