Similar to eclip, this is useful when extracting portions of a data set. Suppose we have an array, such as a pretrack array, with a bunch of columns:
PTA FLOAT = Array[6, 717892]
Typically pta(0,*) is the x-coordinate, pta(1,*) is the y-coordinate, pta(2,*) is the brightness of the particle, pta(3,*) is the radius of the particle, pta(4,*) is the eccentricity of the particle, and pta(5,*) is the time step. One thing you typically do when you start data analysis is look at the spread of data in (brightness, radius) space:
% ECUT: Draw a convex polygon on the data... % GET_POLYGON: Left Button to add vertex, Right to quit
As you select vertices, a polygon is drawn around your data. The "f1=2,f2=3" commands select fields 2 and 3 as the relevant fields to plot, in other words, the plot command that polycut is using is
where f1 and f2 are defined when you call polycut.
When you are done, a right-click of your mouse closes the
polygon, then the data within the polygon is selected and
returned. Also, the coordinates of the polygon you drew are
2935.66 12.9114 2935.66 8.31852 24465.9 6.80524 37633.2 9.35391 14590.5 12.4070
Also, if you want, you can specify a polygon yourself, and polycut will just proceed using that polygon:
If you include the "mypolygon" variable but it's undefined, then you can proceed as normal (drawing a polygon using the mouse) and then the variable will contain the polygon you have drawn.
John wrote this routine originally in a different context, and Eric modified the core routine into this particular format. Eric added /INVERT and /WHEREFLAG.