src/pys5p/lv2_io.py
def __nc_geo_bounds(self, extent, data_sel):
        """
        read bounds of latitude/longitude from science products using netCDF4
        """
        indx = None
        if extent is not None:
            if len(extent) != 4:
                raise ValueError('parameter extent must have 4 elements')

            lats = self.fid['/instrument/latitude_center'][:].reshape(
                self.scanline, self.ground_pixel)
            lons = self.fid['/instrument/longitude_center'][:].reshape(
                self.scanline, self.ground_pixel)

            indx = ((lons >= extent[0]) & (lons <= extent[1])
                    & (lats >= extent[2]) & (lats <= extent[3])).nonzero()
            data_sel = np.s_[indx[0].min():indx[0].max(),
                             indx[1].min():indx[1].max()]

        gid = self.fid['/instrument']
        lat_bounds = gid['latitude_corners'][:].data.reshape(
            self.scanline, self.ground_pixel, 4)
        lon_bounds = gid['longitude_corners'][:].data.reshape(
            self.scanline, self.ground_pixel, 4)
        if data_sel is not None:
            lat_bounds = lat_bounds[data_sel + (slice(None),)]
            lon_bounds = lon_bounds[data_sel + (slice(None),)]

        return (data_sel, lon_bounds, lat_bounds)

        read bounds of latitude/longitude from science products using netCDF4
        
read bounds of latitude/longitude from science products using netCDF4
read bounds of latitude / longitude from science products using netCDF4
def __nc_geo_bounds(self, extent, data_sel):
        indx = None
        if extent is not None:
            if len(extent) != 4:
                raise ValueError('parameter extent must have 4 elements')
            lats = self.fid['/instrument/latitude_center'][:].reshape(
                self.scanline, self.ground_pixel)
            lons = self.fid['/instrument/longitude_center'][:].reshape(
                self.scanline, self.ground_pixel)
            indx = ((lons >= extent[0]) & (lons <= extent[1])
                    & (lats >= extent[2]) & (lats <= extent[3])).nonzero()
            data_sel = np.s_[indx[0].min():indx[0].max(),
                             indx[1].min():indx[1].max()]
        gid = self.fid['/instrument']
        lat_bounds = gid['latitude_corners'][:].data.reshape(
            self.scanline, self.ground_pixel, 4)
        lon_bounds = gid['longitude_corners'][:].data.reshape(
            self.scanline, self.ground_pixel, 4)
        if data_sel is not None:
            lat_bounds = lat_bounds[data_sel + (slice(None),)]
            lon_bounds = lon_bounds[data_sel + (slice(None),)]
        return (data_sel, lon_bounds, lat_bounds)
def __nc_geo_bounds ( self , extent , data_sel ) : indx = None if extent is not None : if len ( extent ) != 4 : raise ValueError ( 'parameter extent must have 4 elements' ) lats = self . fid [ '/instrument/latitude_center' ] [ : ] . reshape ( self . scanline , self . ground_pixel ) lons = self . fid [ '/instrument/longitude_center' ] [ : ] . reshape ( self . scanline , self . ground_pixel ) indx = ( ( lons >= extent [ 0 ] ) & ( lons <= extent [ 1 ] ) & ( lats >= extent [ 2 ] ) & ( lats <= extent [ 3 ] ) ) . nonzero ( ) data_sel = np . s_ [ indx [ 0 ] . min ( ) : indx [ 0 ] . max ( ) , indx [ 1 ] . min ( ) : indx [ 1 ] . max ( ) ] gid = self . fid [ '/instrument' ] lat_bounds = gid [ 'latitude_corners' ] [ : ] . data . reshape ( self . scanline , self . ground_pixel , 4 ) lon_bounds = gid [ 'longitude_corners' ] [ : ] . data . reshape ( self . scanline , self . ground_pixel , 4 ) if data_sel is not None : lat_bounds = lat_bounds [ data_sel + ( slice ( None ) , ) ] lon_bounds = lon_bounds [ data_sel + ( slice ( None ) , ) ] return ( data_sel , lon_bounds , lat_bounds )
read bounds of latitude/longitude from science products using netCDF4
read bounds of latitude / longitude from science products using netCDF4
"""
        read bounds of latitude/longitude from science products using netCDF4
        """
self
extent
data_sel