ntimes=int( 1 + np.around((etime-itime).seconds / delta.seconds) ) #Total number of times.


   ctl_file = basedir + '/' + my_exp + '/ctl/update_mean_diff.ctl'

   outputdir=basedir + '/' + my_exp + '/time_mean/' + filetype + '/'

   if not os.path.exists( outputdir)  :

      os.makedirs( outputdir )

   #=========================================================
   #  READ CTL FILE
   #=========================================================

   ctl_dict = ctlr.read_ctl( ctl_file )

   nx=ctl_dict['nx']
   ny=ctl_dict['nx']
   nlev=len( ctl_dict['full_lev_list'] )
   nt=int(1)             #Force the number of times to be one.
   ctl_dict['nt']=int(1) #Force the number of times to be one.

   undef=np.float32( ctl_dict['undef'] )

   if  ctl_dict['big_endian']   :
      dtypein = '>f4'
      endian='big_endian'
   else                         :
      dtypein = 'f4'
      endian='little_endian'
Exemple #2
0
    delta = dt.timedelta(seconds=deltat[iexp])

    #Compute the total number of times
    ntimes = int(1 + np.around(
        (etime - itime).seconds / delta.seconds))  #Total number of times.

    #=========================================================
    #  READ CTL FILE
    #=========================================================

    if iexp == 0:

        ctl_file = basedir + '/' + my_exp + '/ctl/update_mean_diff.ctl'

        ctl_dict = ctlr.read_ctl(ctl_file)

        nx = ctl_dict['nx']
        ny = ctl_dict['nx']
        nlev = ctl_dict['nz']
        nt = int(1)  #Force the number of times to be one.
        ctl_dict['nt'] = int(1)  #Force the number of times to be one.

        undef = np.float32(ctl_dict['undef'])

        ctl_file_2 = basedir + '/' + my_exp + '/ctl/guesgp.ctl'

        ctl_dict_2 = ctlr.read_ctl(ctl_file_2)

    #=========================================================
    #  READ LAT LON
Exemple #3
0
basedir = '/home/ra001011/a03471/data/output_data/'

exps = ['LE_D1_1km_5min']

lat_radar = 34.823
lon_radar = 135.523
radar_range = 60.0e3  #Radar range in meters (to define the radar mask)

#=========================================================
#  READ LAT LON
#=========================================================

latlon_file = basedir + '/LE_D1_1km_5min/latlon/latlon.grd'
latlon_ctl = basedir + '/LE_D1_1km_5min/latlon/latlon.ctl'

ctl_dict = ctlr.read_ctl(latlon_ctl)

my_data = ctlr.read_data_grads(latlon_file, ctl=ctl_dict)

lon = np.squeeze(my_data['glon'])
lat = np.squeeze(my_data['glat'])
topo = np.squeeze(my_data['topo'])

#Exclude areas outside the radar domain.
radar_mask = cmf.distance_range_mask(lon_radar, lat_radar, radar_range, lon,
                                     lat)

#=========================================================================================
#Plot the mean topography and PAWR radar range
#=========================================================================================
Exemple #4
0
obs_increment = [5.0, 5.0, 5.0, 5.0, 2.0, 2.0, 2.0, 2.0]
obs_error = [5.0, 5.0, 5.0, 5.0, 2.0, 2.0, 2.0, 2.0]

nbv = 1000

sigma_smooth = 2.0

#=========================================================
#  LOOP OVER FILE TYPES
#=========================================================

profile_mean_rmsd = dict()
profile_mean_rmsu = dict()
profile_kld = dict()

ctl_dict = ctlr.read_ctl(basedir + '/LE_D1_1km_5min/ctl/moment0001_for.ctl')

for iexp, my_exp in enumerate(exps):

    profile_mean_rmsd[my_exp] = []
    profile_mean_rmsu[my_exp] = []
    profile_kld[my_exp] = []

    #=========================================================
    #  READ THE DATA
    #=========================================================

    for iv, my_obs_inc in enumerate(obs_increment):

        var_obs = variable_combination[0][iv]
        var_upd = variable_combination[1][iv]
#=========================================================
#  PLOT MODEL DOMAIN
#=========================================================

lat_radar = 34.823
lon_radar = 135.523
radar_range = 60.0e3  #Radar range in meters (to define the radar mask)

#=========================================================
#  READ LAT LON AND TOPO
#=========================================================

latlon_file = basedir + '/LE_D1_1km_5min/latlon/latlon.grd'
latlon_ctl = basedir + '/LE_D1_1km_5min/latlon/latlon.ctl'

ctl_dict = ctlr.read_ctl(latlon_ctl)

my_data = ctlr.read_data_grads(latlon_file, ctl=ctl_dict)

lon = np.squeeze(my_data['glon'])
lat = np.squeeze(my_data['glat'])
topo = np.squeeze(my_data['topo'])

#Exclude areas outside the radar domain.
radar_mask = cmf.distance_range_mask(lon_radar, lat_radar, radar_range, lon,
                                     lat)

#=========================================================================================
#Plot the mean topography and PAWR radar range
#=========================================================================================