Exemplo n.º 1
0
 def _get_calib_coefs(self, channel_name):
     """Get coefficients for calibration from counts to radiance."""
     band_idx = self.mda['spectral_channel_id'] - 1
     coefs_nominal = self.prologue["RadiometricProcessing"][
         "Level15ImageCalibration"]
     coefs_gsics = self.prologue["RadiometricProcessing"]['MPEFCalFeedback']
     radiance_types = self.prologue['ImageDescription'][
         'Level15ImageProduction']['PlannedChanProcessing']
     return create_coef_dict(
         coefs_nominal=(coefs_nominal['CalSlope'][band_idx],
                        coefs_nominal['CalOffset'][band_idx]),
         coefs_gsics=(coefs_gsics['GSICSCalCoeff'][band_idx],
                      coefs_gsics['GSICSOffsetCount'][band_idx]),
         ext_coefs=self.ext_calib_coefs.get(channel_name, {}),
         radiance_type=radiance_types[band_idx])
Exemplo n.º 2
0
    def _get_calib_coefs(self, channel_name):
        """Get coefficients for calibration from counts to radiance."""
        # even though all the channels may not be present in the file,
        # the header does have calibration coefficients for all the channels
        # hence, this channel index needs to refer to full channel list
        band_idx = list(CHANNEL_NAMES.values()).index(channel_name)

        coefs_nominal = self.header['15_DATA_HEADER']['RadiometricProcessing'][
            'Level15ImageCalibration']
        coefs_gsics = self.header['15_DATA_HEADER']['RadiometricProcessing'][
            'MPEFCalFeedback']
        radiance_types = self.header['15_DATA_HEADER']['ImageDescription'][
            'Level15ImageProduction']['PlannedChanProcessing']
        return create_coef_dict(
            coefs_nominal=(coefs_nominal['CalSlope'][band_idx],
                           coefs_nominal['CalOffset'][band_idx]),
            coefs_gsics=(coefs_gsics['GSICSCalCoeff'][band_idx],
                         coefs_gsics['GSICSOffsetCount'][band_idx]),
            ext_coefs=self.ext_calib_coefs.get(channel_name, {}),
            radiance_type=radiance_types[band_idx])