ruithnadsteud / yt_georaster

A package for handling geotiff files and georeferenced datasets within yt.
1 stars 2 forks source link

Support loading multiple images with same bands #41

Closed brittonsmith closed 3 years ago

brittonsmith commented 3 years ago

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:

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:

Band fields will then be, for example:

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.