ruithnadsteud / yt_georaster

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

Reading the field_map yaml file with yt.load no longer uses the field names from the yaml file #53

Closed deastwoo closed 2 years ago

deastwoo commented 3 years ago

When you load in a dataset you have saved with save_as_geotiff and provide the yaml file it does not rename the field names with the saved names - you are stuck with band_1, band_2, etc.

I think this could be linked to the change in #41 to having the field type reflect the file name. This is just a guess but it could be because the code is expecting the field type to be the same. When the file is saved it stores the field_type as the source file name and therefore when you load the tif and the yaml, yt is looking for band ('source_file_label', 'band_1') to swap in the right label but the band is loaded as ('my_tif', 'band_1') or whatever your tif is called. So when it comes to labelling the field it isn't there and we are left with ('my_tif', 'band_1'). I'm going to look into this later.

deastwoo commented 2 years ago

57 appears to have resolved this issue.