Reads a 2-D gridded file and fits a low-order polynomial trend to these data by [optionally weighted] least-squares. The trend surface is defined by:

       m1 + m2*x + m3*y + m4*x*y + m5*x*x + m6*y*y + m7*x*x*x + m8*x*x*y + m9*x*y*y + m10*y*y*y.

The user must specify n_model, the number of model parameters to use;thus, 3 fits a bilinear trend, 6 a quadratic surface, and so on. Optionally,selectto perform a robust fit. In this case, the program will iteratively reweight the data based on arobust scale estimate, in order to converge to a solution insensitive to outliers. This may be handy when separating a "regional" field from a "residual" which should have non-zero mean, such as a local mountain on a regional surface. If data file has values set to NaN, these will be ignored during fitting; if output files are written, these will also have NaN in the same locations.

Copyright <2010>, <Joaquim Luis>

Created with the Freeware Edition of HelpNDoc: Easily create Web Help sites