Re: Extrapolation problem

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat, 01 Dec 2007 08:11:15 -0700

[1] As noted in the documentation for linint2, the function
     does not extrapolate ["no extrapolation is performed"].

[2] Even if you could, why would you choose to extrapolate
     the data? Yes, you have bad values [zero] but just any
     values are not good. Extrapolation is dangerous.

[3] Either:
     (a) Unfortunately, the bad values are zero which is a physically
         possible value for meridional wind. So I would set the bad
         values via

               V@_FillValue = 0
               V@_FillValue = 1e20

      (b) If u want to set some "real" numbers I suggest
          calculating the climatology for 00Z, 06Z, 12Z 18Z
          and using these at the appropriate times for the missing
          values.

Good luck

Tummuri, Spandana wrote:
> Hello,
>
> I downloaded a particular file from the ESG website. The file consists of variable VWind V(time,lev,lat,lon) and has six hourly data for one month (May). For some weird reason, the file had V variables written for all 124 times values (31 days * 4-6hourly periods per day) but the time variable itself was not written correctly. It did have 124 time values but some of the time values were equal to 0 instead of the actual values(60373,60373.25 etc). I wanted the time variables as they should be and not zeroes. I am not very good at NCL programming and wasn't sure how to replace the zeroes with the actual time values. I tried the following options:
>
> 1) I wrote a program to open a new file which has the V variables read from the Vfile and time variable read from another file for same time period (U file). It did not work. The time variables still had zeroes.
>
> 2) Because they were towards the end of the month (29, 30, and 31st), I removed the V variables for which time variable was zero. So now the V file had data till the 28th of May. The idea was to extrapolate the V values for 29th, 30th and 31st from the V values whose time values were proper. I wrote the attached code. The problem with time variable is fixed now and the time variable has correct values (60373, 60374 etc.) but the V variable is not being extrapolated for those times. I am sure I must have made some mistake with the code but I am not able to figure out what it is.
>
> Can someone please help me fix the code. If you have any further questions please let me know and I will write in detail.
> Thanks in advance.
> Spandana Tummuri
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
>
> fn1 ="/home/stummuri/Run2/V-35-05-01.nc"
>
> in1 = addfile(fn1, "r")
>
> fn2 ="/home/stummuri/Run2/U-35-05.nc"
>
> in2 = addfile(fn2, "r")
>
> lat = in1->lat
>
> lon = in1->lon
>
> time = in1->time
>
> time1 = in2->time
>
> lev = in1->lev
>
> hyam = in1->hyam
>
> hybm = in1->hybm
>
> date = in2->date
>
> datesec = in2->datesec
>
> V = in1->V
>
> nlat = dimsizes(lat)
>
> mlon = dimsizes(lon)
>
> ntime1 = dimsizes(time1)
>
> nlev = dimsizes(lev)
>
> x = linint1(time, V(lev|:,lat|:,lon|:,time|:), True, time1, 0)
>
> x!0 = "lev"
>
> x!1 = "lat"
>
> x!2 = "lon"
>
> x!3 = "time"
>
> x_at_units = "m/s"
>
> z = (x(time|:,lev|:,lat|:,lon|:))
>
> z!0 = "time"
>
> z!1 = "lev"
>
> z!2 = "lat"
>
> z!3 = "lon"
>
> z_at_units = "m/s"
>
> filo="/home/stummuri/Run2/V-35-05-02.nc"
>
> fo=addfile(filo,"c")
>
> fo->V = z
>
> fo->lat = lat
>
> fo->lon = lon
>
> fo->time = time1
>
> fo->lev = lev
>
> fo->date= date
>
> fo->datesec = datesec
>
> fo->hyam = hyam
>
> fo->hybm = hybm
>
> end
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Dec 01 2007 - 08:11:15 MST

This archive was generated by hypermail 2.2.0 : Mon Dec 03 2007 - 10:54:09 MST