src/pys5p/ckd_io.py
def __rd_dataset(self, dset_name: str, bands: str):
        """
        General function to read non-compound dataset into xarray::Dataset

        Parameters
        ----------
        dset_name: str
           name (including path) of the dataset as '/BAND{}/<name>'
        bands : str
           Tropomi bands [1..8] or channels ['12', '34', '56', '78'],
           default: '78'
        """
        ckd_val = None
        for band in bands:
            # try Static-CKD product
            if dset_name.format(band) in self.fid:
                if ckd_val is None:
                    ckd_val = h5_to_xr(self.fid[dset_name.format(band)])
                else:
                    ckd_val = xr.concat(
                        (ckd_val,
                         h5_to_xr(self.fid[dset_name.format(band)])),
                        dim='column')
            # try Dynamic-CKD product
            else:
                dyn_fid = h5py.File(self.ckd_dyn_file, 'r')
                if dset_name.format(band) in dyn_fid:
                    if ckd_val is None:
                        ckd_val = h5_to_xr(dyn_fid[dset_name.format(band)])
                    else:
                        ckd_val = xr.concat(
                            (ckd_val,
                             h5_to_xr(dyn_fid[dset_name.format(band)])),
                            dim='column')
                dyn_fid.close()

        if ckd_val is None:
            return None

        # Use NaN as FillValue
        ckd_val = ckd_val.where(ckd_val != float.fromhex('0x1.ep+122'),
                                other=np.nan)

        # combine DataArrays to Dataset
        return xr.Dataset({'value': ckd_val}, attrs=ckd_val.attrs)

        General function to read non-compound dataset into xarray::Dataset

        Parameters
        ----------
        dset_name: str
           name (including path) of the dataset as '/BAND{}/<name>'
        bands : str
           Tropomi bands [1..8] or channels ['12', '34', '56', '78'],
           default: '78'
        
General function to read non-compound dataset into xarray::Dataset
Parameters


General function to read non - compound dataset into xarray :: Dataset Parameters
def __rd_dataset(self, dset_name: str, bands: str):
        ckd_val = None
        for band in bands:
            if dset_name.format(band) in self.fid:
                if ckd_val is None:
                    ckd_val = h5_to_xr(self.fid[dset_name.format(band)])
                else:
                    ckd_val = xr.concat(
                        (ckd_val,
                         h5_to_xr(self.fid[dset_name.format(band)])),
                        dim='column')
            else:
                dyn_fid = h5py.File(self.ckd_dyn_file, 'r')
                if dset_name.format(band) in dyn_fid:
                    if ckd_val is None:
                        ckd_val = h5_to_xr(dyn_fid[dset_name.format(band)])
                    else:
                        ckd_val = xr.concat(
                            (ckd_val,
                             h5_to_xr(dyn_fid[dset_name.format(band)])),
                            dim='column')
                dyn_fid.close()
        if ckd_val is None:
            return None
        ckd_val = ckd_val.where(ckd_val != float.fromhex('0x1.ep+122'),
                                other=np.nan)
        return xr.Dataset({'value': ckd_val}, attrs=ckd_val.attrs)
def __rd_dataset ( self , dset_name : str , bands : str ) : ckd_val = None for band in bands : if dset_name . format ( band ) in self . fid : if ckd_val is None : ckd_val = h5_to_xr ( self . fid [ dset_name . format ( band ) ] ) else : ckd_val = xr . concat ( ( ckd_val , h5_to_xr ( self . fid [ dset_name . format ( band ) ] ) ) , dim = 'column' ) else : dyn_fid = h5py . File ( self . ckd_dyn_file , 'r' ) if dset_name . format ( band ) in dyn_fid : if ckd_val is None : ckd_val = h5_to_xr ( dyn_fid [ dset_name . format ( band ) ] ) else : ckd_val = xr . concat ( ( ckd_val , h5_to_xr ( dyn_fid [ dset_name . format ( band ) ] ) ) , dim = 'column' ) dyn_fid . close ( ) if ckd_val is None : return None ckd_val = ckd_val . where ( ckd_val != float . fromhex ( '0x1.ep+122' ) , other = np . nan ) return xr . Dataset ( { 'value' : ckd_val } , attrs = ckd_val . attrs )
General function to read non-compound dataset into xarray::Dataset
Parameters
General function to read non - compound dataset into xarray :: Dataset Parameters
"""
        General function to read non-compound dataset into xarray::Dataset

        Parameters
        ----------
        dset_name: str
           name (including path) of the dataset as '/BAND{}/<name>'
        bands : str
           Tropomi bands [1..8] or channels ['12', '34', '56', '78'],
           default: '78'
        """ # try Static-CKD product # try Dynamic-CKD product # Use NaN as FillValue # combine DataArrays to Dataset
self
dset_name
str
bands
str