eomatch.datatree.BuildMUDT.read_products#
- BuildMUDT.read_products(product_item_set: scrappi.product.ProductItemSet, roi: Polygon, download: bool = True, collection_read_args: dict | None = None) list[source]#
Read each product in product_item_set, subsetting spatial (raster) products to roi.
Products are read via
eoio.read. If a product has not yet been downloaded anddownload=True, it is fetched via scrappi before reading. Each returned dataset carries a"collection"attribute set to the product’s STAC collection ID, which is used byto_datatree()to name the DataTree node.The
roi/roi_crssubset is only passed for non-in-situ (raster) products. In-situ products (e.g. RadCalNet) are a single ground site’s point measurements, not an image – they have no spatial extent to subset, and eoio’s in-situ readers validate theirsubsetdict strictly, raisingValueErrorfor keys they don’t recognise (seeeoio.readers.base.BaseReader._merge_and_validate). Passing aroi/roi_crsspatial subset to one previously failed every single in-situ read, not just an edge case.The same strict validation applies to
read_params: the resolved reader class (viaeoio.readers.factory.ReaderFactory) is passed to_resolve_read_kwargs()so genericread_params(read.defaults) get filtered to keys that reader actually supports before being passed toeoio.read()– e.g. RadCalNet’s reader has nouse_chunks/save_extractedconcept at all, so those generic defaults would otherwise fail every RadCalNet read the same way the unfilteredroisubset used to.- Parameters:
product_item_set – the set of products to read.
roi – WGS-84 polygon defining the spatial region of interest passed to
eoioas a subset for non-in-situ products.download – if
True, download missing products before reading.collection_read_args – per-collection call-time overrides (see
_resolve_read_kwargs()).
- Returns:
list of
xarray.Datasetobjects, one per product.