[ncl-talk] weekly to daily data interpolation

Ipshita Majhi ipmajhi at alaska.edu
Tue Nov 25 20:52:06 MST 2014


Hi,

I wrote a program to convert weekly data to daily. It works, but the output
has only -9 throughout the matrix.
Can anyone tell me where I am going wrong

******************************************************************
;This is to create daily values from weekly values
;Created on Nov. 24th 2014


;Reading in the snow covered extent original file for time

;*******************************************
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"
;*******************************************

;Reading in the original data

a=addfile("~/Documents/Snow_cover_IMS/nhsce_v01r01_19661004_20140602.nc
","r")

;Now extracting time from the file
time_sce=a->time

;Now we are going to extracting snow cover extent in area
b =addfile("~/Documents/Snow_cover_IMS/NCL_codes/sce_area_B.nc","r")
sce_area=b->B
sce_area_avg=wgt_areaave_Wrap(sce_area,1.0,1.0,0)
x=sce_area_avg(11:dimsizes(time_sce)-21)

;Now we want to convert the snow covered extent to daily values

;Since first year has only 12 data points we would like to remove that to
have full years and last year 2014 also have 22 points

time=time_sce(11:dimsizes(time_sce)-21)

;Since we are reading data from 1967-2013, we have 46 years

tNew=new(46*365,"float")

xo =linint1_n (time, x, False, tNew, 0, 0)
print(xo)

********************************************************************
Thank you
Best Regards
Ipshita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141125/1b48d4bb/attachment.html 


More information about the ncl-talk mailing list