Skip to content
Snippets Groups Projects
Select Git revision
  • f6bb29e8f8375ff943760e611bc6d186727d2cc0
  • develop default
  • 102-Utest
  • 96-method_i
  • 89-str_to_array
  • 91-output
  • master
  • 87-method-d-swallowed-obstacles
  • feature_trajectory_correction
  • Issue_63
  • Issue_61
  • refactor_SteadyState
  • v0.8.3
  • v0.8.2
  • v0.8.1
  • v0.8
  • v0.7
  • v0.6
18 results

Building.h

Blame
  • run_zam347.py 1.59 KiB
    __author__ = "Lukas Leufen"
    __date__ = '2019-11-14'
    
    
    import argparse
    import json
    import logging
    
    from src.run_modules.experiment_setup import ExperimentSetup
    from src.run_modules.model_setup import ModelSetup
    from src.run_modules.post_processing import PostProcessing
    from src.run_modules.pre_processing import PreProcessing
    from src.run_modules.run_environment import RunEnvironment
    from src.run_modules.training import Training
    
    
    def load_stations():
    
        try:
            filename = 'German_background_stations.json'
            with open(filename, 'r') as jfile:
                stations = json.load(jfile)
                logging.info(f"load station IDs from file: {filename} ({len(stations)} stations)")
                # stations.remove('DEUB042')
        except FileNotFoundError:
            stations = ['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087', 'DEBW001']
            # stations = ['DEBB050', 'DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087', 'DEBW001']
            logging.info(f"Use stations from list: {stations}")
    
        return stations
    
    
    def main(parser_args):
    
        with RunEnvironment():
    
            ExperimentSetup(parser_args, stations=load_stations(), station_type='background', trainable=False,
                            create_new_model=True)
            PreProcessing()
    
            ModelSetup()
    
            Training()
    
            PostProcessing()
    
    
    if __name__ == "__main__":
    
        parser = argparse.ArgumentParser()
        parser.add_argument('--experiment_date', metavar='--exp_date', type=str, default=None,
                            help="set experiment date as string")
        args = parser.parse_args(["--experiment_date", "testrun"])
    
        main(args)