src/pys5p/lv2_io.py
def __h5_dataset(self, name, data_sel, fill_as_nan):
        """
        read dataset from operational products using HDF5
        """
        fillvalue = float.fromhex('0x1.ep+122')

        if name not in self.fid['/PRODUCT']:
            raise ValueError(f'dataset {name} for found')

        dset = self.fid[f'/PRODUCT/{name}']
        if data_sel is None:
            if dset.dtype == np.float32:
                res = dset.astype(float)[0, ...]
            else:
                res = dset[0, ...]
        else:
            if dset.dtype == np.float32:
                res = dset.astype(float)[(0,) + data_sel]
            else:
                res = dset[(0,) + data_sel]

        if fill_as_nan and dset.attrs['_FillValue'] == fillvalue:
            res[(res == fillvalue)] = np.nan

        return res

        read dataset from operational products using HDF5
        
read dataset from operational products using HDF5
read dataset from operational products using HDF5
def __h5_dataset(self, name, data_sel, fill_as_nan):
        fillvalue = float.fromhex('0x1.ep+122')
        if name not in self.fid['/PRODUCT']:
            raise ValueError(f'dataset {name} for found')
        dset = self.fid[f'/PRODUCT/{name}']
        if data_sel is None:
            if dset.dtype == np.float32:
                res = dset.astype(float)[0, ...]
            else:
                res = dset[0, ...]
        else:
            if dset.dtype == np.float32:
                res = dset.astype(float)[(0,) + data_sel]
            else:
                res = dset[(0,) + data_sel]
        if fill_as_nan and dset.attrs['_FillValue'] == fillvalue:
            res[(res == fillvalue)] = np.nan
        return res
def __h5_dataset ( self , name , data_sel , fill_as_nan ) : fillvalue = float . fromhex ( '0x1.ep+122' ) if name not in self . fid [ '/PRODUCT' ] : raise ValueError ( f'dataset {name} for found' ) dset = self . fid [ f'/PRODUCT/{name}' ] if data_sel is None : if dset . dtype == np . float32 : res = dset . astype ( float ) [ 0 , ... ] else : res = dset [ 0 , ... ] else : if dset . dtype == np . float32 : res = dset . astype ( float ) [ ( 0 , ) + data_sel ] else : res = dset [ ( 0 , ) + data_sel ] if fill_as_nan and dset . attrs [ '_FillValue' ] == fillvalue : res [ ( res == fillvalue ) ] = np . nan return res
read dataset from operational products using HDF5
read dataset from operational products using HDF5
"""
        read dataset from operational products using HDF5
        """
self
name
data_sel
fill_as_nan