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

Home » Public Forums » archive » Re: Iso-contours at maximum/minimum levels
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: Iso-contours at maximum/minimum levels [message #64872] Fri, 30 January 2009 11:00 Go to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
David Fanning wrote:
> Paolo writes:
>
>> ii) David is right, but I still think there's an
>> easy way to show the shape of the minimal surface:
>
> Paolo, since you have already conceded, I am not going
> to pour it on, but I never argued that it wasn't easy
> to show the shape of the minimal surface. Only that
> such a shape is not a contour. :-)

Should we call it a boundary then? ;-)

Ciao,
Paolo


>
> But, it seems we are all starting to get our heads
> around this strange example that was so at odds with
> our intuition.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Iso-contours at maximum/minimum levels [message #64873 is a reply to message #64872] Fri, 30 January 2009 07:48 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paolo writes:

> ii) David is right, but I still think there's an
> easy way to show the shape of the minimal surface:

Paolo, since you have already conceded, I am not going
to pour it on, but I never argued that it wasn't easy
to show the shape of the minimal surface. Only that
such a shape is not a contour. :-)

But, it seems we are all starting to get our heads
around this strange example that was so at odds with
our intuition.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Iso-contours at maximum/minimum levels [message #64874 is a reply to message #64873] Fri, 30 January 2009 07:36 Go to previous messageGo to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Hi,

two points:

i) the 12 dots is perfectly fine. It is z that is svcrewed ;-)

I think that if you take a proper example,
you'll see a proper result.

a=dist(512,512)
a[300:400,300:400]=0
contour,a
contour,a,levels=0.001

ii) David is right, but I still think there's an
easy way to show the shape of the minimal surface:

ind=where(a EQ min(a))
b=a*0
b[ind]=1
contour,b,levels=0.5

or somehting like that

Ciao,
Paolo

David Fanning wrote:
> Jeremy Bailin writes:
>
>> Paolo's suggestion makes perfect sense... but then I tried it and I'm
>> befuddled. The minimum contour consists of just a few dots!
>
> Exactly, because of round-off errors, etc., there is nothing
> there, really, to "contour". I think the person who asked
> the question wants an imprint of the minimum value of the
> surface (within some epsilon, obviously). And I continue
> to insist this is *not* the same as a "contour".
>
>> There's something funny about how it's drawing the contour that gets
>> very confused by the abrupt change right at the minimum.
>
> I don't think it is confused. I think it is doing exactly
> what the programmer designed it to do. I think it is our
> thinking about the problem that is confused. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Iso-contours at maximum/minimum levels [message #64875 is a reply to message #64874] Fri, 30 January 2009 07:21 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jeremy Bailin writes:

> Paolo's suggestion makes perfect sense... but then I tried it and I'm
> befuddled. The minimum contour consists of just a few dots!

Exactly, because of round-off errors, etc., there is nothing
there, really, to "contour". I think the person who asked
the question wants an imprint of the minimum value of the
surface (within some epsilon, obviously). And I continue
to insist this is *not* the same as a "contour".

> There's something funny about how it's drawing the contour that gets
> very confused by the abrupt change right at the minimum.

I don't think it is confused. I think it is doing exactly
what the programmer designed it to do. I think it is our
thinking about the problem that is confused. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Iso-contours at maximum/minimum levels [message #64877 is a reply to message #64875] Fri, 30 January 2009 07:04 Go to previous messageGo to next message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jan 29, 6:14 pm, Paolo <pgri...@gmail.com> wrote:
> David Fanning wrote:
>> Gianluca Li Causi writes:
>
>>> In order to find the iso-value lines of a 2D surface I'm using the
>>> CONTOUR procedure, which works very well except that it's NOT ABLE to
>>> compute the contour when the LEVEL equals the maximum or minimum of
>>> the function.
>
>>> I've the following simple fuction:
>>>     Z = shift(dist(100, 100), 50,50)
>>>     Z = abs(Z - max(Z)*.3)
>>> which have a circular minimum at LEVEL=0, but CONTOUR is unable to
>>> find it!
>
> Well, just set your minimum level to min(z)+epsilon,
> where epsilon is a small number (i.e. 0.001 in this case),
> if you have a very flat bottom you need to contour out.
> (but please note that your z does not have a flat bottom,
> so it's a poor example...)
>
> Ciao,
> Paolo
>
>
>
>> According to my colleague Matt, what you should see at the
>> minimum of a contour plot is....nothing! I think I have to
>> agree. A contour line is suppose to enclose something.
>> What could be enclosed at the minimum value of a data set?
>> Right. Nothing.
>
>> You could hold a flat sheet of paper under your 2D surface
>> and draw a line where the surface touched the paper. But
>> the word for that would be an "etching" or an "imprint",
>> not a "contour". What you want, and what a contour plot
>> is designed to give, are two different things. Or at least
>> it seems that way to us. :-)
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>

Paolo's suggestion makes perfect sense... but then I tried it and I'm
befuddled. The minimum contour consists of just a few dots!

There's something funny about how it's drawing the contour that gets
very confused by the abrupt change right at the minimum.

-Jeremy.
Re: Iso-contours at maximum/minimum levels [message #64880 is a reply to message #64877] Thu, 29 January 2009 15:14 Go to previous messageGo to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
David Fanning wrote:
> Gianluca Li Causi writes:
>
>> In order to find the iso-value lines of a 2D surface I'm using the
>> CONTOUR procedure, which works very well except that it's NOT ABLE to
>> compute the contour when the LEVEL equals the maximum or minimum of
>> the function.
>>
>> I've the following simple fuction:
>> Z = shift(dist(100, 100), 50,50)
>> Z = abs(Z - max(Z)*.3)
>> which have a circular minimum at LEVEL=0, but CONTOUR is unable to
>> find it!

Well, just set your minimum level to min(z)+epsilon,
where epsilon is a small number (i.e. 0.001 in this case),
if you have a very flat bottom you need to contour out.
(but please note that your z does not have a flat bottom,
so it's a poor example...)

Ciao,
Paolo


>
> According to my colleague Matt, what you should see at the
> minimum of a contour plot is....nothing! I think I have to
> agree. A contour line is suppose to enclose something.
> What could be enclosed at the minimum value of a data set?
> Right. Nothing.
>
> You could hold a flat sheet of paper under your 2D surface
> and draw a line where the surface touched the paper. But
> the word for that would be an "etching" or an "imprint",
> not a "contour". What you want, and what a contour plot
> is designed to give, are two different things. Or at least
> it seems that way to us. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Iso-contours at maximum/minimum levels [message #64881 is a reply to message #64880] Thu, 29 January 2009 14:51 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Gianluca Li Causi writes:

> In order to find the iso-value lines of a 2D surface I'm using the
> CONTOUR procedure, which works very well except that it's NOT ABLE to
> compute the contour when the LEVEL equals the maximum or minimum of
> the function.
>
> I've the following simple fuction:
> Z = shift(dist(100, 100), 50,50)
> Z = abs(Z - max(Z)*.3)
> which have a circular minimum at LEVEL=0, but CONTOUR is unable to
> find it!

According to my colleague Matt, what you should see at the
minimum of a contour plot is....nothing! I think I have to
agree. A contour line is suppose to enclose something.
What could be enclosed at the minimum value of a data set?
Right. Nothing.

You could hold a flat sheet of paper under your 2D surface
and draw a line where the surface touched the paper. But
the word for that would be an "etching" or an "imprint",
not a "contour". What you want, and what a contour plot
is designed to give, are two different things. Or at least
it seems that way to us. :-)

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Iso-contours at maximum/minimum levels [message #64889 is a reply to message #64881] Thu, 29 January 2009 08:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Gianluca Li Causi writes:

> In order to find the iso-value lines of a 2D surface I'm using the
> CONTOUR procedure, which works very well except that it's NOT ABLE to
> compute the contour when the LEVEL equals the maximum or minimum of
> the function.
>
> I've the following simple fuction:
> Z = shift(dist(100, 100), 50,50)
> Z = abs(Z - max(Z)*.3)
> which have a circular minimum at LEVEL=0, but CONTOUR is unable to
> find it!

Wow! That is one perverse example!

Let me know what you come up with. I'll include it in
the Monsters of IDL Exhibit I'm planning. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Iso-contours at maximum/minimum levels [message #64966 is a reply to message #64872] Mon, 02 February 2009 04:14 Go to previous message
Gianluca Li Causi is currently offline  Gianluca Li Causi
Messages: 21
Registered: August 2005
Junior Member
Dear all,
I thanks you for the interesting discussione and I agree with David
that the word "contour" means a line that "encloses something", but
still you've not given indications for a working "imprint" function,
which is what I need.

The best that I've found, when the function derivatives are
continuous, is to make the contour at level=0 of the partial
derivatives dz/dx and dz/dy, which effectively produce a nice
"imprint" line BUT also contains some extra lines, corresponding to
where one derivative is null but the other is not.

So one could take both the zero contours of the two derivatives and
say that the "imprint" line is the common curve among these two
contours (don't really know how to do this in practice).

In any case this does not work with not continuous derivatives, like
my first example.

How could I search if such an "imprint" function is available anywhere
in the IDL library of somebody? Is there an IDL libraries database
somewhere in the internet?

Cheers
Gianluca
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: @@ Look @@@ Hidden Spy Cams Britney Spears
Next Topic: set map information ERROR, help ,please

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

Current Time: Fri Oct 10 04:47:36 PDT 2025

Total time taken to generate the page: 0.50100 seconds