I'd like to process some netCDF 4 files with arcpy (ArcGIS 10.3.1). The original data comes from NCEP/NCAR project and contains wind vectors (uwnd/vwnd) for world-wide points (lon/lat) at certain time stamps. The dimension "time" is given as relative time in
hours since 1800-01-01 00:00:0.0
If I have a look at the data with CDO (Climate Data Operators), the first four time stamps of the uwnd.10m.gauss.2016.nc are the following:
cdo sinfo uwnd.10m.gauss.2016.nc
2016-01-01 00:00:00
2016-01-01 06:00:00
2016-01-01 12:00:00
2016-01-01 18:00:00
...
Unfortunately arcpy has a problem understanding the relative time stamp and the following code
inNetCDF = r"\C:\temp\uwnd.10m.gauss.2016.nc"
ncFP = arcpy.NetCDFFileProperties(inNetCDF)
ncDim = ncFP.getDimensions()
for dim in ncDim:
print "%s (%s)" % (dim, ncFP.getFieldType(dim))
top = ncFP.getDimensionSize(dim)
for i in range(0,top):
print ncFP.getDimensionValue(dim,i)
delivers this as output for the dimension "time":
07.03.1800 17:50:24
07.03.1800 17:50:42
07.03.1800 17:51:00
07.03.1800 17:51:18
...
So instead of one time stamp every 6 hours ArcGIS calculates one time stamp every 18 seconds?!
It's not a big problem to recalculate the correct date within python, but I was wondering if there is a parameter I can set so that arcpy delivers directly the correct date and time. I've had the same problem with wrong date and time by using the MakeNetCDFFeatureLayer toolbox tool directly within ArcMap, and there I can't do any python calculations.