[ncl-talk] Strange units of time

Beáta Szabó-Takács szabo.b at czechglobe.cz
Wed May 30 02:38:45 MDT 2018


Dear NCL Users,
I wrote a HDF5 file in Java by IHDF5Writer http://svnsis.ethz.ch/doc/openbis/S176.0/ch/systemsx/cisd/hdf5/IHDF5Writer.html
Because IHDF5Writer can write timestamps as number of milliseconds since January 1, 1970, 00:00:00 GMT I converted the java.Util.Date to serial date number as days since 1970-01-01.

I wrote the time values into HDF5 file

writer.writeDoubleArray("time", time);

writer.string().setAttr("time", "units", "days since 1970-01-01");


I checked the resulted test.h5 in NCL and printed the time variable and I got the following result:

fn = "test.h5"

fi = addfile(fn, "r")

time = fi->time

time1 = time(0)

print(time1)


Variable: time1

Type: double

Total Size: 8 bytes

            1 values

Number of Dimensions: 1

Dimensions and sizes:   [1]

Coordinates:

Number Of Attributes: 1

  units :       days since 1970-01-01tyeratelatedofileion

(0)     17348.00006944444



Can someone let me know why ncl receive a strange units?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180530/0e0baf63/attachment.html>


More information about the ncl-talk mailing list