Description Usage Arguments Details Value Author(s) References See Also Examples
MODIS HDFs converted to tifs result in each pixel having a integer value from 0 to 255. byteint2bit converts this to a string of 8 bits (0/1 values).
1 | byteint2bit(intval, reverse = TRUE)
|
intval, |
an integer between 0 and 255 |
reverse, |
a logical (TRUE/FALSE) indicating whether or not the string of bits should be reversed. Default: TRUE |
In the case of MODIS, the bits are read from RIGHT to LEFT, which is unnatural, so by default the function uses rev() to reverse the order of reading.
Note: the reversal means that, when interpreting the two 2-bit strings in the MODIS image, the interpretation of 01 and 10 is reversed from in the MODIS documentation.
byte_in_binary
, the 8 bits (0/1 values) in the
correct order
Nicholas J. Matzke matzke@berkeley.edu
Ackerman S, Frey R, Strabala K, Liu Y, Gumley L, Baum B and Menzel P (2010). "Discriminating clear-sky from cloud with MODIS algorithm theoretical basis document (MOD35)." MODIS Cloud Mask Team, Cooperative Institute for Meteorological Satellite Studies, University of Wisconsin - Madison. <URL: http://modis-atmos.gsfc.nasa.gov/_docs/MOD35_ATBD_Collection6.pdf>.
GoldsmithMatzkeDawson2013
1 2 3 4 5 6 7 8 | byteint2bit(intval=0, reverse=FALSE)
byteint2bit(intval=0, reverse=TRUE)
byteint2bit(intval=1, reverse=FALSE)
byteint2bit(intval=1, reverse=TRUE)
byteint2bit(intval=254, reverse=FALSE)
byteint2bit(intval=254, reverse=TRUE)
byteint2bit(intval=255, reverse=FALSE)
byteint2bit(intval=255, reverse=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.