[ncl-talk] reading PRISM .bil files?

Rick Brownrigg brownrig at ucar.edu
Fri Oct 17 11:08:19 MDT 2014


Hi Daniel

"Band-Interleaved Format"  My understanding of the format is that the .bil
file itself is just a "brick of floats" (or integers, bytes, etc.) that is
MxNxP, where P is the number of bands that make up this image. It is
organized as all of the floats (ints) of the first row for band-1, followed
by the floats for first row's 2nd ban, ..., the floats of first row's Pth
band, then likewise for subsequent rows, ...

In your example, there's only 1 band. We see that it is 621x1405, comprised
of 32-bit floats. Hence the first row is 5620 bytes in length:  1405 *
sizeof(float) = 1405 * 4 = 5620.  This should be relatively straightforward
to read:

http://ncl.ucar.edu/Applications/r-binary.shtml

Its not clear to me from the header whether the first row is the
bottom/southern-most, or the top/northern-most.

Does that help?
Rick


On Fri, Oct 17, 2014 at 10:37 AM, Daniel Barandiaran <dbarandiaran at gmail.com
> wrote:

> Has anyone dealt with these files?  I've done some work with binary files
> before, but I am no pro by any means.  I've read a little about the data
> format of these .bil files, but I'm still not sure about exactly how these
> files are formatted.  They have a file header, which contains the following:
>
> BYTEORDER      I
> LAYOUT         BIL
> NROWS          621
> NCOLS          1405
> NBANDS         1
> NBITS          32
> BANDROWBYTES   5620
> TOTALROWBYTES  5620
> PIXELTYPE      FLOAT
> ULXMAP         -125
> ULYMAP         49.9166666666687
> XDIM           0.04166666666667
> YDIM           0.04166666666667
> NODATA         -9999
>
> any help would be appreciated!
>
> --
> Danny Barandiaran
> Department of Plants, Soils, and Climate
> Utah State University
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141017/0176a55d/attachment.html 


More information about the ncl-talk mailing list