comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Horrible map reprojections
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Horrible map reprojections [message #21635] Thu, 07 September 2000 07:53 Go to next message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Ben Marriage wrote:
>
> Martin Schultz wrote:
>
>> (1) make sure that the "center" longitude is at the center of your
>> LIMIT (or at least within and not at the border)
>> (2) you can get rid off the silly lines if you omit the clip=0
>> keyword.
>>
>> The following looks ok to me (same version and platform as you have):
>> map_set,0,180,limit=,xmar=0,$
>> ymar=0,noborder=1,/grid,/iso,/mercator
>> map_continents,/hires
>>
>
> Thanks Martin, that kinda solves one problem. However, the contour
> problem still remains. Take a look at
> http://www.met.ed.ac.uk/~aaron/funny_lines.gif. There are lines drawn
> from one edge of the plot to the other (the data when filled with the
> /cell_fill keyword looks OK), just when a line contour is drawn over the
> top, these parallel lines appear. They look to be where the data is
> trying to connect one point to the same point, but in a different region
> of the plot window?
>
> Thanks,
> Ben

Yeah. That's the big problem I still haven't solved in a
satisfactorily general manner (admitting that I haven't tried too
hard). It would be very nice, if you could contact support@rsinc.com
with your problem and request that they finally improve the stability
and functionality of the mapping tools in IDL. Sure, most of the time
you can get them to work, but it's always a pain and not very
user-friendly at all.

What you are facing with these contours somehow has to do with how
map_set treats out-of-bounds data (sloppy formulation). There are two
things you should check:
(1) don't pass (much) more data than you need to display (i.e. cut off
all data north and southwards of 35 deg latitude before drawing the
contour
(2) make sure that your data is arrange din the correct order. If the
data is from -180 to 180, but you rmap projection (as it is now) is
set up from 0 to 360, you will have to shuffle the data with somethin
glike this (assuming a 1x1 degree grid):
newdata = [ data, data[180:*,*] ]

Hope this helps,
Martin


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
Re: Horrible map reprojections [message #21637 is a reply to message #21635] Thu, 07 September 2000 07:21 Go to previous messageGo to next message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Ben Marriage wrote:
> IDL> print,!VERSION
> { x86 linux unix 5.3 Nov 11 1999}
>
> I'm trying to set up a particular map reprojection, and get some rather
> horrible results. Can somebody try this on their machine to see if it is
> reproducible please?
>
> window,0,xs=1000,ys=300
> map_set,0,180,0,limit=[-30,-180,30,180],xmar=0,$
> ymar=0,noborder=1,/grid,clip=0,/iso,/mercator
> map_continents,/hires
>
> One effect is that the reprojection does not extend all the way to the
> right hand side of the plotting area (should be 0 deg long, instead it
> is about -10 deg long). Another problem is this produces lines cutting
> across the window (caused by the map_continents part).

I prefer to use the MAP_SET keyword SCALE to create map projections
which fill a window:

window, /free, xsize=1000, ysize=300
map_set, 0, 180, xmargin=0, ymargin=0, scale=165e6, /mercator
map_continents
map_grid, /label

> This is only part of the problem, when trying to contour some data using
> a similar reprojection, I get lines cutting across the contour plot. I
> thought it might be a missing data problem, so set all missing data to
> !VALUES.F_NAN. No difference.

It might be an artifact of the projection. Try it again using the
projection I suggest above.

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
Re: Horrible map reprojections [message #21638 is a reply to message #21637] Thu, 07 September 2000 08:03 Go to previous message
Ben Marriage is currently offline  Ben Marriage
Messages: 12
Registered: June 1999
Junior Member
Martin Schultz wrote:

> (1) make sure that the "center" longitude is at the center of your
> LIMIT (or at least within and not at the border)
> (2) you can get rid off the silly lines if you omit the clip=0
> keyword.
>
> The following looks ok to me (same version and platform as you have):
> map_set,0,180,limit=[-30,0,30,360],xmar=0,$
> ymar=0,noborder=1,/grid,/iso,/mercator
> map_continents,/hires
>

Thanks Martin, that kinda solves one problem. However, the contour
problem still remains. Take a look at
http://www.met.ed.ac.uk/~aaron/funny_lines.gif. There are lines drawn
from one edge of the plot to the other (the data when filled with the
/cell_fill keyword looks OK), just when a line contour is drawn over the
top, these parallel lines appear. They look to be where the data is
trying to connect one point to the same point, but in a different region
of the plot window?

Thanks,
Ben
Re: Horrible map reprojections [message #21640 is a reply to message #21637] Thu, 07 September 2000 04:01 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Ben Marriage wrote:
>
> Hi all,
>
> IDL> print,!VERSION
> { x86 linux unix 5.3 Nov 11 1999}
>
> I'm trying to set up a particular map reprojection, and get some rather
> horrible results. Can somebody try this on their machine to see if it is
> reproducible please?
>
> window,0,xs=1000,ys=300
> map_set,0,180,0,limit=,xmar=0,$
> ymar=0,noborder=1,/grid,clip=0,/iso,/mercator
> map_continents,/hires
>
> One effect is that the reprojection does not extend all the way to the
> right hand side of the plotting area (should be 0 deg long, instead it
> is about -10 deg long). Another problem is this produces lines cutting
> across the window (caused by the map_continents part).
>
> This is only part of the problem, when trying to contour some data using
> a similar reprojection, I get lines cutting across the contour plot. I
> thought it might be a missing data problem, so set all missing data to
> !VALUES.F_NAN. No difference.
>
> Has anybody else had a similar problem/solution?
>
> Thanks,
> Ben

There are two things wrong here:

(1) make sure that the "center" longitude is at the center of your
LIMIT (or at least within and not at the border)
(2) you can get rid off the silly lines if you omit the clip=0
keyword.

The following looks ok to me (same version and platform as you have):
map_set,0,180,limit=[-30,0,30,360],xmar=0,$
ymar=0,noborder=1,/grid,/iso,/mercator
map_continents,/hires

Cheers,
Martin


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: SOLVED Re: puzzled with WHERE
Next Topic: Re: puzzled with WHERE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 00:12:28 PDT 2025

Total time taken to generate the page: 0.71966 seconds