Hi,

Please try

$ gdalmdimtranslate -array "name=/swaths/mod35/Data 
Fields/Quality_Assurance,transpose=[2,1,0]" 
MOD35_L2.A2017161.1525.061.2017315035809.hdf test.tif

as shown in [1], which I updated it today for MOD35_L2.

[1] https://github.com/hdfeos/zoo/tree/master/gdal


From: gdal-dev <[email protected]> On Behalf Of J. Antonio 
Guzmán Q.
Sent: Friday, August 07, 2020 4:44 PM
To: [email protected]
Subject: [gdal-dev] Extracting a band with gdalmdimtranslate

Hi,

I am trying to extract a band (byte 3) from the Quality_Assurance SDS of MODIS 
Cloud Mask swath product (MOD35-MYD35). Overall, I can not extract a band or 
array using gdalwarp since the dimensions of the array seems to be [Along, 
Across, Bytes] [2040x1354x10] and not [Bytes, Along, Across]. Therefore, I am 
trying to use gdalmdimtranslate to first transpose the array 
(transpose=[2,0,1]) and then do the extraction as GTiff.

Despite this, I am not totally sure about code writing or logic for this; maybe 
some of you can help me.

My code is the following for the enclosed file below


gdalmdimtranslate 
HDF4_EOS:EOS_SWATH:MOD35_L2.A2017161.1525.061.2017315035809.hdf:mod35:Quality_Assurance
 example.tif -scaleaxes 'QA_Dimension:mod35(3)'

I am running this from the cmd as a test using gdal 3.1.1. I always get an 
ERROR 5:
GDALDataset::GetRasterBand(-1) - Illegal band

I also try to call the dimension in different ways out results. If you have a 
different approach to extract the Byte 3 of this SDS that is also welcome.

I also enclosed a .txt as a results of gdalinfo

MOD35_L2.A2017161.1525.061.2017315035809.hdf


Best regards,

https://drive.google.com/file/d/1fMZrfMLl18e_D6CjJbscwhLvoFFGORJp/view?usp=sharing
https://drive.google.com/file/d/1f7oda-N9YT_cyf7YRw80BNQZr2O0RUMe/view?usp=sharing

--
_______________________
J. Antonio Guzmán Q., M.Sc
Ph.D Candidate and Vanier Scholar
Earth and Atmospheric Sciences Department

_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to