Ejemplo n.º 1
0
 def calibrate(self, data, dataset_id):
     """Calibrate the data."""
     tic = datetime.now()
     channel_name = dataset_id['name']
     calib = SEVIRICalibrationHandler(
         platform_id=self.platform_id,
         channel_name=channel_name,
         coefs=self._get_calib_coefs(channel_name),
         calib_mode=self.calib_mode,
         scan_time=self.start_time)
     res = calib.calibrate(data, dataset_id['calibration'])
     logger.debug("Calibration time " + str(datetime.now() - tic))
     return res
Ejemplo n.º 2
0
 def calibrate(self, data, calibration):
     """Calibrate the data."""
     tic = datetime.now()
     calib = SEVIRICalibrationHandler(
         platform_id=self.platform_id,
         channel_name=self.channel_name,
         coefs=self._get_calib_coefs(self.channel_name),
         calib_mode=self.calib_mode,
         scan_time=self.start_time
     )
     res = calib.calibrate(data, calibration)
     if calibration in ['radiance', 'reflectance', 'brightness_temperature']:
         res = self._mask_bad_quality(res)
     logger.debug("Calibration time " + str(datetime.now() - tic))
     return res
Ejemplo n.º 3
0
    def calibrate(self, dataset, dataset_id):
        """Calibrate the data."""
        channel = dataset_id['name']
        calibration = dataset_id['calibration']

        if dataset_id['calibration'] == 'counts':
            dataset.attrs['_FillValue'] = 0

        calib = SEVIRICalibrationHandler(platform_id=int(self.platform_id),
                                         channel_name=channel,
                                         coefs=self._get_calib_coefs(
                                             dataset, channel),
                                         calib_mode='NOMINAL',
                                         scan_time=self.start_time)

        return calib.calibrate(dataset, calibration)