npsphinx prolog… I dont know what to write here….

[1]:
import holoviews as hv
hv.extension('bokeh')
import geoviews as gv


from glob import glob
from time import time

import os, sys
import logging
from importlib import reload
reload(logging)
logging.basicConfig(level=logging.INFO)
from slcl1butils.get_polygons_from_l1b import get_swath_tiles_polygons_from_l1bfiles
INFO:root:config path: /home/docs/checkouts/readthedocs.org/user_builds/slcl1butils/checkouts/latest/slcl1butils/config.yaml
config path: /home/docs/checkouts/readthedocs.org/user_builds/slcl1butils/checkouts/latest/slcl1butils/config.yaml
[2]:
from slcl1butils.utils import get_test_file
one_safe_l1b = get_test_file('S1B_IW_XSP__1SDV_20211026T045709_20211026T045736_029302_037F35_1CD7.SAFE')
l1bncfile_pattern = os.path.join(one_safe_l1b,'*iw*vv*nc')
print(l1bncfile_pattern)
files = glob(l1bncfile_pattern)
len(files)
/home/docs/checkouts/readthedocs.org/user_builds/slcl1butils/checkouts/latest/assests/S1B_IW_XSP__1SDV_20211026T045709_20211026T045736_029302_037F35_1CD7.SAFE/*iw*vv*nc
[2]:
3

Load the polygons pts from L1B

[3]:
polygons,coordinates,variables = get_swath_tiles_polygons_from_l1bfiles(files)
polygons['intra'].keys()
[3]:
dict_keys(['swath', 'tiles', 'bursts'])

Create layers of polygons with specific properties

[4]:
# Background Map
gvvbckg = gv.tile_sources.EsriImagery
# Swath limits
gvvswath = gv.Polygons(polygons['intra']['swath'],label='swath').opts(fill_color='white',alpha=0.5,show_legend=True, muted_alpha=0)
# burst limits
gvvburst  = gv.Polygons(polygons['intra']['bursts'],label='burst').opts(fill_color='green',alpha=0.5,show_legend=True, muted_alpha=0)
# Intra and inter bursts polygons
gvvtile_intra = gv.Polygons(polygons['intra']['tiles'],label='intraburst tiles').opts(fill_color='blue',alpha=0.5, show_legend=True, muted_alpha=0)
gvvtile_inter = gv.Polygons(polygons['inter']['tiles'],label='interburst tiles').opts(fill_color='red',alpha=0.5,show_legend=True, muted_alpha=0)

## Plotting

[5]:
# Preparing the layer and window options
ff = (gvvbckg*gvvswath*gvvburst*gvvtile_intra*gvvtile_inter).opts(width=1000,height=1000, legend_position='top_right')#,show_legend=True,tools=["hover", "wheel_zoom"], legend_position='top_right')
[6]:
# Simple and direct plotting
ff
[6]:
[7]:
# Save plot in HTML
if False:
    import holoviews as hv
    import numpy as np
    import panel as pn
    import bokeh
    from bokeh.resources import INLINE

    pn.pane.HoloViews(ff).save('example_geometry_l1b', embed=True, resources=INLINE)