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

Home » Public Forums » archive » Can i use CONTOUR to retrieve the subscripts within a closed contour?
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
Can i use CONTOUR to retrieve the subscripts within a closed contour? [message #93138] Sun, 01 May 2016 06:22 Go to next message
Beate is currently offline  Beate
Messages: 1
Registered: May 2016
Junior Member
Hi,
I use CONTOUR with the arguments path_info, path_xy, /path_data_coords and /closed to retrieve the subscripts of the closed contours.

Example:
contour, scl256img, levels=[80,130], path_info=info, path_xy=xy, /closed, /path_data_coords
npatch = n_elements(info) ; number of patches
for i = 0, (npatch-1) do begin ; loop over contours
s = [indgen(info(i).n), 0]
contourpath2D = xy[*, info(i).offset + s]
endfor

Q:
Can i use CONTOUR in a similar way to also retrieve the subscripts within the closed contours? Or is there another IDL procedure or function that can help me with this?

Thanks!
Re: Can i use CONTOUR to retrieve the subscripts within a closed contour? [message #93143 is a reply to message #93138] Mon, 02 May 2016 10:41 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Sunday, May 1, 2016 at 8:22:04 AM UTC-5, Beate wrote:
> Hi,
> I use CONTOUR with the arguments path_info, path_xy, /path_data_coords and /closed to retrieve the subscripts of the closed contours.
>
> Example:
> contour, scl256img, levels=[80,130], path_info=info, path_xy=xy, /closed, /path_data_coords
> npatch = n_elements(info) ; number of patches
> for i = 0, (npatch-1) do begin ; loop over contours
> s = [indgen(info(i).n), 0]
> contourpath2D = xy[*, info(i).offset + s]
> endfor
>
> Q:
> Can i use CONTOUR in a similar way to also retrieve the subscripts within the closed contours? Or is there another IDL procedure or function that can help me with this?
>
> Thanks!

Rather than using CONTOUR, the easiest way is to just use a simple WHERE:

label_by_contour_level = VALUE_LOCATE([80, 130], scl256image)
above_130 = WHERE(label_by_contour_level eq 1)
between_80_and_130 = WHERE(label_by_contour_level eq 0)
below_80 = WHERE(label_by_contour_level eq -1)

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Problems on the Savitzky-Golay smoothing filter
Next Topic: plot String data

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

Current Time: Wed Oct 08 13:37:44 PDT 2025

Total time taken to generate the page: 0.00561 seconds