GeoscienceAustralia / agdc

Repository for Australian Geoscience Data Cube (AGDC) code
BSD 3-Clause "New" or "Revised" License
29 stars 24 forks source link

Enhance the query API to support excluding datasets for a particular satellite based on their acquisition date #56

Closed simonoldfield closed 9 years ago

simonoldfield commented 9 years ago

For example, to be able to exclude LS7 SLC OFF datasets or LS8 PRE WRS 2 datasets.

simonoldfield commented 9 years ago

Implemented in 0.1.0 snapshot.

Can now specify an exclude parameter to the list_cells and list_tiles functions.

There is currently a SatelliteDateExclusion which allows datasets from a date range (which can be open ended) to be excluded for a particular satellite.

For example...

    exclude=SatelliteDateExclusion(satellite=Satellite.LS7,
                                   acq_min=date(2014,1,1),
                                   acq_max=None)

    cells = list_cells_as_list(x=[120], y=[-25],
                               acq_min=parse_date_min("2010"),
                               acq_max=parse_date_max("2015"),
                               satellites=[Satellite.LS5, Satellite.LS7, Satellite.LS8],
                               dataset_types=[DatasetType.ARG25],
                               exclude=[exclude],
                               config=config)

I have also added specified exclusion constants for LS7 SLC OFF and LS8 PRE WRS 2 datasets so you can do, for example, exclude=[LS7_SLC_OFF_EXCLUSION] or exclude=[LS8_PRE_WRS_2_EXCLUSION].