src/pys5p/s5p_geoplot.py
def draw_geo_tiles(self, lons, lats, *, sequence=None,
                       title=None, sub_title=None, fig_info=None):
        """
        Display footprints projected with (beter) TransverseMercator

        Parameters
        ----------
        lats :  ndarray
           Latitude coordinates
        lons :  ndarray
           Longitude coordinates
        sequence :  list
           Indices to footprints to be drawn by polygons
        title :  string, optional
           Title of the figure. Default is None
           Suggestion: use attribute "title" of data-product
        sub_title :  string, optional
           Sub-title of the figure. Default is None
           Suggestion: use attribute "comment" of data-product
        fig_info :  FIGinfo, optional
           OrderedDict holding meta-data to be displayed in the figure

        The information provided in the parameter 'fig_info' will be displayed
        in a small box.
        """
        if fig_info is None:
            fig_info = FIGinfo()

        # determine central longitude
        if lons.max() - lons.min() > 180:
            if np.sum(lons > 0) > np.sum(lons < 0):
                lons[lons < 0] += 360
            else:
                lons[lons > 0] -= 360
        lon_0 = np.around(np.mean(lons), decimals=-1)

        # inititalize figure
        fig = plt.figure(figsize=(12.5, 9))
        if title is not None:
            ypos = 1 - 0.35 / fig.get_figheight()
            fig.suptitle(title, fontsize='x-large',
                         position=(0.5, ypos), horizontalalignment='center')

        # draw worldmap
        axx = plt.axes(projection=BetterTransverseMercator(
            central_longitude=lon_0, globe=ccrs.Globe(ellipse='sphere')))
        if sub_title is not None:
            axx.set_title(sub_title, fontsize='large')
        self.__draw_worldmap(axx, whole_globe=True)

        # draw footprint
        if sequence is None:
            lat = np.concatenate([lats[0, :], lats[1:-1, -1],
                                  lats[-1, ::-1], np.flipud(lats)[1:-1, 0]])
            lon = np.concatenate([lons[0, :], lons[1:-1, -1],
                                  lons[-1, ::-1], np.flipud(lons)[1:-1, 0]])

            poly = mpl.patches.Polygon(xy=list(zip(lon, lat)),
                                       closed=True, alpha=0.6,
                                       facecolor=self.cset['s5p'],
                                       transform=ccrs.PlateCarree())
            axx.add_patch(poly)
        else:
            cset = [tol_cset('bright').red, tol_cset('bright').purple]
            print(f'Unique sequence: {np.unique(sequence)}')
            for ii in np.unique(sequence):
                indx = np.unique((sequence == ii).nonzero()[0])
                indx_rev = indx[::-1]
                lat = np.concatenate([lats[indx[0], :],
                                      lats[indx, -1],
                                      lats[indx[-1], ::-1],
                                      lats[indx_rev, 0]])
                lon = np.concatenate([lons[indx[0], :],
                                      lons[indx, -1],
                                      lons[indx[-1], ::-1],
                                      lons[indx_rev, 0]])

                poly = mpl.patches.Polygon(xy=list(zip(lon, lat)),
                                           closed=True, alpha=0.6,
                                           facecolor=cset[ii % 2],
                                           transform=ccrs.PlateCarree())
                axx.add_patch(poly)

        self.__add_copyright(axx)
        fig_info.add('lon0', lon_0)
        self.__add_fig_box(fig, fig_info)
        self.__close_this_page(fig)

        Display footprints projected with (beter) TransverseMercator

        Parameters
        ----------
        lats :  ndarray
           Latitude coordinates
        lons :  ndarray
           Longitude coordinates
        sequence :  list
           Indices to footprints to be drawn by polygons
        title :  string, optional
           Title of the figure. Default is None
           Suggestion: use attribute "title" of data-product
        sub_title :  string, optional
           Sub-title of the figure. Default is None
           Suggestion: use attribute "comment" of data-product
        fig_info :  FIGinfo, optional
           OrderedDict holding meta-data to be displayed in the figure

        The information provided in the parameter 'fig_info' will be displayed
        in a small box.
        
Display footprints projected with (beter) TransverseMercator
Parameters

lats :  ndarray
Latitude coordinates
lons :  ndarray
Longitude coordinates
sequence :  list
Indices to footprints to be drawn by polygons
title :  string, optional
Title of the figure. Default is None
Suggestion: use attribute "title" of data-product
sub_title :  string, optional
Sub-title of the figure. Default is None
Suggestion: use attribute "comment" of data-product
fig_info :  FIGinfo, optional
OrderedDict holding meta-data to be displayed in the figure

The information provided in the parameter 'fig_info' will be displayed
in a small box.
Display footprints projected with ( beter ) TransverseMercator Parameters lats : ndarray Latitude coordinates lons : ndarray Longitude coordinates sequence : list Indices to footprints to be drawn by polygons title : string optional Title of the figure . Default is None Suggestion : use attribute " title " of data - product sub_title : string optional Sub - title of the figure . Default is None Suggestion : use attribute " comment " of data - product fig_info : FIGinfo optional OrderedDict holding meta - data to be displayed in the figure The information provided in the parameter ' fig_info ' will be displayed in a small box .
def draw_geo_tiles(self, lons, lats, *, sequence=None,
                       title=None, sub_title=None, fig_info=None):
        if fig_info is None:
            fig_info = FIGinfo()
        if lons.max() - lons.min() > 180:
            if np.sum(lons > 0) > np.sum(lons < 0):
                lons[lons < 0] += 360
            else:
                lons[lons > 0] -= 360
        lon_0 = np.around(np.mean(lons), decimals=-1)
        fig = plt.figure(figsize=(12.5, 9))
        if title is not None:
            ypos = 1 - 0.35 / fig.get_figheight()
            fig.suptitle(title, fontsize='x-large',
                         position=(0.5, ypos), horizontalalignment='center')
        axx = plt.axes(projection=BetterTransverseMercator(
            central_longitude=lon_0, globe=ccrs.Globe(ellipse='sphere')))
        if sub_title is not None:
            axx.set_title(sub_title, fontsize='large')
        self.__draw_worldmap(axx, whole_globe=True)
        if sequence is None:
            lat = np.concatenate([lats[0, :], lats[1:-1, -1],
                                  lats[-1, ::-1], np.flipud(lats)[1:-1, 0]])
            lon = np.concatenate([lons[0, :], lons[1:-1, -1],
                                  lons[-1, ::-1], np.flipud(lons)[1:-1, 0]])
            poly = mpl.patches.Polygon(xy=list(zip(lon, lat)),
                                       closed=True, alpha=0.6,
                                       facecolor=self.cset['s5p'],
                                       transform=ccrs.PlateCarree())
            axx.add_patch(poly)
        else:
            cset = [tol_cset('bright').red, tol_cset('bright').purple]
            print(f'Unique sequence: {np.unique(sequence)}')
            for ii in np.unique(sequence):
                indx = np.unique((sequence == ii).nonzero()[0])
                indx_rev = indx[::-1]
                lat = np.concatenate([lats[indx[0], :],
                                      lats[indx, -1],
                                      lats[indx[-1], ::-1],
                                      lats[indx_rev, 0]])
                lon = np.concatenate([lons[indx[0], :],
                                      lons[indx, -1],
                                      lons[indx[-1], ::-1],
                                      lons[indx_rev, 0]])
                poly = mpl.patches.Polygon(xy=list(zip(lon, lat)),
                                           closed=True, alpha=0.6,
                                           facecolor=cset[ii % 2],
                                           transform=ccrs.PlateCarree())
                axx.add_patch(poly)
        self.__add_copyright(axx)
        fig_info.add('lon0', lon_0)
        self.__add_fig_box(fig, fig_info)
        self.__close_this_page(fig)
def draw_geo_tiles ( self , lons , lats , * , sequence = None , title = None , sub_title = None , fig_info = None ) : if fig_info is None : fig_info = FIGinfo ( ) if lons . max ( ) - lons . min ( ) > 180 : if np . sum ( lons > 0 ) > np . sum ( lons < 0 ) : lons [ lons < 0 ] += 360 else : lons [ lons > 0 ] -= 360 lon_0 = np . around ( np . mean ( lons ) , decimals = - 1 ) fig = plt . figure ( figsize = ( 12.5 , 9 ) ) if title is not None : ypos = 1 - 0.35 / fig . get_figheight ( ) fig . suptitle ( title , fontsize = 'x-large' , position = ( 0.5 , ypos ) , horizontalalignment = 'center' ) axx = plt . axes ( projection = BetterTransverseMercator ( central_longitude = lon_0 , globe = ccrs . Globe ( ellipse = 'sphere' ) ) ) if sub_title is not None : axx . set_title ( sub_title , fontsize = 'large' ) self . __draw_worldmap ( axx , whole_globe = True ) if sequence is None : lat = np . concatenate ( [ lats [ 0 , : ] , lats [ 1 : - 1 , - 1 ] , lats [ - 1 , : : - 1 ] , np . flipud ( lats ) [ 1 : - 1 , 0 ] ] ) lon = np . concatenate ( [ lons [ 0 , : ] , lons [ 1 : - 1 , - 1 ] , lons [ - 1 , : : - 1 ] , np . flipud ( lons ) [ 1 : - 1 , 0 ] ] ) poly = mpl . patches . Polygon ( xy = list ( zip ( lon , lat ) ) , closed = True , alpha = 0.6 , facecolor = self . cset [ 's5p' ] , transform = ccrs . PlateCarree ( ) ) axx . add_patch ( poly ) else : cset = [ tol_cset ( 'bright' ) . red , tol_cset ( 'bright' ) . purple ] print ( f'Unique sequence: {np.unique(sequence)}' ) for ii in np . unique ( sequence ) : indx = np . unique ( ( sequence == ii ) . nonzero ( ) [ 0 ] ) indx_rev = indx [ : : - 1 ] lat = np . concatenate ( [ lats [ indx [ 0 ] , : ] , lats [ indx , - 1 ] , lats [ indx [ - 1 ] , : : - 1 ] , lats [ indx_rev , 0 ] ] ) lon = np . concatenate ( [ lons [ indx [ 0 ] , : ] , lons [ indx , - 1 ] , lons [ indx [ - 1 ] , : : - 1 ] , lons [ indx_rev , 0 ] ] ) poly = mpl . patches . Polygon ( xy = list ( zip ( lon , lat ) ) , closed = True , alpha = 0.6 , facecolor = cset [ ii % 2 ] , transform = ccrs . PlateCarree ( ) ) axx . add_patch ( poly ) self . __add_copyright ( axx ) fig_info . add ( 'lon0' , lon_0 ) self . __add_fig_box ( fig , fig_info ) self . __close_this_page ( fig )
Display footprints projected with (beter) TransverseMercator
Parameters
Display footprints projected with ( beter ) TransverseMercator Parameters
"""
        Display footprints projected with (beter) TransverseMercator

        Parameters
        ----------
        lats :  ndarray
           Latitude coordinates
        lons :  ndarray
           Longitude coordinates
        sequence :  list
           Indices to footprints to be drawn by polygons
        title :  string, optional
           Title of the figure. Default is None
           Suggestion: use attribute "title" of data-product
        sub_title :  string, optional
           Sub-title of the figure. Default is None
           Suggestion: use attribute "comment" of data-product
        fig_info :  FIGinfo, optional
           OrderedDict holding meta-data to be displayed in the figure

        The information provided in the parameter 'fig_info' will be displayed
        in a small box.
        """ # determine central longitude # inititalize figure # draw worldmap # draw footprint
self
lons
lats
sequence
title
sub_title
fig_info