When exporting a GeoTIFF product via gpt command line tool or the snap UI, the product may contain multiple bands. In my case there are bands from sentinel-1 polarisations(VV, VH), localIncidenceAngle, and indicendceAngleFromEllipsoid. My goal is to be able to identify which band is which in the final TIFF metadata. Is it possible to somehow tag or derive which band is asociated with each band number in the final TIFF without using the SNAP UI? I am going to be reading the bands using rasterio so I will need the tags/metadata to be in the standard TIFF metadata format.
TIFF support for metadata is weak. A useful resource is Australia’s Frequently Used Code.
They give examples reading GeoTIFF and NetCDF files with rasterio. For GeoTIFF, they rename the numbered bands. BEAM GeoTIFF uses some “custom” tags to add extra metadata, but I don’t think those are supported by 3rd party applications. Consider using NetCDF4-CF.
Thanks a lot for the insights! Yeah it appears that GeoTIFF does not have much for identifying these the bands. I will definitely take your advice and look into NetCDF4-CF, its popped up in a few of my searches now as well.
I also faced the same issue today, since I wanted to extract the band names which aren’t visible with GDAL. I was able to get all the metadata with tiffinfo on Ubuntu. You have to install it first:
sudo apt-get install libtiff-tools
and then:
tiffinfo S1_phase_coh_20240809_20240821.tif | grep BAND_NAME
TIFFReadDirectory: Warning, Unknown field with tag 34264 (0x85d8) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 34735 (0x87af) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 34737 (0x87b1) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 65000 (0xfde8) encountered.
TIFFReadDirectory: Warning, Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples..
<BAND_NAME>Phase_ifg_IW2_VV_09Aug2024_21Aug2024</BAND_NAME>
<BAND_NAME>coh_IW2_VV_09Aug2024_21Aug2024</BAND_NAME>```