<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>You could certainly do that with the -array switch of
      <a class="moz-txt-link-freetext" href="https://gdal.org/programs/gdalmdimtranslate.html">https://gdal.org/programs/gdalmdimtranslate.html</a> using a view
      expression that does subsetting
(<a class="moz-txt-link-freetext" href="https://gdal.org/api/gdalmdarray_cpp.html#_CPPv4NK11GDALMDArray7GetViewERKNSt6stringE">https://gdal.org/api/gdalmdarray_cpp.html#_CPPv4NK11GDALMDArray7GetViewERKNSt6stringE</a>
      . similar to numpy slicing/indexing syntax)</p>
    <p>Use <a class="moz-txt-link-freetext" href="https://gdal.org/programs/gdalmdiminfo.html">https://gdal.org/programs/gdalmdiminfo.html</a> to get the path
      to the variable of interest.</p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 16/03/2022 à 15:48, inti luna a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CABZ8+BDXbt4voorFKz=Wtng0psitR=JMhcmvL5RR6Rbvh0Dp8A@mail.gmail.com">
      <div dir="ltr">
        <div>Hello,</div>
        <div>I am trying to read a subdaset from modis total
          precipitable water product(<a
href="https://ladsweb.modaps.eosdis.nasa.gov/missions-and-measurements/products/MOD05_L2"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://ladsweb.modaps.eosdis.nasa.gov/missions-and-measurements/products/MOD05_L2</a>).
          The specific subdataset is Qualiy_Assurance_NIR.</div>
        <div><br>
        </div>
        <div>Checking the file with gdalinfo provide details about
          subdatasets:</div>
        <div><br>
        </div>
        <div>For example:</div>
        <div>gdalinfo MOD05_L2.A2013152.0035.061.2017299012514.hdf</div>
        <div><br>
        </div>
        <div>Output extract:</div>
        <div>SUBDATASET_8_NAME=HDF4_EOS:EOS_SWATH:"MOD05_L2.A2013152.0035.061.2017299012514.hdf":mod05:Water_Vapor_Correction_Factors<br>
            SUBDATASET_8_DESC=[2030x1354] Water_Vapor_Correction_Factors
          mod05 (16-bit integer)<br>
           
SUBDATASET_9_NAME=HDF4_EOS:EOS_SWATH:"MOD05_L2.A2013152.0035.061.2017299012514.hdf":mod05:Water_Vapor_Infrared<br>
            SUBDATASET_9_DESC=[406x270] Water_Vapor_Infrared mod05
          (16-bit integer)<br>
           
SUBDATASET_10_NAME=HDF4_EOS:EOS_SWATH:"MOD05_L2.A2013152.0035.061.2017299012514.hdf":mod05:Quality_Assurance_Near_Infrared<br>
            SUBDATASET_10_DESC=[2030x1354x1]
          Quality_Assurance_Near_Infrared mod05 (8-bit integer)</div>
        <div>---------------------------------------<br>
        </div>
        <div>It can be seen that subdataset 8 has dimensions 2030x1354
          which is fine but subdataset 10 has dimensions 2030x1354x1
          which when using gdal translate to pass it to a geotif gives a
          raster file with 1x1354 dimensions with 2030 bands which is
          not right, it should be a file with 2030x1354. What can be
          done to correct this or to pass it to the dimensions and match
          other subdatasets.</div>
        <div>-------</div>
        <div>command used to pass it to geotif</div>
        <div>-------<br>
        </div>
        <div>gdal_translate
HDF4_EOS:EOS_SWATH:"MOD05_L2.A2013152.0035.061.2017299012514.hdf":mod05:Quality_Assurance_Near_Infrared
          b10_QA_NIR.tif</div>
        <div>------<br>
        </div>
        <div> </div>
        <div><br>
        </div>
        <div>Thank you for any guidance</div>
        <div>Ernesto<br>
        </div>
        <div>
          <div><br>
          </div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div><br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>