Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions src/gsi-ncdiag/gsi_ncdiag.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
all_LocKeyList = {
'Station_ID': ('station_id', 'string'),
'Time': ('datetime', 'string'),
'time': ('time', 'string'),
'ascending_flag': ('ascending_flag', 'string'),
'earth_radius_of_curvature': ('earth_radius_of_curvature', 'string'),
'reference_sat_id': ('reference_sat_id', 'string'),
'occulting_sat_id': ('occulting_sat_id', 'string'),
'record_number': ('record_number', 'string'),
'geoid_height_above_reference_ellipsoid': ('geoid_height_above_reference_ellipsoid', 'string'),
'gnss_sat_class': ('gnss_sat_class', 'string'),
'impact_height': ('impact_height', 'string'),
'impact_parameter': ('impact_parameter', 'string'),
'Latitude': ('latitude', 'float'),
'Longitude': ('longitude', 'float'),
'Station_Elevation': ('station_elevation', 'float'),
Expand Down Expand Up @@ -115,6 +125,7 @@
'SCCF_chan_wavelen': ('channel_wavelength', 'float'),
'QI_with_FC': ('satwind_quality_ind_with_fc', 'float'),
'QI_without_FC': ('satwind_quality_ind_no_fc', 'float'),
'Data_Vertical_Velocity': ('data_vertical_velocity', 'float'),
'LaunchTime': ('LaunchTime', 'float'),
}

Expand Down Expand Up @@ -304,6 +315,7 @@
'specific_humidity': 'specific_humidity',
'northward_wind': 'northward_wind',
'eastward_wind': 'eastward_wind',
'geopotential_height_levels': 'geopotential_height_levels',
'geopotential_height': 'geopotential_height',
'geometric_height': 'geometric_height',
'height': 'height_above_mean_sea_level',
Expand All @@ -315,6 +327,7 @@
'surface_roughness': 'surface_roughness_length',
'surface_height': 'surface_geopotential_height',
'surface_geopotential_height': 'surface_geopotential_height',
'surface_altitude': 'surface_altitude',
'surface_geometric_height': 'surface_geometric_height',
'landmask': 'land_area_fraction',
'air_temperature': 'air_temperature',
Expand Down Expand Up @@ -349,7 +362,7 @@
'Lai': 'leaf_area_index',
'Soil_Moisture': 'volume_fraction_of_condensed_water_in_soil',
'Soil_Temperature': 'soil_temperature',
'Land_Type_Index': 'land_type_index',
'Land_Type_Index': 'land_type_index_NPOESS',
'Vegetation_Type': 'vegetation_type_index',
'Soil_Type': 'soil_type',
'Snow_Depth': 'surface_snow_thickness',
Expand Down Expand Up @@ -414,12 +427,18 @@
'northward_wind': 'm s-1',
'eastward_wind': 'm s-1',
'geopotential_height': 'm',
'geopotential_height_levels': 'm',
'height_above_mean_sea_level': 'm',
'surface_pressure': 'Pa',
'sea_surface_temperature': 'K',
'surface_temperature': 'K',
'surface_roughness_length': 'm',
'surface_geopotential_height': 'm',
'surface_altitude': 'm',
'geoid_height_above_reference_ellipsoid': 'Meters',
'earth_radius_of_curvature': 'Meters',
'impact_height': 'Meters',
'impact_parameter': 'Meters',
'land_area_fraction': '1',
'air_temperature': 'K',
'air_pressure': 'Pa',
Expand Down Expand Up @@ -451,7 +470,7 @@
'leaf_area_index': '1',
'volume_fraction_of_condensed_water_in_soil': '1',
'soil_temperature': 'K',
'land_type_index': '1',
'land_type_index_NPOESS': '1',
'vegetation_type_index': '1',
'soil_type': '1',
'surface_snow_thickness': 'm',
Expand Down Expand Up @@ -497,6 +516,7 @@
'clw_retrieved_from_background': 'kg/m/m',
'scat_retrieved_from_observation': '1',
'LaunchTime': 'hours',
'bending_angle': 'radians',
}

# @TestReference
Expand Down Expand Up @@ -684,7 +704,8 @@ def toGeovals(self, OutDir, clobber=True):
if (len(var.dimensions) == 1):
dims = ("nlocs",)
else:
if vname == "atmosphere_pressure_coordinate_interface":
if (vname == "atmosphere_pressure_coordinate_interface") or (
vname == "geopotential_height_levels"):
dims = ("nlocs", "ninterfaces")
else:
dims = ("nlocs", "nlevs")
Expand Down Expand Up @@ -850,7 +871,7 @@ def toIODAobs(self, OutDir, clobber=True, platforms=None):
tmp = self.var(lvar)[idx]
StationIDs = [bytes((b''.join(tmp[a])).decode('iso-8859-1').encode('utf8')) for a in range(len(tmp))]
outdata[(loc_mdata_name, 'MetaData')] = np.array(StationIDs, dtype=object)
elif lvar == 'Time': # need to process into time stamp strings #"%Y-%m-%dT%H:%M:%SZ"
elif lvar == 'Time' or lvar == 'time': # need to process into time stamp strings #"%Y-%m-%dT%H:%M:%SZ"
tmp = self.var(lvar)[idx]
obstimes = [self.validtime + dt.timedelta(hours=float(tmp[a])) for a in range(len(tmp))]
obstimes = [a.strftime("%Y-%m-%dT%H:%M:%SZ") for a in obstimes]
Expand Down