Ah, I think I misinterpreted the
question and Ansley is on the right track. If you need to include
the prime meridian then try the following
let tlong1 = if tlong gt 25 then tlong
let tlong2 = if tlong lt 90 or tlong gt 270 then mod(
tlong+180,360)-180 ! Remaps to -90->90 smooth at 0. masks
abs(lon)>90
contour tlat
contour/over/lev=(0,360,30) tlong1
contour/over/lev=(0,360,30) tlong2
Russ
On 06/12/17 11:07, Ansley C. Manke wrote:
Hi,
This is because of the discontinuity in the longitudes, where they
change from 0 to 360. The thicker wiggling line you see is all of
the contour lines being interpolated across that discontinuity.
In a SHADE plot of "tlong" you can see the sharp break between 0
and 360, right where that line is.
Try just one contour level:
set data File1.nc
contour tlat
contour/over/lev=(40) tlong
(plot1.png)
you can see that it has drawn the line that you want,
along y=40, but then there is another where the contouring method
is interpolating to find where there are values of 40 lying, for
instance, between adjoining values of 0.2 and 359.75. There is no
direct way to prevent this, but we can define new variables which
avoid the issue.
Define another variable that does not include the branch cut. My
first try was to define a longitude variable with values only in 5
to 355, and contour that. It's pretty good. (Do "SHADE tlong1"
to see what's going on.)
use File1.nc
contour tlat
let tlong1 = if tlong GE 5 and tlong LE 355 then tlong
contour/over/lev=(10,350,20) tlong1
(plot2.png)
There is still some extra contouring going on near the
center. The data excluded isn't enough to prevent the same kind
of interpolating where we don't want it.
Another try, first contouring only a variable with values between
0 and 180, then a second with values between 180 and 360.
contour tlat
let tlong1 = if tlong lt 180 then tlong
let tlong2 = if tlong ge 180 then tlong
contour/over/lev=(10,350,20) tlong1
contour/over/lev=(10,350,20) tlong2
(plot3.png)
I've allowed all of these to be drawn using the default colors for
plot/overlay plots, just to make it easy to see, but of course you
would use PLOT/OVER/NOLABEL/COLOR=black
-Ansley
On 12/3/2017 11:30 PM, niciej wrote:q
Dear Ferreters,
I'm trying to draw longitude/latitude from
data set (tlat, tlong):
set data File1.nc
contour tlat
contour/ov tlong
The problem is that longitude lines don't
finish in the middle - on the pole - but they are
multiplicated in one direction - as in attached picture. How
can I fix it?
I'm absolutely new to Ferret (I'm using v6.93) Thanks in advance for
your tips!
|