[gdal-dev] Extracting a band with gdalmdimtranslate

J. Antonio Guzmán Q. antguz06 at gmail.com
Sat Aug 8 16:31:17 PDT 2020


Thanks Dr. Lee for you quick response,

I runned your example. It seems that it returns an output; however the
returned .tif does not contain information. I checked the tif file that you
uploaded in [1], but this also does not contain information.

I know that the Quality_Assurance SDS contains information about spectral
tests because I can see those using HDFView 3.1.1.

Do you know what is happening here?

Thanks in advance...

El vie., 7 ago. 2020 a las 22:55, Joe Lee (<hyoklee at hdfgroup.org>) escribió:

> 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 <gdal-dev-bounces at lists.osgeo.org> * On Behalf Of *J.
> Antonio Guzmán Q.
> *Sent:* Friday, August 07, 2020 4:44 PM
> *To:* gdal-dev at lists.osgeo.org
> *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
>
>
>


-- 
_______________________
J. Antonio Guzmán Q., *M.Sc*
Ph.D Candidate and Vanier Scholar
Earth and Atmospheric Sciences Department
University of Alberta, Canada
jaguzmanq.com
Look my work in Google Scholar
<https://scholar.google.es/citations?user=Ev3ofxwAAAAJ&hl=es> and/or
ResearchGate <https://www.researchgate.net/profile/J_Antonio_Guzman_Q>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200808/5ef6710a/attachment.html>


More information about the gdal-dev mailing list