src/pys5p/ckd_io1.py
def dpqf(self, threshold=None, bands='78'):
        """
        Returns Detector Pixel Quality Mask (boolean), SWIR only

        Notes
        -----
        SWIR row 257 is excluded.
        """
        if len(bands) > 2:
            raise ValueError('read per band or channel, only')
        if '7' not in bands and '8' not in bands:
            raise ValueError('pixel quality CKD is only available for SWIR')

        if threshold is None:
            threshold = self.fid['/BAND7/dpqf_threshold'][:]

        # try the Static CKD product, first
        if '/BAND7/dpqf_map' in self.fid:
            dset = self.fid['/BAND7/dpqf_map']
            dpqf_b7 = dset[:-1, :]
            dset = self.fid['/BAND8/dpqf_map']
            dpqf_b8 = dset[:-1, :]

            return np.hstack((dpqf_b7, dpqf_b8)) < threshold

        # try the dynamic CKD products
        with h5py.File(self.ckd_dyn_file, 'r') as fid:
            if threshold is None:
                threshold = fid['/BAND7/dpqf_threshold'][:]

            dset = fid['/BAND7/dpqf_map']
            dpqf_b7 = dset[:-1, :]
            dset = fid['/BAND8/dpqf_map']
            dpqf_b8 = dset[:-1, :]

        return np.hstack((dpqf_b7, dpqf_b8)) < threshold

        Returns Detector Pixel Quality Mask (boolean), SWIR only

        Notes
        -----
        SWIR row 257 is excluded.
        
Returns Detector Pixel Quality Mask (boolean), SWIR only
Notes

SWIR row 257 is excluded.
Returns Detector Pixel Quality Mask ( boolean ) SWIR only Notes SWIR row 257 is excluded .
def dpqf(self, threshold=None, bands='78'):
        if len(bands) > 2:
            raise ValueError('read per band or channel, only')
        if '7' not in bands and '8' not in bands:
            raise ValueError('pixel quality CKD is only available for SWIR')
        if threshold is None:
            threshold = self.fid['/BAND7/dpqf_threshold'][:]
        if '/BAND7/dpqf_map' in self.fid:
            dset = self.fid['/BAND7/dpqf_map']
            dpqf_b7 = dset[:-1, :]
            dset = self.fid['/BAND8/dpqf_map']
            dpqf_b8 = dset[:-1, :]
            return np.hstack((dpqf_b7, dpqf_b8)) < threshold
        with h5py.File(self.ckd_dyn_file, 'r') as fid:
            if threshold is None:
                threshold = fid['/BAND7/dpqf_threshold'][:]
            dset = fid['/BAND7/dpqf_map']
            dpqf_b7 = dset[:-1, :]
            dset = fid['/BAND8/dpqf_map']
            dpqf_b8 = dset[:-1, :]
        return np.hstack((dpqf_b7, dpqf_b8)) < threshold
def dpqf ( self , threshold = None , bands = '78' ) : if len ( bands ) > 2 : raise ValueError ( 'read per band or channel, only' ) if '7' not in bands and '8' not in bands : raise ValueError ( 'pixel quality CKD is only available for SWIR' ) if threshold is None : threshold = self . fid [ '/BAND7/dpqf_threshold' ] [ : ] if '/BAND7/dpqf_map' in self . fid : dset = self . fid [ '/BAND7/dpqf_map' ] dpqf_b7 = dset [ : - 1 , : ] dset = self . fid [ '/BAND8/dpqf_map' ] dpqf_b8 = dset [ : - 1 , : ] return np . hstack ( ( dpqf_b7 , dpqf_b8 ) ) < threshold with h5py . File ( self . ckd_dyn_file , 'r' ) as fid : if threshold is None : threshold = fid [ '/BAND7/dpqf_threshold' ] [ : ] dset = fid [ '/BAND7/dpqf_map' ] dpqf_b7 = dset [ : - 1 , : ] dset = fid [ '/BAND8/dpqf_map' ] dpqf_b8 = dset [ : - 1 , : ] return np . hstack ( ( dpqf_b7 , dpqf_b8 ) ) < threshold
Returns Detector Pixel Quality Mask (boolean), SWIR only
Notes
Returns Detector Pixel Quality Mask ( boolean ) SWIR only Notes
"""
        Returns Detector Pixel Quality Mask (boolean), SWIR only

        Notes
        -----
        SWIR row 257 is excluded.
        """ # try the Static CKD product, first # try the dynamic CKD products
self
threshold
bands