This PR is mainly to deal with Issue #29, but in the process I have introduced a new class, the GeoManager, which will make it easier to add support for data products from additional satellites. The GeoManager class is accompanied by the GeoImage class, which defines file naming conventions and band aliases. There are subclasses for Landsat-8 and Sentinel-2, and these should illustrate how one would go about adding more.
This is a major change to the field naming convention. Previous, we defined fields as:
("bands", "LS_B10")
("bands", "S2_B8a")
("band_ratios", "NDWI")
("variables", "LS_temperature")
Now, the field type (i.e., the first item in the tuple) is a string derived from the loaded filenames. For example, if we have loaded "LC08_L2SP_171060_20210227_20210304_02_T1.tif" and "T36MVE_20210315T075701.jp2", we will have two field types:
Versions of the derived fields will then be available for each field type for which the required bands are available, meaning we could have both of these:
Finally, I have changed the way field names are taken from the field map file. These are no longer done as aliases, but instead as the true name of the field, meaning that ds.field_list will show the informative names instead of just "band_1", "band_2", etc.
This PR is mainly to deal with Issue #29, but in the process I have introduced a new class, the
GeoManager
, which will make it easier to add support for data products from additional satellites. TheGeoManager
class is accompanied by theGeoImage
class, which defines file naming conventions and band aliases. There are subclasses for Landsat-8 and Sentinel-2, and these should illustrate how one would go about adding more.This is a major change to the field naming convention. Previous, we defined fields as:
("bands", "LS_B10")
("bands", "S2_B8a")
("band_ratios", "NDWI")
("variables", "LS_temperature")
Now, the field type (i.e., the first item in the tuple) is a string derived from the loaded filenames. For example, if we have loaded "LC08_L2SP_171060_20210227_20210304_02_T1.tif" and "T36MVE_20210315T075701.jp2", we will have two field types:
"LC08_L2SP_171060_20210227_20210304_02_T1
"T36MVE_20210315T075701"
Band fields will then be, for example:
("LC08_L2SP_171060_20210227_20210304_02_T1", "L8_B10")
("T36MVE_20210315T075701", "S2_B8a")
Versions of the derived fields will then be available for each field type for which the required bands are available, meaning we could have both of these:
("LC08_L2SP_171060_20210227_20210304_02_T1", "NDWI")
("T36MVE_20210315T075701", "NDWI")
Finally, I have changed the way field names are taken from the field map file. These are no longer done as aliases, but instead as the true name of the field, meaning that
ds.field_list
will show the informative names instead of just "band_1", "band_2", etc.