8bit to 16bit R conversion script

posted Oct 10, 2011, 2:10 PM by Brian Buma
MODIS quality data comes in 8bit format, imagery in 16bit.  For some applications, like Timesat, that doesn't work, as it can't match the two datatypes together.  This script takes a folder of raw binary quality files (like what you get from the MODIS MRT program) and converts it to 16 bit, without changing any data values.

Also in the file is a way to spatially check the conversion.  Use identical dates (one 8bit, one the 16bit conversion) and make sure it all worked.  Uses the raster package in R.  It should also allow for generalized comparisons between dates, within the same product line.
Brian Buma,
Oct 10, 2011, 2:10 PM