<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large;color:#0b5394"><span style="background-color:rgb(255,255,255)"><span style=""></span></span><span style="color:rgb(0,0,0)"><font size="4"><span>Hi,</span></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><br></span></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif">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. <br></span></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><br></span></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif">Despite this, I am not totally sure about code writing or logic for this; maybe some of you can help me. <br></span></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><br></span></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif">My code is the foll<span style="background-color:rgb(255,255,255)">owing for the enclosed file below<br></span></span></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><span style="background-color:rgb(255,255,255)"><br></span></span></font></span></div><div class="gmail_default"><pre tabindex="0" class="gmail-GD15MCFCEUB" id="gmail-rstudio_console_output" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:1.2;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><span style="background-color:rgb(255,255,255)"><span class="gmail-GD15MCFCEUB" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap"><span style="font-family:monospace">gdalmdimtranslate HDF4_EOS:EOS_SWATH:MOD35_L2.A2017161.1525.061.2017315035809.hdf:mod35:Quality_Assurance example.tif -scaleaxes 'QA_Dimension:mod35(3)'</span><br><br></span></span></span></font></span></pre><pre tabindex="0" class="gmail-GD15MCFCEUB" id="gmail-rstudio_console_output" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:1.2;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><span style="background-color:rgb(255,255,255)"><span class="gmail-GD15MCFCEUB" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap">I am running this from the cmd as a test using gdal 3.1.1. I always get an <span style="font-family:monospace">ERROR 5: <br><span><span class="gmail-GD15MCFCEUB" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap">GDALDataset::GetRasterBand(-1) - Illegal band<br><span style="font-family:times new roman,serif"><br></span></span></span></span></span></span></span></font></span></pre><pre tabindex="0" class="gmail-GD15MCFCEUB" id="gmail-rstudio_console_output" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:1.2;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><span style="background-color:rgb(255,255,255)"><span class="gmail-GD15MCFCEUB" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap"><span style="font-family:monospace"><span><span class="gmail-GD15MCFCEUB" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap"><span style="font-family:times new roman,serif">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. </span><br><span style="font-family:times new roman,serif"><br></span></span></span></span></span></span></span></font></span></pre><pre tabindex="0" class="gmail-GD15MCFCEUB" id="gmail-rstudio_console_output" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:1.2;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(0,0,0)"><font size="4"><span style="font-family:times new roman,serif"><span style="background-color:rgb(255,255,255)"><span class="gmail-GD15MCFCEUB" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap"><span style="font-family:monospace"><span><span class="gmail-GD15MCFCEUB" style="outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap"><span style="font-family:times new roman,serif">I also enclosed a .txt as a results of</span> gdalinfo
MOD35_L2.A2017161.1525.061.2017315035809.hdf
<br></span></span></span></span></span></span></font></span></pre></div><div class="gmail_default" style="font-size:large"><span style="color:rgb(0,0,0)"><span style="font-family:times new roman,serif"><span style="background-color:rgb(255,255,255)">Best regards,</span></span></span>
</div><div><span style="color:rgb(0,0,0)"><br></span></div><div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default"><span style="color:rgb(0,0,0)"><a href="https://drive.google.com/file/d/1fMZrfMLl18e_D6CjJbscwhLvoFFGORJp/view?usp=sharing">https://drive.google.com/file/d/1fMZrfMLl18e_D6CjJbscwhLvoFFGORJp/view?usp=sharing</a></span></div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default"><span style="color:rgb(0,0,0)"><a href="https://drive.google.com/file/d/1f7oda-N9YT_cyf7YRw80BNQZr2O0RUMe/view?usp=sharing">https://drive.google.com/file/d/1f7oda-N9YT_cyf7YRw80BNQZr2O0RUMe/view?usp=sharing</a></span></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">_______________________<br>J. Antonio Guzmán Q., <i>M.Sc</i><br>Ph.D Candidate and Vanier Scholar</div><div dir="ltr">Earth and Atmospheric Sciences Department </div><br></div></div></div></div></div></div></div></div></div></div>