Appeears - MOD11a2 - Scaling factor added to tif via tiftag?

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
pzellner
Posts: 3
Joined: Mon Feb 13, 2023 10:11 am America/New_York
Answers: 0

Appeears - MOD11a2 - Scaling factor added to tif via tiftag?

by pzellner » Mon Feb 13, 2023 11:29 am America/New_York

Is is possible that there has been a change in the Appeears API that for MOD11a2 the scaling factor of 0.2 is now added to the downloaded tifs as a tiftag? I have a pipeline using that data and since approximately 2023-01-31 the values get messed up because I am applying the scaling factor. This now also affects all dates before 2023-01-31, when downloading them now. So I suspect this is a change in some gdal related function used in Appeears.

Tags:

LP DAAC - lien
User Services
User Services
Posts: 170
Joined: Thu Jun 25, 2020 9:51 am America/New_York
Answers: 0
Been thanked: 4 times

Re: Appeears - MOD11a2 - Scaling factor added to tif via tiftag?

by LP DAAC - lien » Tue Feb 14, 2023 11:00 am America/New_York

Hi,
The output tiffs should be scaled for point data, but for area samples they are not scaled. Please let me know if you have any questions.
Thanks,
Brett

pzellner
Posts: 3
Joined: Mon Feb 13, 2023 10:11 am America/New_York
Answers: 0

Re: Appeears - MOD11a2 - Scaling factor added to tif via tiftag?

by pzellner » Wed Feb 15, 2023 3:43 am America/New_York

Dear Brett,
I downloaded one of the MOD11a2 LST files and show the output of gdalinfo on it here
```
Metadata:
add_offset=0.0
AREA_OR_POINT=Area
scale_factor=0.02
units=Kelvin
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 216830.351, 5623689.753) ( 3d 4'13.94"E, 50d34'30.00"N)
Lower Left ( 216830.351, 4763781.351) ( 2d39'34.00"E, 42d50'30.00"N)
Upper Right ( 1428856.418, 5623689.753) ( 20d14' 2.64"E, 50d34'30.00"N)
Lower Right ( 1428856.418, 4763781.351) ( 17d31'30.23"E, 42d50'30.00"N)
Center ( 822843.385, 5193735.552) ( 10d47'30.10"E, 46d42'30.00"N)
Band 1 Block=512x512 Type=UInt16, ColorInterp=Gray
NoData Value=0
Overviews: 654x464, 327x232, 164x116, 82x58
Offset: 0, Scale:0.02
```
The metadata of the tiff files has changed. Before the scaling factor was not written to the file, and the statistics were there. Now the scaling is written and the statistics are not there anymore.
This is the request ID 4b1f7681-d52f-4c6b-852a-f820cb17dc17.

LP DAAC - lien
User Services
User Services
Posts: 170
Joined: Thu Jun 25, 2020 9:51 am America/New_York
Answers: 0
Been thanked: 4 times

Re: Appeears - MOD11a2 - Scaling factor added to tif via tiftag?

by LP DAAC - lien » Fri Feb 24, 2023 1:01 pm America/New_York

Hi,
I am sorry, I am not exactly sure what the issue is, were you expecting the statistics in the tiff metadata file?
Thanks,
Brett

pzellner
Posts: 3
Joined: Mon Feb 13, 2023 10:11 am America/New_York
Answers: 0

Re: Appeears - MOD11a2 - Scaling factor added to tif via tiftag?

by pzellner » Mon Feb 27, 2023 2:17 am America/New_York

Hi Brett,
yes I was expecting the Statistics to be there, and I was not expecting the Scaling factor. That was the behavior of the API until around 2023-01-31.

LP DAAC - afriesz
Subject Matter Expert
Subject Matter Expert
Posts: 59
Joined: Tue Nov 12, 2019 4:02 pm America/New_York
Answers: 2
Been thanked: 2 times

Re: Appeears - MOD11a2 - Scaling factor added to tif via tiftag?

by LP DAAC - afriesz » Tue Feb 28, 2023 10:39 am America/New_York

@pzellner ,

You are correct. On 2023-01-23 there was an AppEEARS release that included a modification to the output Cloud Optimized GeoTIFF files that added the `Offset` and `Scale` attributes to the Band metadata. This change makes the attributes available to utilities/packages that handle applying those attributes automatically in your work environment (e.g., Python & QGIS). Those utilities/packages usually have an option to not automatically apply those attributes as well if you are wanting to 'manually' apply the scale factor and offset.

Regarding the statistics you mentioned, I'm not sure what stats you are referring to. The `gdalinfo` output diffs between files before and after the AppEEARS release show that the only differences are in the filename (because of the date differences in this case), the `LAYOUT=COG` field under Image Structure Metadata, and the `Offset` and `Scale` attributes within the Band Metadata. Could you clarify what stats you are referring to?

Post Reply