diff --git a/src/compo/tempo_nc2ioda.py b/src/compo/tempo_nc2ioda.py index e0104699..75935379 100755 --- a/src/compo/tempo_nc2ioda.py +++ b/src/compo/tempo_nc2ioda.py @@ -87,9 +87,12 @@ def _read(self): AttrData['sensor'] = ncd.getncattr('project') AttrData['platform'] = ncd.getncattr('platform') - # coordinates and mask + # coordinates, mask and RT parameters for BC lats = ncd.groups['geolocation'].variables['latitude'][:].ravel() lons = ncd.groups['geolocation'].variables['longitude'][:].ravel() + sza = ncd.groups['geolocation'].variables['solar_zenith_angle'][:].ravel() + vza = ncd.groups['geolocation'].variables['viewing_zenith_angle'][:].ravel() + albedo = ncd.groups['support_data'].variables['albedo'][:].ravel() qc_flag = ncd.groups['support_data'].variables['ground_pixel_quality_flag'][:]\ .ravel() cld_fra = ncd.groups['support_data'].variables['eff_cloud_fraction'][:]\ @@ -110,6 +113,12 @@ def _read(self): cld_fra.mask = False cld_fra = np.ma.array(cld_fra, mask=mask) qa_value = np.ma.array(qa_value, mask=mask) + sza.mask = False + sza = np.ma.array(sza, mask=mask) + vza.mask = False + vza = np.ma.array(vza, mask=mask) + albedo.mask = False + albedo = np.ma.array(albedo, mask=mask) # adding ability to pre filter the data using the qa value # and also perform thinning using random uniform draw @@ -234,6 +243,9 @@ def _read(self): print('flg: ', np.shape(flg)) print('qa_value: ', np.shape(qa_value)) print('cld_fra: ', np.shape(cld_fra)) + print('sza: ', np.shape(sza)) + print('vza: ', np.shape(vza)) + print('albedo: ', np.shape(albedo)) print('qc_flag: ', np.shape(qc_flag)) print('obs: ', np.shape(obs)) print('err: ', np.shape(err)) @@ -247,6 +259,9 @@ def _read(self): flg = np.ma.compressed(flg) qa_value = np.ma.compressed(qa_value).astype('float32') cld_fra = np.ma.compressed(cld_fra).astype('float32') + sza = np.ma.compressed(sza).astype('float32') + vza = np.ma.compressed(vza).astype('float32') + albedo = np.ma.compressed(albedo).astype('float32') qc_flag = np.ma.compressed(qc_flag).astype('int32') obs = np.ma.compressed(obs).astype('float32') err = np.ma.compressed(err).astype('float32') @@ -266,6 +281,9 @@ def _read(self): print('flg: ', np.shape(flg)) print('qa_value: ', np.shape(qa_value)) print('cld_fra: ', np.shape(cld_fra)) + print('sza: ', np.shape(sza)) + print('vza: ', np.shape(vza)) + print('albedo: ', np.shape(albedo)) print('qc_flag: ', np.shape(qc_flag)) print('obs: ', np.shape(obs)) print('err: ', np.shape(err)) @@ -278,6 +296,9 @@ def _read(self): self.outdata[('longitude', 'MetaData')] = lons[flg] self.outdata[('quality_assurance_value', 'MetaData')] = qa_value[flg] self.outdata[('cloud_fraction', 'MetaData')] = cld_fra[flg] + self.outdata[('solar_zenith_angle', 'MetaData')] = sza[flg] + self.outdata[('viewing_zenith_angle', 'MetaData')] = vza[flg] + self.outdata[('albedo', 'MetaData')] = albedo[flg] self.outdata[('averagingKernel', 'RetrievalAncillaryData')] = avg_kernel[flg] self.outdata[('pressureVertice', 'RetrievalAncillaryData')] = preslev[flg] self.outdata[self.varDict[iodavar]['valKey']] = obs[flg] @@ -294,6 +315,12 @@ def _read(self): self.outdata[('quality_assurance_value', 'MetaData')], qa_value[flg])) self.outdata[('cloud_fraction', 'MetaData')] = np.concatenate(( self.outdata[('cloud_fraction', 'MetaData')], cld_fra[flg])) + self.outdata[('solar_zenith_angle', 'MetaData')] = np.concatenate(( + self.outdata[('solar_zenith_angle', 'MetaData')], sza[flg])) + self.outdata[('viewing_zenith_angle', 'MetaData')] = np.concatenate(( + self.outdata[('viewing_zenith_angle', 'MetaData')], vza[flg])) + self.outdata[('albedo', 'MetaData')] = np.concatenate(( + self.outdata[('albedo', 'MetaData')], albedo[flg])) self.outdata[('averagingKernel', 'RetrievalAncillaryData')] = np.concatenate(( self.outdata[('averagingKernel', 'RetrievalAncillaryData')], avg_kernel[flg])) self.outdata[('pressureVertice', 'RetrievalAncillaryData')] = np.concatenate(( @@ -367,6 +394,7 @@ def main(): optional.add_argument( '-v3', '--version3', action='store_true', + default=True, help='Read V3 files and not V2 files') args = parser.parse_args() @@ -384,7 +412,7 @@ def main(): if args.column == "troposphere" or args.column == "stratosphere": obsVar = { - var_name+'_'+args.column+'spheric_column': var_name+'Column' + var_name+'_'+args.column+'_column': var_name+'Column' } varDims = {