<div dir="ltr"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear ncl-experts,</div><div><br></div><div>I am just confused about the output of the 1-2-1 average in NCL.</div><div><br></div><div>I have a csv file containing 30 years of data (1979-2008). I attached the raw file (P28-P31.csv) and the smoothed file (P28-P31_filt.csv). After applying the 3 point 1-2-1 average, I got 29 points with -9999 (missing at both ends) after applying the script. </div><div><br></div><div>Question:</div><div><br></div><div>[1] I'm confused now which output point corresponds to a particular year (which point in the smoothed file corresponds to 1979, 1980,etc).</div><div>[2[ Is there a way to add a "filler" value to the points without data after smoothing automatically?</div><div><br></div><div><br></div><div><div>begin</div><div> diri = "./"</div><div> files = systemfunc("ls *.csv") </div><div> numfiles = dimsizes(files)</div><div> do ifil = 0,numfiles-1</div><div> lines = asciiread(files(ifil),-1,"string")</div><div> data<span class="gmail-Apple-tab-span" style="white-space:pre"> </span> = lines(1:)</div><div> rain<span class="gmail-Apple-tab-span" style="white-space:pre"> </span> = tofloat(str_get_field(data,1,","))</div><div>;;***************************************************</div><div>;;Apply 1-2-1 running average (three pentads)</div><div>;;****************************************************</div><div> x = wgt_runave(rain, (/0.25, 0.50, 0.25/), 0)</div><div> x@_FillValue = -9999</div><div>;;****************************************************</div><div>;;Save output to a csv file</div><div>;;****************************************************</div><div> flname = str_get_cols(files(ifil),0,6)+"_filt.csv"</div><div> asciiwrite(flname,x)</div><div> end do</div><div>end</div></div><div><br></div><div>Thank you in advance for the help.</div><div><br></div><div>Sincerely,</div><div><br></div><div>Lyndz</div><div><br></div></div></div></div></div></div></div></div></div></div></div>
</div>