Re: IDL 8.0 Contour function artifact [message #72561] |
Fri, 24 September 2010 15:39  |
R.G.Stockwell
Messages: 163 Registered: October 2004
|
Senior Member |
|
|
"MC" <moreflaps@gmail.com> wrote in message
news:024c0aea-71d7-4c31-bdc0-82da8e5eb3a1@r10g2000vbc.google groups.com...
> On Sep 25, 4:44 am, Paul <paulsta...@gmail.com> wrote:
>> I've noticed an irritating - I'm going to say it's an artifact - in
>> the new contour function. Take
>>
>> myData = [[32.7759, 30.8012, 27.8589, 24.6717, 22.2133, 20.4595,
>> 19.0960, 18.1344, 17.4240, 16.8068, 16.2542], $
>> [19.7536, 18.1935, 16.3065, 14.5951, 13.7175, 13.4065, 13.3468,
>> 13.6542, 14.1716, 14.7347, 15.3102]]
>> CONTOUR, myData
>> !null = CONTOUR(myData)
>>
>> You get it, too? Ideas? (If you're not seeing it, the contour function
>> on my machines here creates a bit of a jagged mess, while the contour
>> procedure plots nice, smooth lines.)
>
> Correctly contouring such a 'narrow' data set is problematic, if you
> pad the edges by replication, does the output improve? I'm not sure
> but I suspect the problem may be related to the inability to define
> contour curvature when the data is just 2 elements wide?
>
> Hope this helps.
I think that is the problem. I don't think anyone can reasonably expect a
two row vector to be nicely contoured.
A simple rebin
mydata = rebin(mydata,22,4)
reduces that jaggedness. However, it is still present and it is still
worse than the DG contour procedure.
Another very strange thing, in order to directly compare the contour lines,
I used the nlevels (and then n_levels) keywords
and for the NG, it would never draw more than 6 contours, and it always drew
n_levels-2 contours when less than 8.
Very strange.
Even worse, when they both draw 5 contour lines, they are actually very
different (well the first 4 are similar, but
the final one outlining the small dip at the top, appears very different.
cheers,
bob
Here is my minor modification,
myData = [[32.7759, 30.8012, 27.8589, 24.6717, 22.2133, 20.4595, 19.0960,
18.1344, 17.4240, 16.8068, 16.2542], $
[19.7536, 18.1935, 16.3065, 14.5951, 13.7175, 13.4065, 13.3468, 13.6542,
14.1716, 14.7347, 15.3102]]
mydata = rebin(mydata,22,4)
CONTOUR, myData,nlevels=5
!null = CONTOUR(myData,n_levels=7)
end
|
|
|
Re: IDL 8.0 Contour function artifact [message #72563 is a reply to message #72561] |
Fri, 24 September 2010 10:47   |
MC
Messages: 50 Registered: September 1996
|
Member |
|
|
On Sep 25, 4:44 am, Paul <paulsta...@gmail.com> wrote:
> I've noticed an irritating - I'm going to say it's an artifact - in
> the new contour function. Take
>
> myData = [[32.7759, 30.8012, 27.8589, 24.6717, 22.2133, 20.4595,
> 19.0960, 18.1344, 17.4240, 16.8068, 16.2542], $
> [19.7536, 18.1935, 16.3065, 14.5951, 13.7175, 13.4065, 13.3468,
> 13.6542, 14.1716, 14.7347, 15.3102]]
> CONTOUR, myData
> !null = CONTOUR(myData)
>
> You get it, too? Ideas? (If you're not seeing it, the contour function
> on my machines here creates a bit of a jagged mess, while the contour
> procedure plots nice, smooth lines.)
Correctly contouring such a 'narrow' data set is problematic, if you
pad the edges by replication, does the output improve? I'm not sure
but I suspect the problem may be related to the inability to define
contour curvature when the data is just 2 elements wide?
Hope this helps.
|
|
|
Re: IDL 8.0 Contour function artifact [message #72564 is a reply to message #72563] |
Fri, 24 September 2010 10:40   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul writes:
> I've noticed an irritating - I'm going to say it's an artifact - in
> the new contour function. Take
>
> myData = [[32.7759, 30.8012, 27.8589, 24.6717, 22.2133, 20.4595,
> 19.0960, 18.1344, 17.4240, 16.8068, 16.2542], $
> [19.7536, 18.1935, 16.3065, 14.5951, 13.7175, 13.4065, 13.3468,
> 13.6542, 14.1716, 14.7347, 15.3102]]
> CONTOUR, myData
> !null = CONTOUR(myData)
>
> You get it, too? Ideas? (If you're not seeing it, the contour function
> on my machines here creates a bit of a jagged mess, while the contour
> procedure plots nice, smooth lines.)
Ouch!
Another thing I have noticed (I just saw it with this
example). If I make a typing mistake with new graphics
routines (in this case, I just cut and pasted without
accounting for the long line breaks), then fix the
problem and run the code again, either by pasting to
the command line or by running a main IDL program, I'm
pretty sure I am crashing IDL about 50% of the time.
In any case, this is the most fragile version of IDL
I have ever worked on. I know it has crashed at least
5-6 times in the past three days. :-(
I have the impression it is always when working with
objects, but I can't be sure about that.
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: IDL 8.0 Contour function artifact [message #72565 is a reply to message #72564] |
Fri, 24 September 2010 09:58   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
yes I see it. Ugh. It looks like the NG contour is generating extra points in the contour lines that are the source of
the jaggy-ness. If you take out every second point (and squint a bit) in the NG output, the contours appear to agree
with the smoother DG output.
Vierd.
Paul wrote:
> I've noticed an irritating - I'm going to say it's an artifact - in
> the new contour function. Take
>
> myData = [[32.7759, 30.8012, 27.8589, 24.6717, 22.2133, 20.4595,
> 19.0960, 18.1344, 17.4240, 16.8068, 16.2542], $
> [19.7536, 18.1935, 16.3065, 14.5951, 13.7175, 13.4065, 13.3468,
> 13.6542, 14.1716, 14.7347, 15.3102]]
> CONTOUR, myData
> !null = CONTOUR(myData)
>
> You get it, too? Ideas? (If you're not seeing it, the contour function
> on my machines here creates a bit of a jagged mess, while the contour
> procedure plots nice, smooth lines.)
|
|
|
Re: IDL 8.0 Contour function artifact [message #72705 is a reply to message #72561] |
Sat, 25 September 2010 07:55  |
Paul[3]
Messages: 18 Registered: September 2010
|
Junior Member |
|
|
MC,
The small array I posted is a snippet of a much larger array (from a
latitude-height plot. There were a few areas in my latitude-height
plot where the contours were poorly behaved like this. I just took a
small subset of the array that was plotting poorly so it could be
replicated here.
Paul
|
|
|