summaryrefslogtreecommitdiffstats
path: root/funtools/faq/faq4.html
blob: 7e384a7ab44ec66b7753e2d9a32fd5e3bd8f77de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<html><head><title>Funtools FAQ: Filtering</title></head>
<p>
NB: column filters work on tables only. Regions work on tables and images.

<p>
<ol>
<li><a name="faq1"><b>Please show how to use column and regions filters</b></a>

<p>
<ol>
<li> Filter events through a circular region using physical pixels
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,.5)]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   6   7     79493997.45854475  578  574
 512  512   8   9     79494575.58943175  579  573
 512  512   5   6     79493631.03866175  578  575
 512  512   5   5     79493290.86521725  578  575
 512  512   8   9     79493432.00990875  579  573
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region, for a single value of pha
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle 512 512 .5 && pha==5]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   5   6     79493631.03866175  578  575
 512  512   5   5     79493290.86521725  578  575
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region, including a range of pha values
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,.5)&&pha=5:6]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   6   7     79493997.45854475  578  574
 512  512   5   6     79493631.03866175  578  575
 512  512   5   5     79493290.86521725  578  575
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region, excluding a range of pha values
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,.5)&&\!pha=5:6]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   8   9     79494575.58943175  579  573
 512  512   8   9     79493432.00990875  579  573
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through two circular regions
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,.5); circle 500 500 .1]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 500  500   5   5     79493733.05197725  600  577
 500  500   9   9     79488217.13936825  600  576
 500  500   2   2     79487590.99904275  599  581
 512  512   6   7     79493997.45854475  578  574
 512  512   8   9     79494575.58943175  579  573
 512  512   5   6     79493631.03866175  578  575
 512  512   5   5     79493290.86521725  578  575
 512  512   8   9     79493432.00990875  579  573
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region, selecting a single time value
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,.5)&&time==79493631.03866175]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   5   6     79493631.03866175  578  575
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region, selecting a single time value
(but using feq to avoid possible precision problems)
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,.5)&&feq(time,79493631.03866175)]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   5   6     79493631.03866175  578  575
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region, while excluding an inner circle
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,1);-cir 512 512 .5]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  511   9   9     79492909.11908525  580  572
 512  511   6   7     79492607.35239075  580  573
 512  511   6   7     79493574.08603576  580  573
 512  511   7   8     79488537.75487424  579  572
 511  512   5   5     79488781.64644176  579  576
 511  512   5   6     79492586.05470325  579  576
 511  512  10  10     79494397.55842775  580  574
 511  512   1   2     79493697.87522624  577  582
 511  512   6   7     79493997.75123225  579  575
 511  512  10  11     79487417.67703976  579  574
 513  512   6   6     79493306.47509325  578  573
 513  512   8   8     79487909.39373726  578  572
 512  513   4   4     79487403.52010125  576  577
 512  513   8   9     79492536.31151475  577  574
 512  513  10  10     79492589.71195325  578  574
 512  513   5   5     79488335.19512025  576  575
 512  513   8   8     79493661.25728776  578  574
 512  513   8   9     79487914.98186225  577  574
 512  513   5   5     79487392.91247626  577  576
 512  513   4   4     79492808.24789475  577  576
 512  513   7   8     79493236.90765475  577  574
 512  513   6   7     79493667.65710025  578  574
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region for a range of pha, while excluding an inner circle
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,1)&&pha=6:7;-cir 512 512 .5]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  511   6   7     79492607.35239075  580  573
 512  511   6   7     79493574.08603576  580  573
 512  511   7   8     79488537.75487424  579  572
 511  512   6   7     79493997.75123225  579  575
 513  512   6   6     79493306.47509325  578  573
 512  513   7   8     79493236.90765475  577  574
 512  513   6   7     79493667.65710025  578  574
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region for ranges of pha and pi, while excluding an inner circle
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[circle(512,512,1)&&pha=5:7 && pi=6:8;-cir 512 512 .5]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  511   6   7     79492607.35239075  580  573
 512  511   6   7     79493574.08603576  580  573
 512  511   7   8     79488537.75487424  579  572
 511  512   5   6     79492586.05470325  579  576
 511  512   6   7     79493997.75123225  579  575
 513  512   6   6     79493306.47509325  578  573
 512  513   7   8     79493236.90765475  577  574
 512  513   6   7     79493667.65710025  578  574
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region in fk5 coords (degrees)
<BLOCKQUOTE><CODE>
<PRE>
fundisp foo.fits'[fk5;circle(345.25391,58.879774,3.9999997")]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   6   7     79493997.45854475  578  574
 512  512   8   9     79494575.58943175  579  573
 512  512   5   6     79493631.03866175  578  575
 512  512   5   5     79493290.86521725  578  575
 512  512   8   9     79493432.00990875  579  573
</PRE>
</CODE></BLOCKQUOTE>

<li> Filter events through a circular region retrieved from ds9
<BLOCKQUOTE><CODE>
<PRE>
cat foo.reg
# Region file format: DS9 version 4.0
# Filename: foo.fits'[EVENTS]'
global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
fk5
circle(345.25391,58.879774,3.9999997")

fundisp foo.fits'[@foo.reg]'
 
   X    Y PHA  PI                  TIME   DX   DY
---- ---- --- --- --------------------- ---- ----
 512  512   6   7     79493997.45854475  578  574
 512  512   8   9     79494575.58943175  579  573
 512  512   5   6     79493631.03866175  578  575
 512  512   5   5     79493290.86521725  578  575
 512  512   8   9     79493432.00990875  579  573

</PRE>
</CODE></BLOCKQUOTE>

</ol>

</ol>