Main IDL program is calc_healthtrendV2.pro. This is written to run under IDL, but should work under ENVI if it has the underlying IDL functionality. It will also run under GDL, which is a free opensource IDL-like program (see notes below). The program contains a function to make a linear fit across a stack of data layers on a pixel-by-pixel basis. calc_healthtrendV2.pro should be self-documenting - I wrote a comment for every action taking in the program, and if you read the header at the top you will find instructions for use. The comments throughout the code should help you understand what is going on, and help out if you decide to modify anything. There are two output files, the first is the slope of the fit trend line, the second is ancillary data. Note that at the current time, chisq and prob are not working. We need to better understand linfit.pro to make these work - this has something to do with the stdev parameter, but I haven't been able to figure it out. We need Jen's stats expertise here !! Below is a sample command that I am using for the test data: a=healthtrend("/net/nfs/gromit/d1/proj/nsrclandsat/testsubset/1989-2009stack", $ "/net/nfs/gromit/d1/proj/nsrclandsat/testsubset/healthtrend", $ "/net/nfs/gromit/d1/proj/nsrclandsat/testsubset/ancillarydata",1021,916,21) NOTES on GDL: gdl runs under mac and linux. Don't be scared away by the optional requirements, this health trend calculation is a simple program that shouldn't require any of that stuff. The gdl program download is at: http://gnudatalanguage.sourceforge.net/ I had to download the linear fit function from an idl library repository, since that did not come with gdl (note that when you download the file there is a little html garbage at the top and bottom that needs to be deleted): http://www.astro.washington.edu/docs/idl/htmlhelp/slibrary07.html You will have to use ".run linfit" prior to ".run calc_healthtrend.pro" When I ran this in both IDL and GDL, the files differed, but on close inspection, they were itentical to the 5th decimal place, and varied slightly in the 6th decimal place.