Skip to content
Snippets Groups Projects
Select Git revision
  • 5a2a6a352457123b1d72d08f5fd35cf64e8c5957
  • master default protected
  • dev protected
  • replication_test
  • release-1.10 protected
  • release-1.9 protected
  • 551-init-broker-service-permissions
  • 549-test-oai-pmh
  • 545-saving-multiple-times-breaks-pid-metadata
  • 499-standalone-compute-service-2
  • 539-load-tests
  • hotfix/helm-chart
  • luca_ba_new_interface
  • 534-bug-when-adding-access-to-user-that-is-not-registered-at-dashboard-service
  • release-1.8 protected
  • 533-integrate-semantic-recommendation
  • feature/openshift
  • 518-spark-doesn-t-map-the-headers-correct
  • 485-fixity-checks
  • 530-various-schema-problems-with-subsets
  • release-1.7 protected
  • v1.10.2 protected
  • v1.10.1 protected
  • v1.10.0-rc13 protected
  • v1.10.0-rc12 protected
  • v1.10.0-rc11 protected
  • v1.10.0-rc10 protected
  • v1.10.0-rc9 protected
  • v1.10.0-rc8 protected
  • v1.10.0-rc7 protected
  • v1.10.0-rc6 protected
  • v1.10.0-rc5 protected
  • v1.10.0-rc4 protected
  • v1.10.0-rc3 protected
  • v1.10.0-rc2 protected
  • v1.10.0rc1 protected
  • v1.10.0rc0 protected
  • v1.10.0 protected
  • v1.9.3 protected
  • v1.9.2 protected
  • v1.9.2-rc0 protected
41 results

TableList.vue

Blame
  • apply_obs_op_dart.py 1.96 KiB
    import os, sys, shutil
    import datetime as dt
    import numpy as np
    from scipy.interpolate import interp1d
    
    from config.cfg import exp, cluster
    from utils import symlink, copy, mkdir, sed_inplace, append_file, print
    import create_obsseq as osq
    import assim_synth_obs as aso
    import pre_assim
    import wrfout_add_geo
    
    """Apply observation operator to some ensemble state
    i.e. wrfout files in an archive directory
    
    """
    
    
    if __name__ == '__main__':
        prev_forecast_init = dt.datetime.strptime(sys.argv[1], '%Y-%m-%d_%H:%M')
        time = dt.datetime.strptime(sys.argv[2], '%Y-%m-%d_%H:%M')
        exppath_firstguess = cluster.archivedir()
        print(prev_forecast_init, time)
    
        # link ensemble states to run_DART directory
        # we want the observation operator applied to these states!
        pre_assim.run(time, prev_forecast_init, exppath_firstguess)
    
        savedir = cluster.archivedir()+'/obs_seq_final_1min/'
    
        n_stages = len(exp.observations)
        for istage, obscfg in enumerate(exp.observations):
    
            n_obs = obscfg['n_obs']
            sat_channel = obscfg.get('sat_channel', False)
            obscfg['folder_obs_coords'] = False
    
            aso.set_DART_nml(sat_channel=sat_channel, 
                         cov_loc_radius_km=obscfg['cov_loc_radius_km'],
                         cov_loc_vert_km=obscfg.get('cov_loc_vert_km', False), 
                         just_prior_values=True)
    
            osq.create_obsseq_in(time, obscfg)
    
            # prepare dummy nature (this Hx is irrelevant)
            os.chdir(cluster.dartrundir)
            os.system('cp ./advance_temp1/wrfout_d01 ./wrfout_d01')
            wrfout_add_geo.run(cluster.dartrundir+'/geo_em.d01.nc',
                               cluster.dartrundir+'/wrfout_d01')
            aso.run_perfect_model_obs()
            aso.assimilate(nproc=96)
    
            # only the prior state values are of interest in this file
            # observation and truth is wrong in this file (dummy)
            archive_stage = savedir+'/assim_stage'+str(istage)
            aso.archive_diagnostics(archive_stage, time)