Commit 9a24eb00 authored by R.K.Garcia's avatar R.K.Garcia
Browse files

fix band_wavelength conversion to microns

parent 4a4a323b
......@@ -478,7 +478,7 @@ class HimawariAHIasCMIP(object):
geospatial_lat_lon_extent:geospatial_lon_units = "degrees_east" ;
"""
def pvda_misc(self):
def pvda_misc(self, as_cmi=False):
band = np.array([self._hs.band], dtype=np.uint8)
a = dict(
......@@ -493,9 +493,9 @@ class HimawariAHIasCMIP(object):
standard_name="sensor_band_central_radiation_wavelength",
units="um"
)
bwl_um = self._hs.metadata.central_wavelength / 1e6
bwl_um = self.central_wavelength # self._hs.metadata.central_wavelength * 1e6
bwl = np.array([bwl_um], dtype=np.float32)
yield self.p('band_id'), band, self.d(DEFAULT_BAND_DIM_NAME), a
yield self.p('band_wavelength'), bwl, self.d(DEFAULT_BAND_DIM_NAME), a
def lat_lon_to_l_c(self, lat, lon, round=True):
"""
......@@ -540,11 +540,11 @@ class HimawariAHIasCMIP(object):
yield self.p(self._projection_name), np.int32(0), {}, self.nav
# band_wavelength in µm
yield self.p('band_wavelength'), np.float64(self.central_wavelength), {}, {}
# yield self.p('band_wavelength'), np.float64(self.central_wavelength), {}, {}
# band number, primarily for CMI
if as_cmi:
yield self.p('band_id'), np.array([self.band], dtype=np.int8), OrderedDict({BAND_ID_DIM: gdims[BAND_ID_DIM]}), {}
# if as_cmi:
# yield self.p('band_id'), np.array([self.band], dtype=np.int8), OrderedDict({BAND_ID_DIM: gdims[BAND_ID_DIM]}), {}
# y and x variables and friends
for each in self.pvda_yx():
......@@ -553,7 +553,7 @@ class HimawariAHIasCMIP(object):
yield each
# misc
for each in self.pvda_misc():
for each in self.pvda_misc(as_cmi=as_cmi):
assert (len(each) == 4)
yield each
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment