[gdal-dev] Extracting a band with gdalmdimtranslate

J. Antonio Guzmán Q. antguz06 at gmail.com
Fri Aug 7 14:43:53 PDT 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200807/ca212472/attachment.html>


More information about the gdal-dev mailing list