Skip to content

Commit

Permalink
Bugfix, np.string -> np.string_
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
  • Loading branch information
mraspaud committed Jun 3, 2015
1 parent c9c2ba0 commit 115cb42
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions mpop/satin/msg_hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def convert2pps(self):
retv.height.info["no_data_value"] = np.uint8(255)
retv.height.data = ((self.height - 0.0) /
200.0).filled(255).astype('B')
retv.height.info["CLASS"] = np.string("IMAGE")
retv.height.info["CLASS"] = np.string_("IMAGE")
retv.height.info["IMAGE_VERSION"] = np.string_("1.2")
retv._refs[("height", "PALETTE")] = np.string_("HEIGHT_PALETTE")
retv._projectables.append("height")
Expand All @@ -884,7 +884,7 @@ def convert2pps(self):
retv.pressure.info["no_data_value"] = np.uint8(255)
retv.pressure.data = ((self.pressure - 0.0) /
25.0).filled(255).astype('B')
retv.pressure.info["CLASS"] = np.string("IMAGE")
retv.pressure.info["CLASS"] = np.string_("IMAGE")
retv.pressure.info["IMAGE_VERSION"] = np.string_("1.2")
retv._refs[("pressure", "PALETTE")] = np.string_("PRESSURE_PALETTE")
retv._projectables.append("pressure")
Expand All @@ -905,7 +905,7 @@ def convert2pps(self):
retv.temperature.info["no_data_value"] = np.uint8(255)
retv.temperature.data = ((self.temperature - 100.0) /
1.0).filled(255).astype('B')
retv.temperature.info["CLASS"] = np.string("IMAGE")
retv.temperature.info["CLASS"] = np.string_("IMAGE")
retv.temperature.info["IMAGE_VERSION"] = np.string_("1.2")
retv._refs[("temperature", "PALETTE")] = np.string_(
"TEMPERATURE_PALETTE")
Expand Down Expand Up @@ -1592,3 +1592,20 @@ def load(scene, **kwargs):
scene.channels.append(ct_chan_plax)

LOG.info("Loading channels done.")


if __name__ == '__main__':

filename = "/data/proj/safutv/geo_out/0deg/SAFNWC_MSG3_CT___201505260615_MSG-N_______.h5"

ct = MsgCloudType()
ct.read(filename)

ct.convert2pps().save("blact.h5")

filename = "/data/proj/safutv/geo_out/0deg/SAFNWC_MSG3_CTTH_201505260615_MSG-N_______.h5"
filename = "/data/24/saf/geo_out/0deg/SAFNWC_MSG3_CTTH_201505260615_EuropeCanary.h5"
ct = MsgCTTH()
ct.read(filename)

ct.convert2pps().save("blactth.h5")

0 comments on commit 115cb42

Please sign in to comment.