[Date Prev][Date Next][Index][Thread] [ncBrowse Mail Archive] [ncBrowse Main Page]

handling of time in "days since 1-1-1 00:00"



*************************************************
Message from the ncbrowse mail list.
*************************************************

NCBROWSE gurus,

When I load NOMADS OpenDAP data into Matlab, I find that the Gregorian 
dates are two days off.   I was about to complain to the folks 
distributing the data, but then discovered that NCBrowse reports the 
correct Gregorian date.  So I'd like to find out how NCBrowse calculates 
dates so I can understand what went wrong on the Matlab side.

The NOMADS files I'm dealing with have time in units "days since 1-1-1 
00:00".

An example file is http://tinyurl.com/g37e9

Looking at the metadata for this file, it clearly begins 00Z10OCT1991, 
and this is what NCBrowse reports also.

But in Matlab, I get a start date of 12-Oct-1991 00:00:00, 2 days later:

 >>url='http://nomads.ncdc.noaa.gov:9091/dods/NCEP_NARR_DAILY/199110/19911010/narr-a_221_19911010_0000_000';
 >>nc=netcdf(url);
 >>time=nc{'time'};
 >>time.units(:)
days since 1-1-1 00:00:0.0
 >>time(1)
       727116
 >> datestr(datenum(1,1,1,0,0,0)+time(1),0)
ans =
12-Oct-1991 00:00:00

Whatever julian/gregorian conversion routines are used by NCbrowse, I 
guess they are different than the ones Matlab uses!

Thanks,
--Rich

-- 
Richard P. Signell
U.S. Geological Survey       Phone: (508) 457-2229
384 Woods Hole Road          Fax:   (508) 457-2310
Woods Hole, MA  02543-1598

*************************************************
To remove yourself from this mailing list,
send mail to <epic-majordomo@noaa.gov> with
"unsubscribe ncbrowse" in the message body.
==========


Privacy Notice, External Links Disclaimer.