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

Home » Public Forums » archive » gridding XYZ to surface: how to blank no data?
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
gridding XYZ to surface: how to blank no data? [message #87563] Sat, 15 February 2014 07:05 Go to next message
paulartcoelho is currently offline  paulartcoelho
Messages: 30
Registered: March 2007
Member
hello there,

i've been using the excellent post by David at https://www.idlcoyote.com/tips/grid_surface.html to show a bunch of XYZ data as contour plots.

there is a detail i didn't manage to solve though. there are combinations of XY in the original table where there are no data (at all, i don't mean Z=0), which is at the end plotted in the contour as if Z=0 (understandably).

but i would like to show these regions in the contour plot as non-existent, to differentiate from "true Z=0" regions.

in other words, in my final contour plot, i'd like to show true Z=0 values as a certain color, the minimum of the color table i adopt, but non-existant XY values as blank white.

any advice?

many thanks,
Paula
Re: gridding XYZ to surface: how to blank no data? [message #87564 is a reply to message #87563] Sat, 15 February 2014 07:09 Go to previous messageGo to next message
paulartcoelho is currently offline  paulartcoelho
Messages: 30
Registered: March 2007
Member
ah! i've found a similar thing at this post
https://groups.google.com/forum/#!topic/comp.lang.idl-pvwave /Dn6f1D8rD3g
sorry for posting before googling, i will try it out.
p.
Re: gridding XYZ to surface: how to blank no data? [message #87569 is a reply to message #87563] Sat, 15 February 2014 07:52 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paula writes:

> i've been using the excellent post by David at https://www.idlcoyote.com/tips/grid_surface.html to show a bunch of XYZ data as contour plots.
>
> there is a detail i didn't manage to solve though. there are combinations of XY in the original table where there are no data (at all, i don't mean Z=0), which is at the end plotted in the contour as if Z=0 (understandably).
>
> but i would like to show these regions in the contour plot as non-existent, to differentiate from "true Z=0" regions.
>
> in other words, in my final contour plot, i'd like to show true Z=0 values as a certain color, the minimum of the color table i adopt, but non-existant XY values as blank white.
>
> any advice?

This really shouldn't take any effort at all. Set the missing data
points to !Values.F_NAN. (Make sure your array is floating type before
you do this.) Use the CELL_FILL keyword on your contour command NOT the
FILL keyword. The rest should happen automatically:

data = cgDemoData(2)
cgLoadCT, 33
cgDisplay, WID=0
cgContour, data, /FILL, /OUTLINE

missing = RandomU(-3L, 10) * 41 * 41L
data[missing] = !Values.F_NaN
cgDisplay, WID=1
cgContour, data, /CELL_FILL, /OUTLINE

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: gridding XYZ to surface: how to blank no data? [message #87622 is a reply to message #87569] Tue, 18 February 2014 18:52 Go to previous message
paulartcoelho is currently offline  paulartcoelho
Messages: 30
Registered: March 2007
Member
right!
adding MISSING = !Values.F_NaN to TRIGRID and changing FILL by CELL_FILL in cgContour did the trick.
many thx.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Map Projection Clarification
Next Topic: read a multi-line string in IDL? or, read numeric values sequentially without automatic <CR>?

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

Current Time: Wed Oct 08 13:51:29 PDT 2025

Total time taken to generate the page: 0.00449 seconds