comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: unable to set time attribute for netCDF in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: unable to set time attribute for netCDF in IDL [message #78179] Mon, 31 October 2011 07:39 Go to previous message
Erik[2] is currently offline  Erik[2]
Messages: 2
Registered: October 2011
Junior Member
When in doubt, resort to the free NCAR's NCL language for this fix:

a = addfile("file.nc","r") ; read in file
var = a->var ; let's say var is (time, lat, lon)
var!0 = "time"
Time = (/0,1,2,3,4,5,6,7,8,9,10/) ; or Time = ispan(0,10,1) or... Time
= <some string>
var&time = Time
.
<snip>
.
;write out to netcdf file
b = addfile("out_file.nc","c")
b->var=var

There are also other time fixes one may do.
http://www.ncl.ucar.edu/

Erik



On Oct 29, 6:13 am, Stephanie <ee...@leeds.ac.uk> wrote:
> Dear all,
>
> I struggle to create netCDF output that has the correctly time axis
> for further post-processing. I thought/tried different ways: (1)
> writing the time variable, read in from a correct netCDF file,
> directly to the output file, but it does not let me set the attribute.
> (2) creating a date-time axis myself, which does not seem trivial.
>
> Can you give advice or a code example on how to manage this issue?
>
> Thanks,
> Steph
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Shape to raster
Next Topic: Shape to raster

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:07:29 PDT 2025

Total time taken to generate the page: 0.00443 seconds