NOAA-PMEL / Ferret

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

Polygons over an axis with very large coordinate values messed up. #1457

Open karlmsmith opened 6 years ago

karlmsmith commented 6 years ago

Reported by @AnsleyManke on 30 Jul 2014 19:06 UTC Possibly a precision issue; pplus is single-precision. See this example:

! Data saved from a SOCAT LAS request. A very-short time axis with 
! an origin long before the data: origin in 1970, units of 
! seconds, data in 2013.

use poly_over_time.nc
shade/lev=(10)/nokey/nolab blank

! The polygons are all screwed up.
GO polymark POLY/NOLAB/OVER/NOAXES/NOKEY/NOLAB/PALETTE=green/LINE/LINE plot_x, plot_y, plot_d, trianglec, 0.8

! define an axis with a time origin at the start of the axis.

def axis/t="24-JUN-2013 01:00:00":"24-JUN-2013 04:00:00":60/units=seconds/t0="24-JUN-2013 01:00:00" new_t0_axis
let varnew = 0* t[gt=new_t0_axis] +  0*Y[GY=VAXIS]
shade/lev=(10)/nokey/nolab varnew

! The polygon plot where time data has the time-since-1970 subtracted.
let plot_x_new = plot_x-t[gt=blank,l=1]
GO polymark POLY/NOLAB/OVER/NOAXES/NOKEY/NOLAB/PALETTE=green/LINE/LINE plot_x_new, plot_y, plot_d, trianglec, 0.8

If the time axis is longer, the effect is not visible.

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

karlmsmith commented 6 years ago

Attachment from @AnsleyManke on 30 Jul 2014 19:06 UTC The netcdf file for the example poly_over_time.nc.zip

karlmsmith commented 6 years ago

Attachment from @AnsleyManke on 30 Jul 2014 19:07 UTC the first plot, with bad polygons poly_on_time_bad

karlmsmith commented 6 years ago

Attachment from @AnsleyManke on 30 Jul 2014 19:08 UTC the workaround: plot drawn when coordinate values are smaller. poly_on_time_ok