Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip]: Helper to create a collection from a summary object. #176

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TomAugspurger
Copy link
Contributor

@TomAugspurger TomAugspurger commented Apr 14, 2023

Description

Adds a new method for turning an ObjectSummary, from analyzing a batch of STAC items, into (the start of) a STAC collection.

    percentages = {
        "s3:coastalPixels_percentage",
        "s3:salineWaterPixels_percentage",
        "s3:cosmeticPixels_percentage",
        "s3:dubiousSamples_percentage",
        "s3:freshInlandWaterPixels_percentage",
        "s3:invalidPixels_percentage",
        "s3:landPixels_percentage",
        "s3:duplicatedPixels_percentage",
        "s3:tidalRegionPixels_percentage",
        "s3:saturatedPixels_percentage",
        "sat:absolute_orbit",
        "sat:relative_orbit",
        "eo:cloud_cover",
    }
    result = make_collection(
        s3_frp_summary,
        "id",
        title="Sentinel 3",
        extra_fields={
            "msft:region": "westeurope",
        },
        extra_summary_exclude={
            "s3:shape",
            "s3:gsd",
            "s3:productType",
            "sat:orbit_state",
            "s3:mode",
            "providers",
        }
        | percentages,
        item_assets_exclude="resolution",
    )

Which gives

{'stac_version': '1.0.0',
 'id': 'id',
 'type': 'Collection',
 'description': '{{ collection.description }}',
 'links': [],
 'keywords': [],
 'stac_extensions': [],
 'summaries': {'sat:platform_international_designator': ['2016-011A',
   '2018-039A'],
  'instruments': [['OLCI']],
  'platform': ['Sentinel-3A', 'Sentinel-3B'],
  'constellation': ['Sentinel-3']},
 'item_assets': {'safe-manifest': {'type': 'application/xml',
   'roles': ['metadata']},
  'ogvi': {'type': 'application/x-netcdf',
   'description': 'OLCI global Vegetal Index',
   'roles': ['data'],
   'eo:bands': [{'name': 'Oa03',
     'description': 'Band 3 - Chlorophyll absorption maximum, biogeochemistry, vegetation',
     'center_wavelength': 442.5,
     'band_width': 10},
    {'name': 'Oa10',
     'description': 'Band 10 - Chlorophyll fluorescence peak, red edge',
     'center_wavelength': 681.25,
     'band_width': 7.5},
    {'name': 'Oa17',
     'description': 'Band 17 - Atmospheric / aerosol correction, clouds, pixel co-registration',
     'center_wavelength': 865,
     'band_width': 20}]},
  'otci': {'type': 'application/x-netcdf',
   'description': 'OLCI Terrestrial Chlorophyll Index',
   'roles': ['data'],
   'eo:bands': [{'name': 'Oa10',
     'description': 'Band 10 - Chlorophyll fluorescence peak, red edge',
     'center_wavelength': 681.25,
     'band_width': 7.5},
    {'name': 'Oa11',
     'description': 'Band 11 - Chlorophyll fluorescence baseline, red edge transition',
     'center_wavelength': 708.75,
     'band_width': 10},
    {'name': 'Oa12',
     'description': 'Band 12 - O2 absorption / clouds, vegetation',
     'center_wavelength': 753.75,
     'band_width': 7.5}]},
  'iwv': {'type': 'application/x-netcdf',
   'description': 'Integrated water vapour column',
   'roles': ['data'],
   'eo:bands': [{'name': 'Oa18',
     'description': 'Band 18 - Water vapour absorption reference. Common reference band with SLSTR. Vegetation monitoring',
     'center_wavelength': 885,
     'band_width': 10},
    {'name': 'Oa19',
     'description': 'Band 19 - Water vapour absorption, vegetation monitoring (maximum REFLECTANCE)',
     'center_wavelength': 900,
     'band_width': 10}]},
  'rcOgvi': {'type': 'application/x-netcdf',
   'description': 'Rectified Reflectance',
   'roles': ['data'],
   'eo:bands': [{'name': 'Oa10',
     'description': 'Band 10 - Chlorophyll fluorescence peak, red edge',
     'center_wavelength': 681.25,
     'band_width': 7.5},
    {'name': 'Oa17',
     'description': 'Band 17 - Atmospheric / aerosol correction, clouds, pixel co-registration',
     'center_wavelength': 865,
     'band_width': 20}]},
  'lqsf': {'type': 'application/x-netcdf',
   'description': 'Land Quality and Science Flags',
   'roles': ['data']},
  'timeCoordinates': {'type': 'application/x-netcdf',
   'description': 'Time Coordinates Annotations',
   'roles': ['data']},
  'geoCoordinates': {'type': 'application/x-netcdf',
   'description': 'Geo Coordinates Annotations',
   'roles': ['data']},
  'tieGeoCoordinates': {'type': 'application/x-netcdf',
   'description': 'Tie-Point Geo Coordinate Annotations',
   'roles': ['data']},
  'tieGeometries': {'type': 'application/x-netcdf',
   'description': 'Tie-Point Geometries Annotations',
   'roles': ['data']},
  'tieMeteo': {'type': 'application/x-netcdf',
   'description': 'Tie-Point Meteo Annotations',
   'roles': ['data']},
  'instrumentData': {'type': 'application/x-netcdf',
   'description': 'Instrument Annotation',
   'roles': ['data']},
  'gifapar': {'type': 'application/x-netcdf',
   'description': 'Green Instantaneous FAPAR',
   'roles': ['data'],
   'eo:bands': [{'name': 'Oa03',
     'description': 'Band 3 - Chlorophyll absorption maximum, biogeochemistry, vegetation',
     'center_wavelength': 442.5,
     'band_width': 10},
    {'name': 'Oa10',
     'description': 'Band 10 - Chlorophyll fluorescence peak, red edge',
     'center_wavelength': 681.25,
     'band_width': 7.5},
    {'name': 'Oa17',
     'description': 'Band 17 - Atmospheric / aerosol correction, clouds, pixel co-registration',
     'center_wavelength': 865,
     'band_width': 20}]},
  'rcGifapar': {'type': 'application/x-netcdf',
   'description': 'Rectified Reflectance',
   'roles': ['data']}},
 'title': 'Sentinel 3',
 'msft:region': 'westeurope'}

@TomAugspurger TomAugspurger marked this pull request as draft April 14, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant