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
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
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)