NOAA-PMEL / Ferret

The Ferret program from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
55 stars 21 forks source link

time shift on axis with units of seconds #1415

Open karlmsmith opened 6 years ago

karlmsmith commented 6 years ago

Reported by @AnsleyManke on 19 Feb 2014 23:28 UTC Reported in the Ferret Users List: http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00733.html

Here's an example. The behavior appears in older versions of Ferret as well.

yes? define axis/t="1-jan-2006:12":"5-jan-2006:12":86400/units=seconds/t0=1-jan-1970  time5
yes? define axis/y=0:20:5/units=degrees_north yax
yes? let tvar = L[gt=time5]
yes? let ytvar = tvar + sin(y[gy=yax]/30)

! A shade plot shows the shift
yes? set view upper 
yes? shade/title="day axis in units of sec-since-1970" ytvar

! A line plot is correct
yes? set view lower
yes? plot/step=connected/color=red tvar

Now redefine the time axis with an origin closer to the data. The plot is correct. Using other units such as hours or minutes with the 1970 time origin also fixes things.


yes? define axis/t="1-jan-2006:12":"5-jan-2006:12":86400/units=seconds/t0=1-jan-2005  time5

yes? set view upper
yes? shade/title="day axis in units of sec-since-2005" ytvar

yes? set view lower
yes? plot/step=connected/color=red tvar

Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/2143

karlmsmith commented 6 years ago

Attachment from @AnsleyManke on 19 Feb 2014 23:29 UTC with daily axis in seconds since 1970 timeshhift

karlmsmith commented 6 years ago

Attachment from @AnsleyManke on 19 Feb 2014 23:29 UTC with daily axis in seconds since 2005 timeshhift_ok