src/pys5p/lv2_io.py
def __nc_attr(self, attr_name, ds_name):
        """
        read attributes from science products using netCDF4
        """
        if ds_name is not None:
            for grp_name in ['target_product', 'side_product', 'instrument']:
                if grp_name not in self.fid.groups:
                    continue

                if ds_name not in self.fid[grp_name].variables:
                    continue

                dset = self.fid[f'/{grp_name}/{ds_name}']
                if attr_name in dset.ncattrs():
                    return dset.getncattr(attr_name)

            return None

        if attr_name not in self.fid.ncattrs():
            return None

        return self.fid.getncattr(attr_name)

        read attributes from science products using netCDF4
        
read attributes from science products using netCDF4
read attributes from science products using netCDF4
def __nc_attr(self, attr_name, ds_name):
        if ds_name is not None:
            for grp_name in ['target_product', 'side_product', 'instrument']:
                if grp_name not in self.fid.groups:
                    continue
                if ds_name not in self.fid[grp_name].variables:
                    continue
                dset = self.fid[f'/{grp_name}/{ds_name}']
                if attr_name in dset.ncattrs():
                    return dset.getncattr(attr_name)
            return None
        if attr_name not in self.fid.ncattrs():
            return None
        return self.fid.getncattr(attr_name)
def __nc_attr ( self , attr_name , ds_name ) : if ds_name is not None : for grp_name in [ 'target_product' , 'side_product' , 'instrument' ] : if grp_name not in self . fid . groups : continue if ds_name not in self . fid [ grp_name ] . variables : continue dset = self . fid [ f'/{grp_name}/{ds_name}' ] if attr_name in dset . ncattrs ( ) : return dset . getncattr ( attr_name ) return None if attr_name not in self . fid . ncattrs ( ) : return None return self . fid . getncattr ( attr_name )
read attributes from science products using netCDF4
read attributes from science products using netCDF4
"""
        read attributes from science products using netCDF4
        """
self
attr_name
ds_name