NOAA-PMEL / Ferret

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

three-argument SHADE (using cell vertices/bounds/edges) sometimes fails to plot cells #1914

Closed AndrewWittenberg closed 5 years ago

AndrewWittenberg commented 5 years ago

The following should SHADE nine cells, but instead does only six:

    NOAA/PMEL TMAP
    FERRET v7.44 (optimized)
    Linux 2.6.32-696.30.1.el6.x86_64 64-bit - 12/10/18
     7-Mar-19 20:51     

yes? let/title="longitude"/unit="degrees_e" xedge = x[gx=0:3:1] + 0*y[gy=0:3:1]
yes? let/title="latitude"/unit="degrees_n" yedge = 0*x[gx=0:3:1] + y[gy=0:3:1]
yes? let/title="temperature"/unit="K" val = reshape({1,2,3,4,5,6,7,8,9},x[gx=1:3:1]+y[gy=1:3:1])
yes? shade val, xedge, yedge

plot1

The range of the colorbar suggests that Ferret is aware of the data in the unplotted cells, it's just not plotting them.

But if we simply change the window aspect ratio, the cells now appear!

yes? set window/aspect=1
yes? shade val, xedge, yedge

plot2

What's going on?

AnsleyManke commented 5 years ago

This first shows up with Ferret v6.8, which was the change to use of double-precision data throughout Ferret - likely a clue!

AnsleyManke commented 5 years ago

Yes, this was a precision issue - comparing the coordinate data with the information about the translation of coordinates when putting data onto the page. PPLUS is still in single precision, so that comparison needs to be done just to single precision tolerances but was done in double precision.

Fixed in curv_coord_range_sub.F