Bit and Byte Ordering

Previous  Next

The ordering of bits and bytes is only significant for pixel data; all other labeling information is in ASCII.

 

For non-byte data, which includes 16-bit signed shorts, 32-bit signed ints, and 32- and 64-bit IEEE floating-point numbers, the data may be stored in either Most Significant Byte first ("big-endian", as used by e.g. Sun computers and Java), or Least Significant Byte first ("little-endian", as used by e.g. Linux and Windows computers). This follows both the PDS and VICAR file format conventions.

 

For PDS, the SAMPLE_TYPE label in the IMAGE object defines which ordering is used in the file. For VICAR, the INTFMT and REALFMT labels in the System label define the ordering. See the respective PDS and VICAR file format definition documents.

 

Both file formats specify that bit 0 is the least significant bit of a byte. PHX EDR's may be constrained to use MSB only, but RDR's still need to be flexible.

 

byteorder