ruithnadsteud / yt_georaster

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

Options for save_as_geotiff and field map changes #57

Closed deastwoo closed 2 years ago

deastwoo commented 2 years ago

I've made changes to save_as_geotiff to allow the specification of output dtype and nodata value through key word arguments. If no dtype is provided the function outputs the data in the dtype of the primary input raster rather than always float64. Similarly the nodata value defaults to that of the primary input raster. Previously nodata was always given the value None. I also looked at allowing the specification of CRS but this appears to be a bit more complex so I have left this for the moment. Maybe something to discuss?

I have also made changes to how the field map yaml file is handled. It should now work as intended, even if the files have been moved from their original location. The field name and type should now be consistent before and after the process of saving and then loading a dataset. I believe this resolves issue #53 .

There have been further changes to the field naming process in image_types.py so that we can now handle either the full or shortened sentinel 2 jp2 file names. The previous work around was more elegant however I discovered that for the full-length file names, we were using the processing datetime in the field type name rather than the acquisition datetime. This is now fixed however field type names are now different depending on the input file. I have made changes to the tests and test data file names to reflect these changes and circleci appears to be happy! 🎉