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

Home » Public Forums » archive » NetCDF: Converting time variable using start time from "units"
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: NetCDF: Converting time variable using start time from "units" [message #91904 is a reply to message #91903] Mon, 14 September 2015 15:29 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 9/14/15 2:33 PM, Larry H. wrote:
> I've been reading and writing NetCDF files using IDL for some time.
> Now I'm wondering whether there's a better way to convert the values
> in the "time" variable to real times than by using ncdump to get the
> units from the attributes and then hard coding the offset into my
> routines. I can read the units, e.g.,
>
> time:units = "minutes since 2007-01-26 01:30:00"
>
> using ncdf_attget, but don't know of any way IDL can understand this
> information and automatically apply the offset to the values in
> "time". I've heard a rumor that this can be done. Any suggestions?
> Thanks.
>

I have a basic routine to do this MG_CF2JULIAN to convert from the CF
convention in netCDF to Julian time:

https://github.com/mgalloy/mglib/blob/master/src/calendar/mg _cf2julian.pro

This handled my needs, but I think is fairly general. Please let me know
if there is more you need from it.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Interpolate
Next Topic: how to write a for loop that skips over things

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

Current Time: Wed Oct 08 13:59:53 PDT 2025

Total time taken to generate the page: 0.00351 seconds