Hi everybody,
I am working with some MODIS level-2 data (MOD06_L2.A2021272.1640.061.2021274182421.hdf) and I am trying to export some of the datasets as geoTIFFs using the following code:
============================
# package import:
from satpy import Scene
import numpy as np
# load MODIS level 2 data:
file = ["E:/Jasper/Studium/BA_Thesis/MODIS_data/MOD06_L2.A2021299.1620.061.2021300211624.hdf"]
data = {"modis_l2": file}
modis = Scene(filenames=data)
modis.load(["cloud_effective_radius", "cloud_optical_thickness"])
modis.save_datasets(writer="geotiff",
dtype=np.float32,
datasets=["cloud_effective_radius", "cloud_optical_thickness"],
filename="{name}_georef_test.tif",
base_dir="E:/Jasper/Studium/BA_Thesis/MODIS_data/output")
============================
I am exporting them in float32 format, since the modis_l2 reader imports them this way. Plotting the data with matplotlib.pyplot shows me that the pixels values range from 0-60 for the effective radius and 0-150 for the optical thickness. This is also the valid range for those datasets according to the MODIS user guide.
After exporting the TIFFs, however, I am getting pixel values between -0.00758981 and 2.51779 for the optical thickness and similar values for the effective radius. How do I tell satpy to export the TIFFs in a way that does not change the pixel values?
Thanks in advance for any help!
Jasper