Hi all, thank for the suggestions!
Seems to be a Pandoran box. But step by step ...
The following does not work: ferret yes? use coads_climatology yes? shade/l=1/x=-20:40/y=-60:0 sst yes? shade/over/lev=(100)/pal=grey missing(sst[l=1],100) :-( Try to use another specification of coordinates: ferret yes? use coads_climatology yes? shade/l=1/x=20W:40E/y=60S:0N sst yes? shade/over/lev=(100)/pal=grey missing(sst[l=1],100) )-: OK, lets say it explicitly ferret yes? use coads_climatology yes? shade/l=1/x=-20:40/y=-60:0/grat sst yes? shade/over/lev=(100)/pal=grey/x=-20:40/y=-60:0 missing(sst[l=1],100) Much better. Is it eventuall the "missing" function? ferret yes? use coads_climatology yes? shade/l=1/x=-20:40/y=-60:0/grat sst yes? shade/over/pal=bluescale sst[l=1]*10 Definitely not, it is most probably the missing coordinate specification in the overlay. What tells ncdump: double COADSX(COADSX) ; COADSX:units = "degrees_east" ; COADSX:modulo = " " ; COADSX:point_spacing = "even" ; COADSX = 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, ..... 373, 375, 377, 379 ; Hm, 20°E is really a special point, but the axis is modulo. Lets have graticule now ferret yes? use coads_climatology yes? shade/l=1/x=-20:40/y=-60:0/grat sst yes? shade/over/lev=(100)/pal=grey/x=-20:40/y=-60:0 missing(sst[l=1],100) Excellent. Perfect for scientific work. But not for others purposes... Remeber in "fill" to gain fake accuracy: ferret yes? use coads_climatology yes? fill/l=1/x=-20:40/y=-60:0/grat sst yes? shade/over/lev=(100)/pal=grey/x=-20:40/y=-60:0 missing(sst[l=1],100) Smoother, but the white spots are still disturbing. So fill them with "shade" first and overlay with "fill": yes? use coads_climatology yes? shade/l=1/x=-20:40/y=-60:0 sst yes? fill/l=1/x=-20.5:40.5/y=-60:0/over sst yes? shade/over/lev=(100)/pal=grey/x=-20:40/y=-60:0 missing(sst[l=1],100) This does the same yes? use coads_climatology yes? set region/x=-20:40/y=-60:0 yes? shade/l=1 sst yes? fill/l=1/over sst yes? shade/over/lev=(100)/pal=grey missing(sst[l=1],100) Now we try to add graticule: yes? use coads_climatology yes? set region/x=-20:40/y=-60:0 yes? shade/l=1/grat sst yes? fill/l=1/over/grat sst yes? shade/over/lev=(100)/pal=grey/grat missing(sst[l=1],100) Land is filled correctly, but the graticule is mostly lost. It may be redrawn using a second viewport, or with explicit lines. But lets search for a simpler solution. Extend the ocean into land with the nearest neighbour filler fill_xy before using "fill" It calculates the average over all valid nearest neighbour points. This can be done repeatedly. A smooth and limited extrapolation. yes? use coads_climatology yes? set region/x=-20:40/y=-60:0 yes? let mask=0*missing(sst[l=1],1)+1 ! Nothing to be excluded yes? fill/l=1/grat fill_xy(sst,mask,1) yes? shade/over /lev=(100)/pal=grey missing(sst[l=1],100) Filling one point seems not to satisfy the "fill" function near corners. Nothing to be discussed, just call two sequences in fill_xy to fill land two points inward: ferret yes? use coads_climatology yes? set region/x=-20:40/y=-60:0 yes? let mask=0*missing(sst[l=1],1)+1 yes? fill/l=1/grat fill_xy(sst,mask,2) !Note the "2" yes? shade/over /lev=(100)/pal=grey missing(sst[l=1],100) There is one leftover white point that should not be there. I have inspected the details, just by plotting fields before and after filling. fill_xy does not fill the one point in the first sequence, again at 20°E. There is a similar point located in the Mediterranean, again at 20°E. So fill_xy gives wrong results at two ocean points. Wanting just an image, fill three time with fill_xy(sst,mask,3). Thats it. Anyway, it is disturbing to know that a tool gives a wrong result, even if this happens solely at two points in a 360x180 grid. In summery, some problems show up in overlay plots, but also without plotting in some functions things may go wrong. And it is generally related to the cut longitude at 20°E. Is there a way to get a correct result with ferret? Yes, it can! yes? use coads_climatology yes? set region/x=-20:40/y=-60:0 yes? let mask=0*missing(sst,2)+1 yes? fill/l=1/grat fill_xy(sst[l=1,x=-20:40,y=-60:0],mask[x=-20:40,y=-60:0],2) yes? shade/over /lev=(100)/pal=grey missing(sst[l=1],100) I did not check coordinates of land carefully, simple checks look fine considering we have a 2deg data set. All commands used here should give correct results, but some do not. But I cannot propose a general rule to produce safe scripts. May be, I have missed a point specific for modulo axes? Have a nice weekend and happy ferreting, Martin 01/27/2017 01:24 PM, Nicolas Freychet wrote:
|