How to use the satpy.satin.msg_hdf.InfoObject function in satpy

To help you get started, we’ve selected a few satpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
# retv.PHASE_PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8")
        # retv.PHASE_PALETTE.info["PAL_VERSION"] = np.string_("1.2")
        # retv._keys.append("PHASE_PALETTE")

        retv.phase_flag = InfoObject()
        retv.phase_flag.info["output_value_nameslist"] = np.array(phase_lut,
                                                                  dtype=namelist)
        # retv.phase_flag.info["CLASS"] = np.string_("IMAGE")
        # retv.phase_flag.info["IMAGE_VERSION"] = np.string_("1.2")
        # retv._refs[("phase_flag", "PALETTE")] = np.string_("PHASE_PALETTE")
        retv.phase_flag.info["description"] = np.string_(
            'MSG SEVIRI Cloud phase flags')
        retv.phase_flag.data = self.cloudphase.astype('B')
        retv._projectables.append("phase_flag")

        retv.quality_flag = InfoObject()
        retv.quality_flag.info["output_value_nameslist"] = np.array(quality_lut,
                                                                    dtype=namelist)
        retv.quality_flag.info[
            "description"] = np.string_('MSG SEVIRI bitwise quality/processing flags')
        retv.quality_flag.data = ctype_procflags2pps(self.processing_flags)
        retv._projectables.append("quality_flag")

        retv.save = retv.write
        return retv
github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
retv.height.data = ((self.height - 0.0) /
                            200.0).filled(255).astype('B')
        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")

        retv.PRESSURE_PALETTE = InfoObject()
        retv.PRESSURE_PALETTE.data = old_ctth_press_palette_data()
        retv.PRESSURE_PALETTE.info["CLASS"] = np.string_("PALETTE")
        retv.PRESSURE_PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB")
        retv.PRESSURE_PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8")
        retv.PRESSURE_PALETTE.info["PAL_VERSION"] = np.string_("1.2")
        retv._keys.append("PRESSURE_PALETTE")

        retv.pressure = InfoObject()
        retv.pressure.info["description"] = \
            np.string_("MSG SEVIRI cloud top pressure (hPa)")
        retv.pressure.info["gain"] = np.float32(25.0)
        retv.pressure.info["intercept"] = np.float32(0.0)
        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["IMAGE_VERSION"] = np.string_("1.2")
        retv._refs[("pressure", "PALETTE")] = np.string_("PRESSURE_PALETTE")
        retv._projectables.append("pressure")

        retv.TEMPERATURE_PALETTE = InfoObject()
        retv.TEMPERATURE_PALETTE.data = old_ctth_temp_palette_data()
        retv.TEMPERATURE_PALETTE.info["CLASS"] = np.string_("PALETTE")
        retv.TEMPERATURE_PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB")
github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
retv._keys.append("PRESSURE_PALETTE")

        retv.pressure = InfoObject()
        retv.pressure.info["description"] = \
            np.string_("MSG SEVIRI cloud top pressure (hPa)")
        retv.pressure.info["gain"] = np.float32(25.0)
        retv.pressure.info["intercept"] = np.float32(0.0)
        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["IMAGE_VERSION"] = np.string_("1.2")
        retv._refs[("pressure", "PALETTE")] = np.string_("PRESSURE_PALETTE")
        retv._projectables.append("pressure")

        retv.TEMPERATURE_PALETTE = InfoObject()
        retv.TEMPERATURE_PALETTE.data = old_ctth_temp_palette_data()
        retv.TEMPERATURE_PALETTE.info["CLASS"] = np.string_("PALETTE")
        retv.TEMPERATURE_PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB")
        retv.TEMPERATURE_PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8")
        retv.TEMPERATURE_PALETTE.info["PAL_VERSION"] = np.string_("1.2")
        retv._keys.append("TEMPERATURE_PALETTE")

        retv.temperature = InfoObject()
        retv.temperature.info["description"] = \
            np.string_("MSG SEVIRI cloud top temperature (K)")
        retv.temperature.info["gain"] = np.float32(1.0)
        retv.temperature.info["intercept"] = np.float32(100.0)
        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")
github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
retv._md["sec_1970"] = np.uint64(0)
        retv._md["version"] = np.string_(self.product_algorithm_version)

        retv.PALETTE = InfoObject()
        retv.PALETTE.data = old_ctype_palette_data()
        retv.PALETTE.info["CLASS"] = np.string_("PALETTE\0")
        retv.PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB\0")
        retv.PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8\0")
        retv.PALETTE.info["PAL_VERSION"] = np.string_("1.2\0")
        retv._keys.append("PALETTE")

        namelist = np.dtype([('outval_name', 'S128')])
        retv.OutputValueNameList = namelist
        retv._keys.append("OutputValueNameList")

        retv.cloudtype = InfoObject()
        retv.cloudtype.info["output_value_namelist"] = np.array(ctype_lut,
                                                                dtype=namelist)
        retv.cloudtype.info["CLASS"] = np.string_("IMAGE\0")
        retv.cloudtype.info["IMAGE_VERSION"] = np.string_("1.2\0")
        retv._refs[("cloudtype", "PALETTE")] = np.string_("PALETTE\0")
        retv.cloudtype.info["description"] = np.string_(
            "MSG SEVIRI Cloud Type")
        retv.cloudtype.data = self.cloudtype.astype('B')
        retv._projectables.append("cloudtype")

        # retv.PHASE_PALETTE = InfoObject()
        # retv.PHASE_PALETTE.data = self.cloudphase_palette
        # retv.PHASE_PALETTE.info["CLASS"] = np.string_("PALETTE")
        # retv.PHASE_PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB")
        # retv.PHASE_PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8")
        # retv.PHASE_PALETTE.info["PAL_VERSION"] = np.string_("1.2")
github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
retv._keys.append("HEIGHT_PALETTE")

        retv.height = InfoObject()
        retv.height.info["description"] = np.string_(
            "MSG SEVIRI cloud top height (m)")
        retv.height.info["gain"] = np.float32(200.0)
        retv.height.info["intercept"] = np.float32(0.0)
        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["IMAGE_VERSION"] = np.string_("1.2")
        retv._refs[("height", "PALETTE")] = np.string_("HEIGHT_PALETTE")
        retv._projectables.append("height")

        retv.PRESSURE_PALETTE = InfoObject()
        retv.PRESSURE_PALETTE.data = old_ctth_press_palette_data()
        retv.PRESSURE_PALETTE.info["CLASS"] = np.string_("PALETTE")
        retv.PRESSURE_PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB")
        retv.PRESSURE_PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8")
        retv.PRESSURE_PALETTE.info["PAL_VERSION"] = np.string_("1.2")
        retv._keys.append("PRESSURE_PALETTE")

        retv.pressure = InfoObject()
        retv.pressure.info["description"] = \
            np.string_("MSG SEVIRI cloud top pressure (hPa)")
        retv.pressure.info["gain"] = np.float32(25.0)
        retv.pressure.info["intercept"] = np.float32(0.0)
        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")
github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
retv.temperature = InfoObject()
        retv.temperature.info["description"] = \
            np.string_("MSG SEVIRI cloud top temperature (K)")
        retv.temperature.info["gain"] = np.float32(1.0)
        retv.temperature.info["intercept"] = np.float32(100.0)
        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["IMAGE_VERSION"] = np.string_("1.2")
        retv._refs[("temperature", "PALETTE")] = np.string_(
            "TEMPERATURE_PALETTE")
        retv._projectables.append("temperature")

        retv.processing_flag = InfoObject()
        # retv.processing_flag.info["output_value_nameslist"] = processing_lut
        retv.processing_flag.info["description"] = np.string_(
            'MSG SEVIRI bitwise quality/processing flags')
        retv.processing_flag.data = ctth_procflags2pps(self.processing_flags)
        retv._projectables.append("processing_flag")

        retv.save = retv.write

        return retv
github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
retv.cloudtype.info["IMAGE_VERSION"] = np.string_("1.2\0")
        retv._refs[("cloudtype", "PALETTE")] = np.string_("PALETTE\0")
        retv.cloudtype.info["description"] = np.string_(
            "MSG SEVIRI Cloud Type")
        retv.cloudtype.data = self.cloudtype.astype('B')
        retv._projectables.append("cloudtype")

        # retv.PHASE_PALETTE = InfoObject()
        # retv.PHASE_PALETTE.data = self.cloudphase_palette
        # retv.PHASE_PALETTE.info["CLASS"] = np.string_("PALETTE")
        # retv.PHASE_PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB")
        # retv.PHASE_PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8")
        # retv.PHASE_PALETTE.info["PAL_VERSION"] = np.string_("1.2")
        # retv._keys.append("PHASE_PALETTE")

        retv.phase_flag = InfoObject()
        retv.phase_flag.info["output_value_nameslist"] = np.array(phase_lut,
                                                                  dtype=namelist)
        # retv.phase_flag.info["CLASS"] = np.string_("IMAGE")
        # retv.phase_flag.info["IMAGE_VERSION"] = np.string_("1.2")
        # retv._refs[("phase_flag", "PALETTE")] = np.string_("PHASE_PALETTE")
        retv.phase_flag.info["description"] = np.string_(
            'MSG SEVIRI Cloud phase flags')
        retv.phase_flag.data = self.cloudphase.astype('B')
        retv._projectables.append("phase_flag")

        retv.quality_flag = InfoObject()
        retv.quality_flag.info["output_value_nameslist"] = np.array(quality_lut,
                                                                    dtype=namelist)
        retv.quality_flag.info[
            "description"] = np.string_('MSG SEVIRI bitwise quality/processing flags')
        retv.quality_flag.data = ctype_procflags2pps(self.processing_flags)
github pytroll / satpy / satpy / satin / msg_hdf.py View on Github external
retv._md["satellite_id"] = np.string_(self.satid)
        retv._md["sec_1970"] = np.uint64(0)
        retv._md["version"] = np.string_(self.product_algorithm_version)

        retv.processingflag_lut = []

        retv.cloudiness = InfoObject()
        retv.cloudiness.info["description"] = \
            "MSG SEVIRI effective cloudiness (%)"
        retv.cloudiness.info["gain"] = np.float32(0.0)
        retv.cloudiness.info["intercept"] = np.float32(0.0)
        retv.cloudiness.info["no_data_value"] = np.uint8(255)
        retv.cloudiness.data = self.cloudiness.astype('B')
        retv._projectables.append("cloudiness")

        retv.HEIGHT_PALETTE = InfoObject()
        retv.HEIGHT_PALETTE.data = old_ctth_height_palette_data()
        retv.HEIGHT_PALETTE.info["CLASS"] = np.string_("PALETTE")
        retv.HEIGHT_PALETTE.info["PAL_COLORMODEL"] = np.string_("RGB")
        retv.HEIGHT_PALETTE.info["PAL_TYPE"] = np.string_("STANDARD8")
        retv.HEIGHT_PALETTE.info["PAL_VERSION"] = np.string_("1.2")
        retv._keys.append("HEIGHT_PALETTE")

        retv.height = InfoObject()
        retv.height.info["description"] = np.string_(
            "MSG SEVIRI cloud top height (m)")
        retv.height.info["gain"] = np.float32(200.0)
        retv.height.info["intercept"] = np.float32(0.0)
        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")