<div dir="ltr"><div>Hi Michael,</div><div><br></div><div>It appears that that file is in big-endian order. Try adding:</div><div><br></div><div>setfileoption("bin","ReadByteOrder","BigEndian")</div><div><br></div><div>before the cbinread()</div><div><br></div><div><br></div><div>Hope that helps...</div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 15, 2019 at 10:46 AM Michael Notaro via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-2013451011506204532divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px">I am now trying to read the CONUS-Soil dataset for bulk density. I tried the following</p>
<p style="margin-top:0px;margin-bottom:0px">but ended up with values of around 320 rather then the expect values around 1.5.</p>
<p style="margin-top:0px;margin-bottom:0px">What might I be missing here?</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"></p>
<div style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">
dims = (/ 11, 2984, 6936 /)</div>
<div style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">
codes = cbinread ("bd.bsq", dims, "ushort")</div>
<div style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">
soil=int2flt(ushorttoint(codes))</div>
<div style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">
soil=soil(:,::-1,:)/100.</div>
<br>
<p></p>
<p style="margin-top:0px;margin-bottom:0px">Data description</p>
<p style="margin-top:0px;margin-bottom:0px"><a href="http://www.soilinfo.psu.edu/index.cgi?soil_data&conus&data_cov&bd&datasets&geo" class="gmail-m_-2013451011506204532OWAAutoLink" id="gmail-m_-2013451011506204532LPlnk16188" target="_blank">http://www.soilinfo.psu.edu/index.cgi?soil_data&conus&data_cov&bd&datasets&geo</a><br>
<span style="font-family:ARIAL,HELVETICA">The 30-arcsec gridded data are also available as a three-dimensional array of
<span style="background-color:rgb(255,255,0)">16-bit unsigned binary integers</span>, where each integer value represents the bulk density
<span style="background-color:rgb(255,255,0)">multiplied by 100</span>. The data are organized as eleven two-dimensional layers, giving, respectively, mean BD for each of the 11 standard soil layers. Within each layer, the values are arranged by horizontal
rows. All values for the first layer are given first, starting with the value for the left (western) end of the top (northern-most) row, and continuing left to right along the row. The data for the last row of the first layer are then followed by the top row
of the second layer, and so on. </span><span style="font-family:ARIAL,HELVETICA;font-size:12pt">The array contains 11 layers each containing 2984 rows of 6936 values.</span><span style="font-family:ARIAL,HELVETICA"><br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span style="font-family:ARIAL,HELVETICA;font-size:12pt"><br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span style="font-family:ARIAL,HELVETICA;font-size:12pt">Map of bulk density</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span style="font-family:ARIAL,HELVETICA;font-size:12pt"><a href="http://www.soilinfo.psu.edu/index.cgi?soil_data&conus&data_cov&bd&image" class="gmail-m_-2013451011506204532OWAAutoLink" id="gmail-m_-2013451011506204532LPlnk13307" target="_blank">http://www.soilinfo.psu.edu/index.cgi?soil_data&conus&data_cov&bd&image</a><br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span style="font-family:ARIAL,HELVETICA;font-size:12pt"><br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"></p>
<div>Thanks, Michael</div>
<div></div>
<div><br>
</div>
<br>
<p></p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<div id="gmail-m_-2013451011506204532Signature">
<div id="gmail-m_-2013451011506204532divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
Michael Notaro<br>
<div>Associate Director<br>
</div>
<div>Nelson Institute Center for Climatic Research<br>
</div>
<div>University of Wisconsin-Madison<br>
</div>
<div>Phone: (608) 261-1503<br>
</div>
<div>Email: <a href="mailto:mnotaro@wisc.edu" target="_blank">mnotaro@wisc.edu</a><br>
</div>
</div>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-2013451011506204532divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>><br>
<b>Sent:</b> Tuesday, July 9, 2019 12:05 PM<br>
<b>To:</b> Michael Notaro<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] CONUS-SOIL</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>The BSQ binary file is a flat binary 3-D array of unsigned bytes. This is the simplest way to read in NCL. I think I got the correct dimension order, but please verify it.</div>
<div><br>
</div>
<div> dims = (/ 11, 2984, 6936 /)</div>
<div> codes = cbinread ("layertext.bsq", dims, "ubyte")</div>
<div><br>
</div>
<br>
<div class="gmail-m_-2013451011506204532x_gmail_quote">
<div dir="ltr" class="gmail-m_-2013451011506204532x_gmail_attr">On Tue, Jul 9, 2019 at 10:15 AM Michael Notaro via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" id="gmail-m_-2013451011506204532LPlnk898084" class="gmail-m_-2013451011506204532OWAAutoLink" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br>
</div>
<blockquote class="gmail-m_-2013451011506204532x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-2013451011506204532x_gmail-m_-1273417200183080321divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0px;margin-bottom:0px">Does anyone have a recommendation of the best way in NCL to read in the CONUS-SOIL dataset</p>
<p style="margin-top:0px;margin-bottom:0px">for soil texture types at 11 soil levels? It's available in band-sequential binary format or</p>
<p style="margin-top:0px;margin-bottom:0px">Arc/Info grid format or Arc/Info polygon format.</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><a href="http://www.soilinfo.psu.edu/index.cgi?soil_data&conus&data_cov&texture&datasets&geo" class="gmail-m_-2013451011506204532x_gmail-m_-1273417200183080321OWAAutoLink gmail-m_-2013451011506204532OWAAutoLink" id="gmail-m_-2013451011506204532LPlnk663053" target="_blank">http://www.soilinfo.psu.edu/index.cgi?soil_data&conus&data_cov&texture&datasets&geo</a><br>
<br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Thanks, Michael</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<div id="gmail-m_-2013451011506204532x_gmail-m_-1273417200183080321Signature">
<div id="gmail-m_-2013451011506204532x_gmail-m_-1273417200183080321divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
Michael Notaro<br>
<div>Associate Director<br>
</div>
<div>Nelson Institute Center for Climatic Research<br>
</div>
<div>University of Wisconsin-Madison<br>
</div>
<div>Phone: (608) 261-1503<br>
</div>
<div>Email: <a href="mailto:mnotaro@wisc.edu" id="gmail-m_-2013451011506204532LPlnk111981" class="gmail-m_-2013451011506204532OWAAutoLink" target="_blank">
mnotaro@wisc.edu</a></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>