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

Home » Public Forums » archive » Re: Filled Contour Colors on Maps Incorrect
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: Filled Contour Colors on Maps Incorrect [message #26786] Wed, 26 September 2001 15:20
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "Pavel A. Romashkin" <pavel.romashkin@noaa.gov>
> I am not being a proponent of manuals that seem to be produced using the
> RANDOMU function, but that's kind of manuals we have.

The indexing of them in the Windows help files is kind of quirky too.

But my suggestion to all IDL users is, if you find something confusing in
the IDL documentation, point it out to RSI tech support. They always seem
ready to accept suggestions for improvement. Heck, these days they don't
even snarl too much when you send them in.

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research




--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
Re: Filled Contour Colors on Maps Incorrect [message #26794 is a reply to message #26786] Wed, 26 September 2001 10:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Pavel A. Romashkin (pavel.romashkin@noaa.gov) writes:

> P.S. Someone told me that re-writing and reorganizing the manuals is
> about the worst thing one can be doing. Unappreciated and very
> difficult, and this why the manuals are the way they are. Who told me
> that, now?

Right. I momentarily lost my sense of perspective. It's
been a frustrating couple of days, mostly because the
boys on the tennis team I'm coaching got blistered by
our arch rivals yesterday afternoon. The only bright
stop was my son and his partner whipping the Number 1
team. Guess I was just feeling sorry for myself. I'm
going to kick the dog right now and get over it. :-)

I agree, it's a hard job. (I was just updating my own
index a moment ago. Talk about the pot calling the kettle
black...)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26795 is a reply to message #26794] Wed, 26 September 2001 10:09 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
David Fanning wrote:
>
> P.S. Let's just say if I knew what I was looking for
> I wouldn't even NEED the index!

We are again at the same dilemma here: how nice it would be if it all
was where we'd like it all to be. Since it ain't there but where it is
instead, the next question is - should we still try to look for it
elsewhere? Or complain that it ain't where we'd want it to be?

I am not being a proponent of manuals that seem to be produced using the
RANDOMU function, but that's kind of manuals we have. So any time I get
to a point where I suspect a "bug", I go and re-read the ENTIRE online
help for the routines I use in that code. It doesn't really take much
time (and eventually you get to remember the different keywords, too).
Often, I find answers in some seemingly irrelevant section. Oh well. As
long as the job gets done...

Cheers,
Pavel

P.S. Someone told me that re-writing and reorganizing the manuals is
about the worst thing one can be doing. Unappreciated and very
difficult, and this why the manuals are the way they are. Who told me
that, now?
Re: Filled Contour Colors on Maps Incorrect [message #26796 is a reply to message #26795] Wed, 26 September 2001 09:09 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Martin Downing (martin.downing@ntlworld.com) writes:

> I guess now you can reuse http://www.dfanning.com/test/contour_fill_bug.html
> as an *out take* in your next book!

Unfortunately, this is how books get written,
which is why nobody writes them.

This simple lesson cost me about $1500 in lost
wages and will take about a paragraph to
explain. (In fact, I've already updated by book
for the next printing next month).

Let's see, 234,569 paragraphs times $1500 each.
I guess I'll have to charge about $2354 each for the
book to break even. :-(

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26797 is a reply to message #26796] Wed, 26 September 2001 08:57 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
I guess now you can reuse http://www.dfanning.com/test/contour_fill_bug.html
as an *out take* in your next book!

Martin

"David Fanning" <david@dfanning.com> wrote in message
news:MPG.161ba4b3879561549896ce@news.frii.com...
> Martin Downing (martin.downing@ntlworld.com) writes:
>
>> Funny that RSI considers information that would have prevented this
whole
>> diversion a *tip* :)
>
> And even funnier that it would be in a location where
> you are unlikely to find it when you need it. Somebody
> there at RSI is a real jokester.
>
> Cheers,
>
> David
>
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26798 is a reply to message #26797] Wed, 26 September 2001 08:39 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Martin Downing (martin.downing@ntlworld.com) writes:

> Funny that RSI considers information that would have prevented this whole
> diversion a *tip* :)

And even funnier that it would be in a location where
you are unlikely to find it when you need it. Somebody
there at RSI is a real jokester.

Cheers,

David


--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26799 is a reply to message #26798] Wed, 26 September 2001 08:34 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
"Martin Downing" <martin.downing@ntlworld.com> wrote in message
news:otms7.1126$Vj1.144140@news2-win.server.ntlworld.com...
.....
>
> lats = reverse(lats)
> data = reverse(data, 2)
>
> The example then works fine (and actually gives yet another different
result
> if you just replace /FILL with /CELL_FILL)!

No sorry that was on my hacked around code, with /CELL_FILL you do get the
right answer whether or no the X or Y coords are decreasing.

Martin
Re: Filled Contour Colors on Maps Incorrect [message #26800 is a reply to message #26799] Wed, 26 September 2001 08:27 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
Ok your right enough, its not a bug! Inspired by Reimar's excellent example
of actually reading the manual, I noted that under the CELL_FILL section of
the CONTOUR routine it states:
"Tip - In order for CONTOUR to fill the contours properly when using a map
projection, the X and Y arrays (if supplied) must be arranged in increasing
order. This ensures that the polygons generated will be in counter clockwise
order, as required by the mapping graphics pipeline."

Sure enough David's data had the Y data (LATS) in decreasing order. So all
we need to do to fix David's puzzle is reverse the Y data before the plot
routines:

lats = reverse(lats)
data = reverse(data, 2)

The example then works fine (and actually gives yet another different result
if you just replace /FILL with /CELL_FILL)!

Cheers

Martin
Funny that RSI considers information that would have prevented this whole
diversion a *tip* :)




--
----------------------------------------
Martin Downing,
Clinical Research Physicist,
Orthopaedic RSA Research Centre,
Woodend Hospital, Aberdeen, AB15 6LS.
Tel. 01224 556055 / 07903901612
Fax. 01224 556662

m.downing@abdn.ac.uk

"David Fanning" <david@dfanning.com> wrote in message
news:MPG.161b9484d4bf047b9896cb@news.frii.com...
> Reimar Bauer (r.bauer@fz-juelich.de) writes:
>
>> You should use /CELL_FILL instead of /FILL with maps.
>
> Oh, right. Well, there you go! I learn something
> new nearly every day with IDL. :-)
>
> Thanks, Reimar.
>
> Cheers,
>
> David
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26802 is a reply to message #26800] Wed, 26 September 2001 08:21 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Pavel A. Romashkin (pavel.romashkin@noaa.gov) writes:

> Now you can see that instead of living with nightmares for days all you
> need to do is to type a message to the news group. Then, you get a
> little bit of embarassement because it turns out you did not read the
> manual. Then, it all works and the nightmares are over.

Embarrassed!? Why would I be embarrassed?

Why in the world would I be reading about the
CELL_FILL keyword? I was *using* the FILL keyword
on a MAP PROJECTION. I didn't find *anything* under
those two topics in the documentation concerning my
problem.

No, my dear Pavel, I'm not the one who should
be embarrassed. :-)

Cheers,

David

P.S. Let's just say if I knew what I was looking for
I wouldn't even NEED the index!

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26805 is a reply to message #26802] Wed, 26 September 2001 07:50 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
David Fanning wrote:
>
> Here is a filled-contour-on-a-map-projection problem
> that has been giving me nightmares.

Now you can see that instead of living with nightmares for days all you
need to do is to type a message to the news group. Then, you get a
little bit of embarassement because it turns out you did not read the
manual. Then, it all works and the nightmares are over.
I follow this scheme all the time. The only difference is that I tend to
ask a question before I even have an idea of what I need or want :-)
Cheers,
Pavel
Re: Filled Contour Colors on Maps Incorrect [message #26807 is a reply to message #26805] Wed, 26 September 2001 07:30 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Reimar Bauer (r.bauer@fz-juelich.de) writes:

> You should use /CELL_FILL instead of /FILL with maps.

Oh, right. Well, there you go! I learn something
new nearly every day with IDL. :-)

Thanks, Reimar.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26809 is a reply to message #26807] Wed, 26 September 2001 07:19 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:
>
> Martin Downing (martin.downing@ntlworld.com) writes:
>
>> The CONTOUR bug can be illustrated very well in your code by just switching
>> off /FILL in the first contour call, or trying this to illustrate it:


Sorry this is no bug.

You should use /CELL_FILL instead of /FILL with maps.

CELL_FILL


Because of the handling of missing_data I always use /cell_fill
without maps too.

regards
Reimar








Set this keyword to produce a filled contour plot using a "cell filling"
algorithm. Use this keyword instead of FILL when you are drawing filled
contours over a map, when you have missing data, or when contours that
extend off the edges of the contour plot.
>>
>>
>> Map_Set, 0, 180, /CYLINDRICAL, LIMIT=limit, $
>> Position=[0.1,0.15,0.9,0.9], $
>> Color=white, charsize=2
>> ; edited first call with FILL unset
>> Contour, data, lons, lats, $
>> C_Colors=cn, Color=WHITE, $black, $
>> Max_Value=cmax, Min_Value=cmin, $
>> Levels=clevels, /OVERPLOT
>> wait , 5 ; Time to see that the unfilled contours make sense
>> ; now do the original call:
>> Contour, data, lons, lats, $
>> C_Colors=cn, Color=WHITE, $black, $
>> Max_Value=cmax, Min_Value=cmin, $
>> Levels=clevels, /FILL, /OVERPLOT
>> ; Oh dear - the filled contours have has no relation to the unfilled
>> contours
>
> No, alas. If I try to overplot filled contours
> onto a previously constructed contour plot, the colors
> are correct ONLY if that contour plot is not associated
> with a map projection.
>
> Cheers,
>
> David
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======

read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
Re: Filled Contour Colors on Maps Incorrect [message #26811 is a reply to message #26809] Wed, 26 September 2001 05:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Martin Downing (martin.downing@ntlworld.com) writes:

> The CONTOUR bug can be illustrated very well in your code by just switching
> off /FILL in the first contour call, or trying this to illustrate it:
>
>
> Map_Set, 0, 180, /CYLINDRICAL, LIMIT=limit, $
> Position=[0.1,0.15,0.9,0.9], $
> Color=white, charsize=2
> ; edited first call with FILL unset
> Contour, data, lons, lats, $
> C_Colors=cn, Color=WHITE, $black, $
> Max_Value=cmax, Min_Value=cmin, $
> Levels=clevels, /OVERPLOT
> wait , 5 ; Time to see that the unfilled contours make sense
> ; now do the original call:
> Contour, data, lons, lats, $
> C_Colors=cn, Color=WHITE, $black, $
> Max_Value=cmax, Min_Value=cmin, $
> Levels=clevels, /FILL, /OVERPLOT
> ; Oh dear - the filled contours have has no relation to the unfilled
> contours

No, alas. If I try to overplot filled contours
onto a previously constructed contour plot, the colors
are correct ONLY if that contour plot is not associated
with a map projection.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Filled Contour Colors on Maps Incorrect [message #26812 is a reply to message #26811] Wed, 26 September 2001 03:52 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.161af29e35a9e8be9896c8@news.frii.com...
> Folks,
>
> I have a feeling you map guys are not going to like this
> post. :-(
>
> Here is a filled-contour-on-a-map-projection problem
> that has been giving me nightmares.
>
> I wish to put a filled contour plot on a cylindrical
> map projection. I've read all the articles on that
> Coyote site about filled contours and I am aware of
> all the pitfalls. I have created my own contour intervals,
> and I know exactly which colors I am using for my
> filled contours.
>
> I follow the recommended procedure. I create a map
> projection with Map_Set. I add the filled contour
> command by specifying the data and the vectors of
> latitude and longitude and I use the Contour command
> with the OVERPLOT keyword set. But...
>
> The colors are not right. I know this for two reasons.
> First, I have used exactly the same data set with the
> GrADS software and produced a contour plot that has the
> same contour intervals, but is colored differently.
> Second, I have confirmed that the data is identical
> in both the GrADS and IDL programs.
>

Hi David,
The CONTOUR bug can be illustrated very well in your code by just switching
off /FILL in the first contour call, or trying this to illustrate it:


Map_Set, 0, 180, /CYLINDRICAL, LIMIT=limit, $
Position=[0.1,0.15,0.9,0.9], $
Color=white, charsize=2
; edited first call with FILL unset
Contour, data, lons, lats, $
C_Colors=cn, Color=WHITE, $black, $
Max_Value=cmax, Min_Value=cmin, $
Levels=clevels, /OVERPLOT
wait , 5 ; Time to see that the unfilled contours make sense
; now do the original call:
Contour, data, lons, lats, $
C_Colors=cn, Color=WHITE, $black, $
Max_Value=cmax, Min_Value=cmin, $
Levels=clevels, /FILL, /OVERPLOT
; Oh dear - the filled contours have has no relation to the unfilled
contours


cheers

Martin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: disappearing text - online help widget
Next Topic: OBJECT GRAHPIC BOOKS

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

Current Time: Wed Oct 08 15:23:28 PDT 2025

Total time taken to generate the page: 0.00436 seconds