<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div><div><div>Thanks, Dave! I’m up and running again. </div><div><br></div><div>Cheers,</div><div>Greg</div><div><div id="MAC_OUTLOOK_SIGNATURE"></div></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov">dave.allured@noaa.gov</a>><br><span style="font-weight:bold">Date: </span> Monday, June 26, 2017 at 5:49 PM<br><span style="font-weight:bold">To: </span> Greg Deemer <<a href="mailto:greg.deemer@nsidc.org">greg.deemer@nsidc.org</a>><br><span style="font-weight:bold">Cc: </span> <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>>, Gregory Deemer <<a href="mailto:gregory.j.deemer@gmail.com">gregory.j.deemer@gmail.com</a>><br><span style="font-weight:bold">Subject: </span> Re: [ncl-talk] Skip Over Header in Binary File<br></div><div><br></div><span style="mso-bookmark:_MailOriginalBody"><div dir="ltr">Greg,<br><br>Read the entire file as flat binary. Set the second argument to -1 to indicate unknown dimensions; this will read the whole file. Set the third argument to "byte" or "ubyte" to match the intended signedness of the data.<br><br> x = cbinread ("file.bin", -1 ,"byte")<br><br>Then remove the header bytes using a subscript range expression. Remember, NCL subscripting is zero-based:<br><br> x2 = x(300:)<br><br>I would use dimsizes to confirm that the result has the expected number of bytes. Then use function onedtond to reshape the x2 array from 1-D to 2-D.<br><br>--Dave<div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 26, 2017 at 5:33 PM, Greg Deemer <span dir="ltr"><<a href="mailto:greg.deemer@nsidc.org" target="_blank">greg.deemer@nsidc.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">Hello, and thank you for addressing my question.</div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">I’m wanting to read some data stored in an unsigned flat binary one-byte integer format. As such, the endianness is thankfully irrelevant. I know the data array will have a shape (/448, 304/), but it is stored after a header that is 300 bytes long. After reading through the binary guidance and hints (<a href="https://www.ncl.ucar.edu/Applications/r-binary.shtml" target="_blank">https://www.ncl.ucar.edu/Appl<wbr>ications/r-binary.shtml</a>), I’ve been unsuccessful in getting started. For some other languages I’ve used, there is a ‘skip bytes’ flag that can be added to read functions to make this process a bit simpler. I thought that was where the “rec_num” came in for fbindirread, fbinrecread, and craybinrecread. I.e. rec_num = 299 would then allow the function to start reading at location 300, byte 301? </div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">The data file I’m trying to read is attached to this message. If the attachment is blocked, you can download direct from this HTTPS site (but will need a public NASA Earthdata Login Profile setup to do so): <a href="https://daacdata.apps.nsidc.org/pub/DATASETS/nsidc0051_gsfc_nasateam_seaice/final-gsfc/north/daily/2006/nt_20060101_f13_v1.1_n.bin" target="_blank">https://daacdata.apps.nsidc.or<wbr>g/pub/DATASETS/nsidc0051_gsfc_<wbr>nasateam_seaice/final-gsfc/<wbr>north/daily/2006/nt_20060101_<wbr>f13_v1.1_n.bin</a></div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">Any help in learning how to skip over some bytes would be great!</div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">Thanks,</div><span class="m_-2357316367019708485gmail-HOEnZb"><div id="m_-2357316367019708485gmail-m_613806173385732020MAC_OUTLOOK_SIGNATURE"><font color="#888888"><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><div><br></div></div></font>Greg Deemer</div></span></div></blockquote></div></div></div></span></span></body></html>