Dimensionality problem

From: Lizz Ultee <lultee_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 07 2011 - 12:42:42 MDT

Hi NCL-Talk,
I have emailed with a related problem before, but I hope you will be able
to help me with this. I was debating between regCoef and regline for a
particular application; regline gives errors but regCoef returns
unrealistic values. What I want to do is get a linear trend on some data
that has dimensions time, latitude, and longitude--I only want the trend
as it relates to time (getting secular trend of seasonally varying data).
The relevant section of code is:

   in = addfile("./Data/tws_noah10_1m_7901_1010.nc","r")
   water = in->water
   wt = water(latitude|:,longitude|:,time|:) ; reorder
; create x and calculate the regression coefficient
; note regline works on one dimensional arrays.
; x = ispan(0,dimsizes(wt&time)-1,1)*1. ; I have this
commented out currently, can be
   x = ispan(0, 381, 1)*1. ; the time dimension
is of size 382 so this is equiv

   do latitude=-59.5, 89.5, 1
        do longitude=-179.5,179.5, 1
          ; wt = water(latitude|:,longitude|:,time|:) ; reorder
variable inside do-loop?
           rc = regline(x,wt)
           rc!0 = "latitude"
; trying to assign dimensionality to rc
           rc!1 = "longitude"
        end do
   end do

The error I get is:
fatal:Number of dimensions in parameter (1) of (regline) is (3), (1)
dimensions were expected

But to my mind, using a do-loop should plug in pairs of constants in wt
and thus make it 1-dimensional. I would like to have values on a lat/lon
grid. Thanks in advance for any suggestions!

Lizz Ultee

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Jul 7 12:42:48 2011

This archive was generated by hypermail 2.1.8 : Tue Jul 12 2011 - 15:03:53 MDT