<jupyter_start><jupyter_text>Open multiples datasetsSome safe files have multiples subdatasets, like WV or IW_SLC. This notebook show how to handle them, or how to handle multiple datasets.<jupyter_code>import xsar 
import xarray as xr
import glob
import geoviews as gv
gv.extension('bokeh')<jupyter_output><empty_output><jupyter_text>SAFES containings multiples subdatasets like WV_SLC cannot be openned with `xarray.open_dataset` given the safe path.<jupyter_code>try:
    wv_slc_ds = xr.open_dataset(xsar.get_test_file('S1A_WV_SLC__1SSV_20160510T101603_20160510T102143_011195_010EA1_Z010.SAFE'))
except IndexError as e:
    print(str(e))<jupyter_output><empty_output><jupyter_text>An `IndexError` is raised, with an advice to use [xsar.SentinelMeta](../basic_api.rstxsar.SentinelMeta) to get the available subdatasets list.<jupyter_code>wv_slc_meta = xsar.Sentinel1Meta(xsar.get_test_file('S1A_WV_SLC__1SSV_20160510T101603_20160510T102143_011195_010EA1_Z010.SAFE'))
wv_slc_meta<jupyter_output><empty_output><jupyter_text>Note that the abose `wv_slc_meta` object is a **multi dataset**Subdatasets list is available with [xsar.Sentinel1Meta.subdatasets](../basic_api.rstxsar.Sentinel1Meta.subdatasets) property<jupyter_code>wv_slc_meta.subdatasets<jupyter_output><empty_output><jupyter_text>A subdataset can be directly be opened by [xsar.open_dataset](../basic_api.rstxsar.open_dataset)<jupyter_code>wv_slc_ds1 = xr.open_dataset(wv_slc_meta.subdatasets[0])
wv_slc_ds1<jupyter_output><empty_output><jupyter_text>Or we can get a **single dataset** by using [xsar.SentinelMeta](../basic_api.rstxsar.SentinelMeta)<jupyter_code>wv_slc_meta1 = xsar.Sentinel1Meta(wv_slc_meta.subdatasets[0])
wv_slc_meta1<jupyter_output><empty_output><jupyter_text>And use this `wv_slc_meta1` object with [xsar.open_dataset](../basic_api.rstxsar.open_dataset)<jupyter_code>wv_slc_ds1 = xr.open_dataset(wv_slc_meta1)<jupyter_output><empty_output><jupyter_text>Getting all xsar.Sentinel1Meta  objects from a list of path[xsar.Sentinel1Meta](../basic_api.rstxsar.SentinelMeta) can only handle one path at a time.With [xsar.product_info](../basic_api.rstxsar.product_info), you can provide a list of path, and get a `pandas.DataFrame` with all `meta` objects.<jupyter_code>df_info = xsar.product_info([
    xsar.get_test_file('S1A_WV_SLC__1SSV_20160510T101603_20160510T102143_011195_010EA1_Z010.SAFE'),
    xsar.get_test_file('S1A_IW_SLC__1SDV_20170907T102951_20170907T103021_018268_01EB76_Z010.SAFE')
])
df_info<jupyter_output><empty_output><jupyter_text>By default,  [xsar.product_info](../basic_api.rstxsar.product_info) only return a minimal set of columns.Columns list can be given by the `columns=` keyword. Columns name can be any attributes from [xsar.Sentinel1Meta](../basic_api.rstxsar.SentinelMeta), with the addition of the 'meta' column name, who refer to the [xsar.Sentinel1Meta](../basic_api.rstxsar.SentinelMeta) objet itself.If the columns list include 'geometry', the result will by a `geopandas.GeoDataframe`, who can be displayed whith holoviews.<jupyter_code>gdf_info = xsar.product_info(
    [
        xsar.get_test_file('S1A_WV_SLC__1SSV_20160510T101603_20160510T102143_011195_010EA1_Z010.SAFE'),
        xsar.get_test_file('S1A_IW_SLC__1SDV_20170907T102951_20170907T103021_018268_01EB76_Z010.SAFE')
        
    ],
    columns=[ 'safe', 'dsid', 'meta', 'geometry' ]
)

# 'meta' column is dropped for display
gv.feature.land * gv.Polygons(gdf_info.drop(['meta'], axis=1)).opts(tools=['hover'])

gdf_info.iloc[0]['meta']<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10293288212069938, 'fraction_numerical': 0.0781161872532431, 'mean_word_length': 7.736453201970443, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '80824', 'license': 'MIT', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1396, 'n_words': 230, 'path': 'docs/examples/xsar_multiple.ipynb', 'repo_name': 'grouny/xsar', 'size': '3546'}