[Thread Prev][Thread Next][Index]

[ferret_users] DAYS1900 function not working as I expect




I have some 5-minute data for an entire month that I'm trying to read in and save as netCDF and the DAYS1900 function doesn't appear to be incrementing the date as I expect.

Here's a data sample, two days' worth (24 samples)

mon day hour min data
  1   1    0   0 13.4
  1   1    0   5 13.1
  1   1    0  10 12.7
  1   1    0  15 12.2
  1   1    0  20 11.9
  1   1    0  25 11.5
  1   1    0  30 11.3
  1   1    0  35 11.0
  1   1    0  40 10.8
  1   1    0  45 10.7
  1   1    0  50 10.5
  1   1    0  55 10.3
  1   1    1   0 10.1
  1   1    1   5 10.1
  1   1    1  10 10.0
  1   1    1  15 9.8
  1   1    1  20 9.7
  1   1    1  25 9.6
  1   1    1  30 9.6
  1   1    1  35 9.6
  1   1    1  40 9.5
  1   1    1  45 9.4
  1   1    1  50 9.4
  1   1    1  55 9.3


And part of a script to read the data:

[...]
file/skip=1/var=mon,day,hour,minute,data $1
!
let time = (DAYS1900(2022,mon,day)-DAYS1900(2022,1,1))+(hour/24)+(minute/60)
list time
[...]
And the output of "list time":

             VARIABLE : (DAYS1900(2022,MON,DAY)-DAYS1900(2022,1,1))+(HOUR/24)+(MINUTE/60)
             FILENAME : TEST
             SUBSET   : 24 points (X)
 1     /   1:  0.000
 2     /   2:  0.083
 3     /   3:  0.167
 4     /   4:  0.250
 5     /   5:  0.333
 6     /   6:  0.417
 7     /   7:  0.500
 8     /   8:  0.583
 9     /   9:  0.667
 10    /  10:  0.750
 11    /  11:  0.833
 12    /  12:  0.917
 13    /  13:  0.042
 14    /  14:  0.125
 15    /  15:  0.208
 16    /  16:  0.292
 17    /  17:  0.375
 18    /  18:  0.458
 19    /  19:  0.542
 20    /  20:  0.625
 21    /  21:  0.708
 22    /  22:  0.792
 23    /  23:  0.875
 24    /  24:  0.958

Why is the 13th sample not 1.042? Of course, ferret is complaining that the axis isn't monotonically increasing.

What am I missing?

Thanks!

--
Gary Strand, CESM Data Manager
ORCID 0000-0001-9740-0104
strandwg@xxxxxxxx

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement