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

Home » Public Forums » archive » trigrid + triangulate -> zero values -> ignore zeros on cgcontour
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: trigrid + triangulate -> zero values -> ignore zeros on cgcontour [message #87301 is a reply to message #87300] Thu, 23 January 2014 07:47 Go to previous messageGo to previous message
jkobori19 is currently offline  jkobori19
Messages: 8
Registered: January 2014
Junior Member
On Thursday, January 23, 2014 3:31:24 PM UTC+1, Matthew Argall wrote:
>> it gives an error: CONTOUR: Invalid value specified for keyword LEVELS: No finite elements.
>
>
>
>>> userLevels = IndGen(levels) * step + Min(mx)
>
>
>
> Your "userLevels" do not have any finite elements. Check to see what they are. Perhaps set the /NAN keyword in the Min function.
>
>
>
> IDL> data = dist(256)
>
> IDL> userlevels = indgen(10)
>
> IDL> userlevels = cgscalevector(userlevels, min(data), max(data))
>
> IDL> print, userlevels
>
> 0.00000 20.1133 40.2265 60.3398 80.4530
>
> 100.566 120.680 140.793 160.906 181.019
>
> IDL> cgcontour, data, /fill, LEVELS=userlevels
>
>
>
> IDL> userlevels[3] = !values.f_nan
>
> IDL> cgcontour, data, /fill, LEVELS=userlevels
>
> IDL> userlevels += !values.f_nan
>
> IDL> print, finite(userlevels)
>
> 0 0 0 0 0 0 0 0 0 0
>
> IDL> cgcontour, data, /fill, LEVELS=userlevels
>
> % CONTOUR: Invalid value specified for keyword LEVELS: No
>
> finite elements.
>
> % CONTOUR: Invalid value specified for keyword LEVELS: No
>
> finite elements.
>
> % CONTOUR: Invalid value specified for keyword LEVELS: No
>
> finite elements.

Hi,

actually, for some reason now it doesn't give an error when using missingvalue... And it works fine! I don't know what did I do wrong so far,
but the plot seems to be OK now. I just change the elements of matrix to zero, where the particular value is greater then, let's say, 27,
then applying the missingvalue keyword, and everything looks good!

Thank You very much guys!

Actually, one more thing: when I ignore zeros, there will be less color levels on the plot, since the color corresponding to zero disappears. Is there a solution for this?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How can I change from qwerty keyboard to azerty ?
Next Topic: How to obtain running averages for different time scales in IDL?

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

Current Time: Fri Oct 10 02:37:03 PDT 2025

Total time taken to generate the page: 1.45485 seconds