⇐ ⇒

[CF-metadata] Representing Matlab time in a CF-Metadata compliant file

From: Godin, Michael <godin>
Date: Wed, 26 Aug 2009 21:24:46 -0700

Thanks Seth,

I read the CF spec too fast and assumed the proleptic_gregorian calendar used the UDUnits convention of no year zero. Now I see that only the Gregorian calendar specifically mentions UDUnits. It would likely be helpful if section 4.4.4 explicitly associated the ISO8601 convention with proleptic_gregorian calendar -- at least to clarify the meaning of years before 1CE.

So I guess I'll assume that proleptic_gregorian implies ISO8601 and go with:
time:units = 'days since -0001-12-31'
time:calendar= proleptic_gregorian'

Mike

-----Original Message-----
From: cf-metadata-bounces at cgd.ucar.edu [mailto:cf-metadata-bounces at cgd.ucar.edu] On Behalf Of Seth McGinnis
Sent: Wednesday, August 26, 2009 3:31 PM
To: CF metadata list
Subject: Re: [CF-metadata] Representing Matlab time in a CF-Metadata compliant file

I believe you can do this by specifying the time coordinate variable's
"calendar"
attribute as "proleptic_gregorian" and keeping the reference date as-is.

The udunits calendar, which is the default, is the standard mixed
Julian/Gregorian
calendar, but section 4.4.1 of the CF spec lists other legal choices. The
proleptic
Gregorian calendar extends dates regularly backwards past the year 1582, and
the ISO 8601 version of it does have a year zero. This is what's used in a lot
of
software, and appears to be how Matlab is storing dates.

(Note that arguably you could be using some other proleptic Gregorian calendar
and still be CF, but I think it's fair to assume that ISO 8601 is what's
meant.)

----
Seth McGinnis
NARCCAP Data Manager
Associate Scientist
ISSE / NCAR
----
>Godin, Michael wrote:
> I'd like to convert some files from Matlab to NetCDF formats with as little
>modification of the data as possible. 
>
> I am running into some ambiguity with dates formatted according to the
>Matlab convention where 1.0 == Jan 1, 0000.  Since Matlab assumes a year "0",
>and UDUnits does not, should the time units for Matlab dates be "days since
>-0002-12-31"?  While it seems correct, I haven't seen anyone else use such
>units.
>
>> Thanks, Mike
>
> _____________________________________________
> Michael A. Godin
> Software Engineer
> Monterey Bay Aquarium Research Institute
> Phone: 831-775-2063  http://www.mbari.org
> _______________________________________________
> CF-metadata mailing list
> CF-metadata at cgd.ucar.edu
> http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata
_______________________________________________
CF-metadata mailing list
CF-metadata at cgd.ucar.edu
http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata
Received on Wed Aug 26 2009 - 22:24:46 BST

This archive was generated by hypermail 2.3.0 : Tue Sep 13 2022 - 23:02:41 BST

⇐ ⇒