We are sorry to report that we recently discovered a nasty bug (or rather, a stupid mistake...) in the MODIStsp package.

The bug led to improper computation of custom spectral indices in the case that their formula included addition or subtraction operations on reflectance values (e.g., something like $\frac{(\rho_{NIR}+0.1)}{\rho_{Red}}$, with $\rho$ indicating a reflectance).

What is affected

, in the case that the Apply Scale/Offset option was set to "No"

, in the case that the Apply Scale/Offset option was set to "No"

What is NOT affected

What to do if you are affected

The bug is now fixed on the GitHub version. A patched release will be made available on CRAN as soon as possible. Unfortunately, if you have time series processed with the old version falling in the "What is affected" category, there's nothing you can do, save for reprocessing them.

We are truly sorry for the problem, which somehow managed to slip under the radar until now. We hope it will not bring you too much trouble!

What exactly was the problem?

This is so basic that can easily go unnoticed. So it's better to document it...

MODIS reflectances are stored in HDF layers as integers with a 10000 scale factor (e.g., a 0.1 reflectance is stored as 1000). If you need to "manually" compute and index such as SAVI:

$SAVI = \frac{(\rho_{NIR} - \rho_{Red})}{(\rho_{NIR} + \rho_{Red} + 0.5)} * (1 + 0.5)$).

starting from MODIS reflectances, you must take care of multiplying the MODIS data by 10E-4 beforehand. Your formula then becomes:

$SAVI = \frac{(0.0001 * b2_{NIR} - 0.0001 * b1_{Red})}{0.0001 * b2_{NIR} + 0.0001 * b1_{Red} + 0.5} * (1 + 0.5)$).

, otherwise the additive constants (in this case, the $+ 0.5$ in the denominator) would be made practically irrelevant.



lbusett/MODIStsp documentation built on Oct. 16, 2023, 6:59 a.m.