Scaling of Cloud Top Temperature product of MODIS L3
-
- Posts: 3
- Joined: Sat Aug 17, 2024 3:03 am America/New_York
Scaling of Cloud Top Temperature product of MODIS L3
I am using daily L3 products (for example MYD08_D3.A2003039.061.2018005124705.hdf)
I open the attributes of CTT variable (Cloud_Top_Temperature_Mean.attrs), and what I get is:
{'valid_range': array([ 0, 20000], dtype=int16),
'long_name': 'Cloud Top Temperature: Mean',
'units': 'Degrees Kelvin',
'Level_2_Pixel_Values_Read_As': 'Real',
'Derived_From_Level_2_Data_Set': 'Cloud_Top_Temperature',
'Included_Level_2_Nighttime_Data': 'True',
'Quality_Assurance_Data_Set': 'None',
'Statistic_Type': 'Simple',
'Aggregation_Data_Set': 'None'}
However, neither scale_factor nor add_offset values appear on the list, so how do I compute the actual value in K?
I open the attributes of CTT variable (Cloud_Top_Temperature_Mean.attrs), and what I get is:
{'valid_range': array([ 0, 20000], dtype=int16),
'long_name': 'Cloud Top Temperature: Mean',
'units': 'Degrees Kelvin',
'Level_2_Pixel_Values_Read_As': 'Real',
'Derived_From_Level_2_Data_Set': 'Cloud_Top_Temperature',
'Included_Level_2_Nighttime_Data': 'True',
'Quality_Assurance_Data_Set': 'None',
'Statistic_Type': 'Simple',
'Aggregation_Data_Set': 'None'}
However, neither scale_factor nor add_offset values appear on the list, so how do I compute the actual value in K?
Filters:
-
- Posts: 377
- Joined: Mon Sep 30, 2019 8:33 am America/New_York
- Has thanked: 3 times
Re: Scaling of Cloud Top Temperature product of MODIS L3
Following information is provided in the HDF file metadata:
MYD08_D3.A2003039.061.2018005124705.hdf
Cloud_Top_Temperature_Mean (720, 288)
16-bit integer, 180 x 360
Number of attributes = 12
valid_range = 0,20000
_FillValue = -9999
long_name = Cloud Top Temperature: Mean
units = Degrees Kelvin
scale_factor = 0.009999999776482582
add_offset = -15000.0
Level_2_Pixel_Values_Read_As = Real
Derived_From_Level_2_Data_Set = Cloud_Top_Temperature
Included_Level_2_Nighttime_Data = True
Quality_Assurance_Data_Set = None
Statistic_Type = Simple
Aggregation_Data_Set = None
MYD08_D3.A2003039.061.2018005124705.hdf
Cloud_Top_Temperature_Mean (720, 288)
16-bit integer, 180 x 360
Number of attributes = 12
valid_range = 0,20000
_FillValue = -9999
long_name = Cloud Top Temperature: Mean
units = Degrees Kelvin
scale_factor = 0.009999999776482582
add_offset = -15000.0
Level_2_Pixel_Values_Read_As = Real
Derived_From_Level_2_Data_Set = Cloud_Top_Temperature
Included_Level_2_Nighttime_Data = True
Quality_Assurance_Data_Set = None
Statistic_Type = Simple
Aggregation_Data_Set = None
Regards,
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.
-
- Posts: 3
- Joined: Sat Aug 17, 2024 3:03 am America/New_York
Re: Scaling of Cloud Top Temperature product of MODIS L3
I still have an issue: a global snapshot of the stored CTT ranges between 14960 and 14840.
scale_factor = 0.009999999776482582
add_offset = -15000.0
I use the conversion equation: CTT_actual = scale_factor * ( CTT_stored - add_offset )
now CTT ranges between 0.4 and 1.6 but with units in K this is cannot be right: CTT 's order of magnitude should be ~200 to ~300 K.
I cannot find the error in my calculation.
Looking forward to your reply. Thanks
scale_factor = 0.009999999776482582
add_offset = -15000.0
I use the conversion equation: CTT_actual = scale_factor * ( CTT_stored - add_offset )
now CTT ranges between 0.4 and 1.6 but with units in K this is cannot be right: CTT 's order of magnitude should be ~200 to ~300 K.
I cannot find the error in my calculation.
Looking forward to your reply. Thanks
-
- Posts: 377
- Joined: Mon Sep 30, 2019 8:33 am America/New_York
- Has thanked: 3 times
Re: Scaling of Cloud Top Temperature product of MODIS L3
see:
For stored value = 14840
CTT_actual =0.01*(14840-(-15000)) = 298.4
For stored value = 14960
CTT_actual =0.01*(14960-(-15000)) = 299.6
For stored value = 14840
CTT_actual =0.01*(14840-(-15000)) = 298.4
For stored value = 14960
CTT_actual =0.01*(14960-(-15000)) = 299.6
Regards,
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.
-
- Posts: 3
- Joined: Sat Aug 17, 2024 3:03 am America/New_York
Re: Scaling of Cloud Top Temperature product of MODIS L3
Several things:
1) stored CTT ranging between 14960 and 14840 would yield actual CTT ranging 298.4 to 299.6 K. That is less than 2K variability (in a given day) for the entire globe... The example of page 30 in the document "MODISCloudOpticalPropertyUserGuideFinal_v1.1_1.pdf" shows CTT ranging from 220 to 300 K for a subdomain between ~35S and ~50S in the eastern Pacific.
Therefore the scale factor cannot be ~0.01, it should be ~1 (14960 -14840 = 120K)
2) In my previous post I incorrectly reported 14840 and 14960 as the extreme values. Actually I didn't see the minus sign in the colorbar of my plot. Stored CTT ranges between -14960 and -14840. Therefore, both offset and scale factor have to be wrong.
3) I checked files from different years (e.g: MYD08_D3.A2003039.061.2018005124705.hdf, MYD08_D3.A2007365.061.2018045221812.hdf), and different variables (e.g: Cloud_Top_Temperature_Mean, Cloud_Top_Temperature_Day_Mean), but always the same pattern.
4) attributes of stored CTT: "valid_range is [0 20000]", but stored CTT values are negative ??
Really looking forward to the solution of this issue.
-----
By the way: I found this related post for L2 data
viewtopic.php?t=4698
In that case, if stored CTT is 6942, then actual CTT is 219.4K
that stored CTT is in the range: 0, 20000.
I suspect that for L3 product the metadata is wrong, or there is a mismatch between stored data and metadata....
1) stored CTT ranging between 14960 and 14840 would yield actual CTT ranging 298.4 to 299.6 K. That is less than 2K variability (in a given day) for the entire globe... The example of page 30 in the document "MODISCloudOpticalPropertyUserGuideFinal_v1.1_1.pdf" shows CTT ranging from 220 to 300 K for a subdomain between ~35S and ~50S in the eastern Pacific.
Therefore the scale factor cannot be ~0.01, it should be ~1 (14960 -14840 = 120K)
2) In my previous post I incorrectly reported 14840 and 14960 as the extreme values. Actually I didn't see the minus sign in the colorbar of my plot. Stored CTT ranges between -14960 and -14840. Therefore, both offset and scale factor have to be wrong.
3) I checked files from different years (e.g: MYD08_D3.A2003039.061.2018005124705.hdf, MYD08_D3.A2007365.061.2018045221812.hdf), and different variables (e.g: Cloud_Top_Temperature_Mean, Cloud_Top_Temperature_Day_Mean), but always the same pattern.
4) attributes of stored CTT: "valid_range is [0 20000]", but stored CTT values are negative ??
Really looking forward to the solution of this issue.
-----
By the way: I found this related post for L2 data
viewtopic.php?t=4698
In that case, if stored CTT is 6942, then actual CTT is 219.4K
that stored CTT is in the range: 0, 20000.
I suspect that for L3 product the metadata is wrong, or there is a mismatch between stored data and metadata....
Last edited by j.blanco_07 on Tue Aug 27, 2024 3:03 am America/New_York, edited 1 time in total.
-
- Posts: 3
- Joined: Sat Aug 17, 2024 3:03 am America/New_York
Re: Scaling of Cloud Top Temperature product of MODIS L3
also checked there is no report regarding this issue at daily L3 data issues webpage: https://atmosphere-imager.gsfc.nasa.gov/issues/daily
Last edited by j.blanco_07 on Tue Aug 27, 2024 3:17 am America/New_York, edited 2 times in total.
-
- Posts: 377
- Joined: Mon Sep 30, 2019 8:33 am America/New_York
- Has thanked: 3 times
Re: Scaling of Cloud Top Temperature product of MODIS L3
There are no negative CTT values for either of the files you mentioned (see attached).
Both offset and scale factor are correct as provided.
Both offset and scale factor are correct as provided.
- Attachments
-
- screenshot-MYD08_D3_2007365.png (437.04 KiB) Not viewed yet
-
- screenshot-MYD08_D3_2003039.png (451.04 KiB) Not viewed yet
Regards,
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.
-
- Posts: 3
- Joined: Sat Aug 17, 2024 3:03 am America/New_York
Re: Scaling of Cloud Top Temperature product of MODIS L3
Your help was crucial to find the problem.
The issue was the way I was opening the data: using python, I was treating the files as if they were netcdf, opening them with xarray.open_mfdataset
However, for HDF files, this should not be done, I came to learn. I adapted a script that I found in another forum (https://github.com/pydata/xarray/discussions/6299) and this time the data loaded was just like in your photos above.
Interestingly, I noticed that from both ways of reading the data I was obtaining the same plot , except for changes in the scale (and by setting a different offset value if I used xarray.open_mfdataset, I could get the same plot and same scale)
Thank you !
The issue was the way I was opening the data: using python, I was treating the files as if they were netcdf, opening them with xarray.open_mfdataset
However, for HDF files, this should not be done, I came to learn. I adapted a script that I found in another forum (https://github.com/pydata/xarray/discussions/6299) and this time the data loaded was just like in your photos above.
Interestingly, I noticed that from both ways of reading the data I was obtaining the same plot , except for changes in the scale (and by setting a different offset value if I used xarray.open_mfdataset, I could get the same plot and same scale)
Thank you !
-
- Posts: 377
- Joined: Mon Sep 30, 2019 8:33 am America/New_York
- Has thanked: 3 times
Re: Scaling of Cloud Top Temperature product of MODIS L3
Glad that you found the solution and the issue is resolved.
Regards,
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.
LAADS User Services
To receive news from LAADS DAAC direct to your inbox, email laadsdaac-join@lists.nasa.gov with “subscribe” in the subject line.