Re: writing to a netcdf file

From: Steeven Paul Yerraguntla <steevenpaul_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 19 2014 - 07:52:07 MST

Hello
          Thanks to Johnston for the suggestions and special thanks to
Dennis Shea for the script and corrections. This mail is to inform you that
my need is met. Thanks once again.

regards
Paul

On Wed, Feb 19, 2014 at 7:16 PM, Dennis Shea <shea@ucar.edu> wrote:

> The 'simple' method is recommended for most nc file creations.
>
> Use the _Wrap functions to preserve meta data.
> Use printVarSummary to look at variables.
>
> If you are new to NCL, please read the Mini-Language Manual at:
>
> http://www.ncl.ucar.edu/Document/Manuals/
> ===
> See attached
>
> Good Luck
>
>
> On 2/19/14, 5:00 AM, Marston Johnston wrote:
>
>> Hi,
>>
>> Here are a few examples of how to output your data to a netcdf file in
>> NCL.
>>
>> http://www.ncl.ucar.edu/Applications/o-netcdf.shtml
>>
>> The methods available depends on how efficient you want your script to be.
>> The easiest method takes a long time to write data to a netcdf file.
>> Faster
>> ways require you to predefine your variables before writing them to the
>> file. It's a bit more coding but helps you to better understand NCL and
>> netcdf file conventions.
>>
>> Good luck!
>>
>> /M
>>
>>
>>
>> On Wed, Feb 19, 2014 at 12:23 PM, Steeven Paul Yerraguntla <
>> steevenpaul@gmail.com> wrote:
>>
>> Dear seniors,
>>> This is to a query regarding how to write the filtered data,
>>> which was extracted using one of NCL filters, to a netcdf file without
>>> loosing the time axis and lat and lon information. In the following
>>> example
>>> ncl file, i want to write the *xBPF* variable without loosing time axis
>>> etc., to a netcdf file. Thanks in advance for the solution.
>>>
>>>
>>> ************************************************************
>>> ******************************
>>>
>>> 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
>>>
>>> diri = "/Users/shea/Data/AMWG/"
>>> vName = "U_anom" ; name of variable on the file
>>> fili = "uwnd.day.850.anomalies.1980-2005.nc"
>>> f = addfile(diri+fili, "r")
>>> x = f->$vName$(:,{0},{120})
>>>
>>> ; ***********************************************
>>> ; create the filter weights and apply
>>> ; ***********************************************
>>>
>>> ihp = 2 ; band pass
>>> sigma = 1.0 ; Lanczos sigma
>>>
>>> nWgt = 201 ; loose 100 each end
>>> fca = 1./100. ; start freq
>>> fcb = 1./20. ; last freq
>>> wgt = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )
>>> *xBPF * = wgt_runave ( x, wgt, 0 ) ; 20-100 day
>>>
>>>
>>> ************************************************************
>>> *************************************
>>>
>>> regards,
>>> Paul.
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 19 07:53:09 2014

This archive was generated by hypermail 2.1.8 : Wed Feb 19 2014 - 15:58:35 MST