Changeset d727af2 in flex_extract.git for source/python/mods


Ignore:
Timestamp:
Mar 10, 2019, 4:48:16 PM (5 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
90a1ca0
Parents:
79729d5
Message:

updated rrint processes (added missing rr for ensembles and wrote all precip fields into the output files with different steps to distingush)

Location:
source/python/mods
Files:
3 edited

Legend:

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

    r79729d5 rd727af2  
    3333from datetime import datetime
    3434import numpy as np
    35 from .tools import my_error, silent_remove
     35from mods.tools import my_error, silent_remove
    3636# ------------------------------------------------------------------------------
    3737# FUNCTIONS
  • source/python/mods/get_mars_data.py

    r79729d5 rd727af2  
    6767    inspect.getfile(inspect.currentframe()))) + '/../')
    6868import _config
    69 from .tools import (setup_controldata, my_error, normal_exit, get_cmdline_args,
     69from mods.tools import (setup_controldata, my_error, normal_exit, get_cmdline_args,
    7070                   read_ecenv, make_dir)
    7171from classes.EcFlexpart import EcFlexpart
  • source/python/mods/tools.py

    r79729d5 rd727af2  
    6969except ImportError:
    7070    import builtins as exceptions
    71 from datetime import datetime
     71from datetime import datetime, timedelta
    7272from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
    7373
     
    869869
    870870    return
     871
     872
     873def 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.
hosted by ZAMG