I find this useful when extracting portions of a data set, similar to polycut. Suppose we have an array, such as a pretrack array, with a bunch of columns:
PTA FLOAT = Array[6, 717892]
Maybe pta(0,*) is the x-coordinate, pta(1,*) is the y-coordinate, and pta(5,*) is the time step. Suppose you want to look at only points between time=0 and time=10. You could do a where command:
IDL> w=where(pta(5,*) ge 0 and pta(5,*) le 10)
However, this is a tiny bit tedious to type. Instead, you can use eclip:
The vector [5,0,10] requests a cut on column #5, accepting values between 0 and 10. So, a tiny bit of typing is saved. However, you can combine several cuts all at once, if you like:
Thus only points for which 0 <= pta(5,*) <= 10 AND 50.0 <= pta(0,*) <= 58.3 AND 1e4 <= pta(2,*) <= 2e4 are used. You can combine up to six different cuts at once. I find this command most useful when I have some pretracked data, and I want to reject bunches of it for some reason.
eclip also takes one keyword, /invert, which then passes all data that would have otherwise been rejected. In other words, define ptd:
Using the previous definition of ptc, note that the union of ptc and ptd is pta (the original array), and the intersection of ptc and ptd is empty. ptd contains points for which pta(5,*) < 0 OR pta(5,*) > 10 OR pta(0,*) < 50 OR ...
The "E" in eclip stands for "Eric" since I wrote it.