[ncl-talk] Skip Over Header in Binary File
Greg Deemer
greg.deemer at nsidc.org
Mon Jun 26 17:33:07 MDT 2017
Hello, and thank you for addressing my question.
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 (https://www.ncl.ucar.edu/Applications/r-binary.shtml), 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?
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): https://daacdata.apps.nsidc.org/pub/DATASETS/nsidc0051_gsfc_nasateam_seaice/final-gsfc/north/daily/2006/nt_20060101_f13_v1.1_n.bin
Any help in learning how to skip over some bytes would be great!
Thanks,
--
Greg Deemer
User Services Office
National Snow and Ice Data Center
(303) 735-8068
http://nsidc.org
Twitter: @NSIDC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170626/9964bf12/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nt_20060101_f13_v1.1_n.bin.zip
Type: application/zip
Size: 23800 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170626/9964bf12/attachment.zip
More information about the ncl-talk
mailing list