From 7445f0e00f58a79f5cbb93d99561648037c1fc5f Mon Sep 17 00:00:00 2001 From: Adam Dybbroe Date: Wed, 5 Jun 2019 16:06:05 +0200 Subject: [PATCH] Masking for both 3a and 3b, avoiding data in the transition all together Signed-off-by: Adam Dybbroe --- satpy/readers/aapp_l1b.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/satpy/readers/aapp_l1b.py b/satpy/readers/aapp_l1b.py index dfa71a41e0..bb304da914 100644 --- a/satpy/readers/aapp_l1b.py +++ b/satpy/readers/aapp_l1b.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017 +# Copyright (c) 2012 - 2019, Pytroll # Author(s): @@ -81,6 +81,7 @@ def __init__(self, filename, filename_info, filetype_info): self._data = None self._header = None self._is3b = None + self._is3a = None self._shape = None self.lons = None self.lats = None @@ -237,11 +238,12 @@ def calibrate(self, if dataset_id.name in ("3a", "3b") and self._is3b is None: # Is it 3a or 3b: - is3b = np.expand_dims( - np.bitwise_and( - np.right_shift(self._data['scnlinbit'], 0), 1) == 1, 1) + is3b = np.expand_dims(np.bitwise_and(self._data['scnlinbit'], 3) == 1, 1) self._is3b = np.repeat(is3b, self._data['hrpt'][0].shape[0], axis=1) + is3a = np.expand_dims(np.bitwise_and(self._data['scnlinbit'], 3) == 0, 1) + self._is3a = np.repeat(is3a, + self._data['hrpt'][0].shape[0], axis=1) try: vis_idx = ['1', '2', '3a'].index(dataset_id.name) @@ -258,7 +260,7 @@ def calibrate(self, dataset_id.calibration, pre_launch_coeffs, coeffs, - mask=(dataset_id.name == '3a' and self._is3b))) + mask=(dataset_id.name == '3a' and np.logical_not(self._is3a)))) else: ds = create_xarray( _ir_calibrate(self._header,