src/pys5p/ckd_io1.py
def offset(self, bands='78'):
        """
        Returns offset CKD, 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('Offset CKD is only available for SWIR')

        ckd = None
        long_name = 'SWIR offset CKD'

        # try the Static CKD product, first
        for band in bands:
            dsname = f'/BAND{band}/analog_offset_swir'
            if dsname not in self.fid:
                continue

            if not ckd:
                ckd = S5Pmsm(self.fid[dsname],
                             datapoint=True, data_sel=np.s_[:-1, :])
                ckd.set_long_name(long_name)
            else:
                buff = S5Pmsm(self.fid[dsname],
                              datapoint=True, data_sel=np.s_[:-1, :])
                ckd.concatenate(buff, axis=1)

        if ckd is not None:
            ckd.set_fillvalue()
            return ckd

        # try the dynamic CKD products
        with h5py.File(self.ckd_dyn_file, 'r') as fid:
            for band in bands:
                dsname = f'/BAND{band}/analog_offset_swir'

                if not ckd:
                    ckd = S5Pmsm(fid[dsname],
                                 datapoint=True, data_sel=np.s_[:-1, :])
                    ckd.set_long_name(long_name)
                else:
                    buff = S5Pmsm(fid[dsname],
                                  datapoint=True, data_sel=np.s_[:-1, :])
                    ckd.concatenate(buff, axis=1)
        ckd.set_fillvalue()
        return ckd

        Returns offset CKD, SWIR only

        Notes
        -----
        SWIR row 257 is excluded.
        
Returns offset CKD, SWIR only
Notes

SWIR row 257 is excluded.
Returns offset CKD SWIR only Notes SWIR row 257 is excluded .
def offset(self, 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('Offset CKD is only available for SWIR')
        ckd = None
        long_name = 'SWIR offset CKD'
        for band in bands:
            dsname = f'/BAND{band}/analog_offset_swir'
            if dsname not in self.fid:
                continue
            if not ckd:
                ckd = S5Pmsm(self.fid[dsname],
                             datapoint=True, data_sel=np.s_[:-1, :])
                ckd.set_long_name(long_name)
            else:
                buff = S5Pmsm(self.fid[dsname],
                              datapoint=True, data_sel=np.s_[:-1, :])
                ckd.concatenate(buff, axis=1)
        if ckd is not None:
            ckd.set_fillvalue()
            return ckd
        with h5py.File(self.ckd_dyn_file, 'r') as fid:
            for band in bands:
                dsname = f'/BAND{band}/analog_offset_swir'
                if not ckd:
                    ckd = S5Pmsm(fid[dsname],
                                 datapoint=True, data_sel=np.s_[:-1, :])
                    ckd.set_long_name(long_name)
                else:
                    buff = S5Pmsm(fid[dsname],
                                  datapoint=True, data_sel=np.s_[:-1, :])
                    ckd.concatenate(buff, axis=1)
        ckd.set_fillvalue()
        return ckd
def offset ( self , 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 ( 'Offset CKD is only available for SWIR' ) ckd = None long_name = 'SWIR offset CKD' for band in bands : dsname = f'/BAND{band}/analog_offset_swir' if dsname not in self . fid : continue if not ckd : ckd = S5Pmsm ( self . fid [ dsname ] , datapoint = True , data_sel = np . s_ [ : - 1 , : ] ) ckd . set_long_name ( long_name ) else : buff = S5Pmsm ( self . fid [ dsname ] , datapoint = True , data_sel = np . s_ [ : - 1 , : ] ) ckd . concatenate ( buff , axis = 1 ) if ckd is not None : ckd . set_fillvalue ( ) return ckd with h5py . File ( self . ckd_dyn_file , 'r' ) as fid : for band in bands : dsname = f'/BAND{band}/analog_offset_swir' if not ckd : ckd = S5Pmsm ( fid [ dsname ] , datapoint = True , data_sel = np . s_ [ : - 1 , : ] ) ckd . set_long_name ( long_name ) else : buff = S5Pmsm ( fid [ dsname ] , datapoint = True , data_sel = np . s_ [ : - 1 , : ] ) ckd . concatenate ( buff , axis = 1 ) ckd . set_fillvalue ( ) return ckd
Returns offset CKD, SWIR only
Notes
Returns offset CKD SWIR only Notes
"""
        Returns offset CKD, SWIR only

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