tregr function

Arindam Chakraborty arch at IO.MET.FSU.EDU
Mon May 2 22:10:37 EDT 2005


hi Dan,
        this example makes arrays of value 1-100 over every grid point
of the domain.

 'open file'

* set region of x, y and t varying
 'set x 1 256'
 'set y 1 128'
 'set t 1 100'

* a constant field of 1, assuming the variable name to be var
 'define ones = var/var'
* but this will have undef values if var==0 or undef.
* change those to 1
 'define ones = const(ones,1,-u)'
* now we can have the time variable
 'define tvar = 101 - sum(ones,t+0,t=100)'

 'd tvar'

Hope this helps.
----------------------------
 ARINDAM CHAKRABORTY
 Department of Meteorology
 Florida State University
 Tallahassee, FL-32306, USA
 Tel: +001-850-6443524 (Off)
      +001-850-5758550 (Res)
 Fax: +001-850-6449642
____________________________

On Mon, 2 May 2005, Dan Swank wrote:

> All,
>
> Looking for some quick advice on using this function.
>
> I have a single level 144 lon x 90 lat grid with 100 time steps.
> I want to do a linear regression using tregr() on each of the x/y grid
> cells (100 data points in each). and plot the slope of the regression
> lines on a plot.
>
> My problem is with the first argument.  If i am correct, the first arg
> defines the values to be used on the x-axis for the regression, while
> the 100 time values go on the y-axis.  I have tried putting a aave() of
> the same variable for this argument as shown in the docs for the
> function but this does not give me what i'm looking for.
>
> How can I 'define' a simple 1-D variable with values 1-100 to use for
> this argument?
>
> Thanks for any help,
> -Dan
>



More information about the gradsusr mailing list