Skip to content

Commit

Permalink
Merge pull request #186 from mebruckner/develop_satellite
Browse files Browse the repository at this point in the history
code comment adjustments for Develop satellite
  • Loading branch information
dwfncar authored Aug 10, 2023
2 parents e29f9e9 + 24254ba commit fb61b61
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 2 additions & 5 deletions melodies_monet/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ def open_model_files(self, time_interval=None):
self.obj = mio.models._cesm_se_mm.open_mfdataset(self.files,**self.mod_kwargs)
#self.obj, self.obj_scrip = read_cesm_se.open_mfdataset(self.files,**self.mod_kwargs)
#self.obj.monet.scrip = self.obj_scrip
# MEB: addition for personal local copy to work with development UFS-RAQMS
# not intended for public versions
elif 'raqms' in self.model.lower():
if time_interval is not None:
# fill filelist with subset
Expand Down Expand Up @@ -687,8 +685,6 @@ def open_models(self, time_interval=None,load_files=True):
# set the model label in the dictionary and model class instance
if "apply_ak" in self.control_dict['model'][mod].keys():
m.apply_ak = self.control_dict['model'][mod]['apply_ak']
else:
m.apply_ak = False
if 'radius_of_influence' in self.control_dict['model'][mod].keys():
m.radius_of_influence = self.control_dict['model'][mod]['radius_of_influence']
else:
Expand Down Expand Up @@ -863,6 +859,7 @@ def pair_data(self, time_interval=None):
p.obj = p.fix_paired_xarray(dset=p.obj)
# write_util.write_ncf(p.obj,p.filename) # write out to file
# TODO: add other network types / data types where (ie flight, satellite etc)
# if sat_swath_clm (satellite l2 column products)
elif obs.obs_type.lower() == 'sat_swath_clm':

if obs.label == 'omps_nm':
Expand Down Expand Up @@ -890,6 +887,7 @@ def pair_data(self, time_interval=None):
p.obj = paired_data
label = '{}_{}'.format(p.obs,p.model)
self.paired[label] = p
# if sat_grid_clm (satellite l3 column products)
elif obs.obs_type.lower() == 'sat_grid_clm':
if obs.label == 'omps_l3':
from .util import satellite_utilities as sutil
Expand Down Expand Up @@ -1008,7 +1006,6 @@ def plotting(self):
else:
pairdf_all = p.obj
# Select only the analysis time window.
print(pairdf_all.dims)
pairdf_all = pairdf_all.sel(time=slice(self.start_time,self.end_time))

# Determine the default plotting colors.
Expand Down
1 change: 1 addition & 0 deletions melodies_monet/util/read_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def read_analysis_ncf(filenames,xr_kws={}):
if count==0:
ds_out = xr.open_dataset(file,**xr_kws)
group_name1 = ds_out.attrs['group_name']

else:
ds_append = xr.open_dataset(file,**xr_kws)
# Test if all the files have the same group to prevent merge issues
Expand Down
10 changes: 5 additions & 5 deletions melodies_monet/util/satellite_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from datetime import datetime,timedelta

def omps_l3_daily_o3_pairing(model_data,obs_data,ozone_ppbv_varname):
'''Calculate model ozone column from model ozone profile in ppv. Move data from model grid
'''Calculate model ozone column from model ozone profile in ppbv. Move data from model grid
to 1x1 degree OMPS L3 data grid. Following data grid matching, take daily mean for model data.
'''
import xesmf as xe

# factor for converting ppv profiles to DU column
# factor for converting ppbv profiles to DU column
# also requires conversion of dp from Pa to hPa
du_fac = 1.0e-5*6.023e23/28.97/9.8/2.687e19
column = (du_fac*(model_data['dp_pa']/100.)*model_data[ozone_ppbv_varname]).sum('z')
Expand Down Expand Up @@ -88,7 +88,7 @@ def space_and_time_pairing(model_data,obs_data,pair_variables):
ds[j][:,tindex,:] += np.expand_dims(tfac1.values,axis=1)*interm_var.values
return ds
def omps_nm_pairing(model_data,obs_data,ozone_ppbv_varname):
'Pairs UFS-RAQMS ozone mixing ratio with OMPS nadir mapper retrievals. Calculates column without applying apriori'
'Pairs model ozone mixing ratio with OMPS nadir mapper retrievals. Calculates column without applying apriori'
import xarray as xr

import pandas as pd
Expand Down Expand Up @@ -116,12 +116,12 @@ def omps_nm_pairing(model_data,obs_data,ozone_ppbv_varname):


def omps_nm_pairing_apriori(model_data,obs_data,ozone_ppbv_varname):
'Pairs UFS-RAQMS data with OMPS nm. Applies satellite apriori column to model observations.'
'Pairs model ozone mixing ratio data with OMPS nm. Applies satellite apriori column to model observations.'

import xarray as xr

import pandas as pd
du_fac = 1.0e-5*6.023e23/28.97/9.8/2.687e19 # conversion factor; moves model from ppv to dobson
du_fac = 1.0e-5*6.023e23/28.97/9.8/2.687e19 # conversion factor; moves model from ppbv to dobson

print('pairing with averaging kernel application')

Expand Down

0 comments on commit fb61b61

Please sign in to comment.