"Fossies" - the Fresh Open Source Software Archive

Member "SAOImageDS9/funtools/faq/faq4.html" (13 Nov 2019, 7428 Bytes) of package /linux/misc/ds9.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <html><head><title>Funtools FAQ: Filtering</title></head>
    2 <p>
    3 NB: column filters work on tables only. Regions work on tables and images.
    4 
    5 <p>
    6 <ol>
    7 <li><a name="faq1"><b>Please show how to use column and regions filters</b></a>
    8 
    9 <p>
   10 <ol>
   11 <li> Filter events through a circular region using physical pixels
   12 <BLOCKQUOTE><CODE>
   13 <PRE>
   14 fundisp foo.fits'[circle(512,512,.5)]'
   15  
   16    X    Y PHA  PI                  TIME   DX   DY
   17 ---- ---- --- --- --------------------- ---- ----
   18  512  512   6   7     79493997.45854475  578  574
   19  512  512   8   9     79494575.58943175  579  573
   20  512  512   5   6     79493631.03866175  578  575
   21  512  512   5   5     79493290.86521725  578  575
   22  512  512   8   9     79493432.00990875  579  573
   23 </PRE>
   24 </CODE></BLOCKQUOTE>
   25 
   26 <li> Filter events through a circular region, for a single value of pha
   27 <BLOCKQUOTE><CODE>
   28 <PRE>
   29 fundisp foo.fits'[circle 512 512 .5 && pha==5]'
   30  
   31    X    Y PHA  PI                  TIME   DX   DY
   32 ---- ---- --- --- --------------------- ---- ----
   33  512  512   5   6     79493631.03866175  578  575
   34  512  512   5   5     79493290.86521725  578  575
   35 </PRE>
   36 </CODE></BLOCKQUOTE>
   37 
   38 <li> Filter events through a circular region, including a range of pha values
   39 <BLOCKQUOTE><CODE>
   40 <PRE>
   41 fundisp foo.fits'[circle(512,512,.5)&&pha=5:6]'
   42  
   43    X    Y PHA  PI                  TIME   DX   DY
   44 ---- ---- --- --- --------------------- ---- ----
   45  512  512   6   7     79493997.45854475  578  574
   46  512  512   5   6     79493631.03866175  578  575
   47  512  512   5   5     79493290.86521725  578  575
   48 </PRE>
   49 </CODE></BLOCKQUOTE>
   50 
   51 <li> Filter events through a circular region, excluding a range of pha values
   52 <BLOCKQUOTE><CODE>
   53 <PRE>
   54 fundisp foo.fits'[circle(512,512,.5)&&\!pha=5:6]'
   55  
   56    X    Y PHA  PI                  TIME   DX   DY
   57 ---- ---- --- --- --------------------- ---- ----
   58  512  512   8   9     79494575.58943175  579  573
   59  512  512   8   9     79493432.00990875  579  573
   60 </PRE>
   61 </CODE></BLOCKQUOTE>
   62 
   63 <li> Filter events through two circular regions
   64 <BLOCKQUOTE><CODE>
   65 <PRE>
   66 fundisp foo.fits'[circle(512,512,.5); circle 500 500 .1]'
   67  
   68    X    Y PHA  PI                  TIME   DX   DY
   69 ---- ---- --- --- --------------------- ---- ----
   70  500  500   5   5     79493733.05197725  600  577
   71  500  500   9   9     79488217.13936825  600  576
   72  500  500   2   2     79487590.99904275  599  581
   73  512  512   6   7     79493997.45854475  578  574
   74  512  512   8   9     79494575.58943175  579  573
   75  512  512   5   6     79493631.03866175  578  575
   76  512  512   5   5     79493290.86521725  578  575
   77  512  512   8   9     79493432.00990875  579  573
   78 </PRE>
   79 </CODE></BLOCKQUOTE>
   80 
   81 <li> Filter events through a circular region, selecting a single time value
   82 <BLOCKQUOTE><CODE>
   83 <PRE>
   84 fundisp foo.fits'[circle(512,512,.5)&&time==79493631.03866175]'
   85  
   86    X    Y PHA  PI                  TIME   DX   DY
   87 ---- ---- --- --- --------------------- ---- ----
   88  512  512   5   6     79493631.03866175  578  575
   89 </PRE>
   90 </CODE></BLOCKQUOTE>
   91 
   92 <li> Filter events through a circular region, selecting a single time value
   93 (but using feq to avoid possible precision problems)
   94 <BLOCKQUOTE><CODE>
   95 <PRE>
   96 fundisp foo.fits'[circle(512,512,.5)&&feq(time,79493631.03866175)]'
   97  
   98    X    Y PHA  PI                  TIME   DX   DY
   99 ---- ---- --- --- --------------------- ---- ----
  100  512  512   5   6     79493631.03866175  578  575
  101 </PRE>
  102 </CODE></BLOCKQUOTE>
  103 
  104 <li> Filter events through a circular region, while excluding an inner circle
  105 <BLOCKQUOTE><CODE>
  106 <PRE>
  107 fundisp foo.fits'[circle(512,512,1);-cir 512 512 .5]'
  108  
  109    X    Y PHA  PI                  TIME   DX   DY
  110 ---- ---- --- --- --------------------- ---- ----
  111  512  511   9   9     79492909.11908525  580  572
  112  512  511   6   7     79492607.35239075  580  573
  113  512  511   6   7     79493574.08603576  580  573
  114  512  511   7   8     79488537.75487424  579  572
  115  511  512   5   5     79488781.64644176  579  576
  116  511  512   5   6     79492586.05470325  579  576
  117  511  512  10  10     79494397.55842775  580  574
  118  511  512   1   2     79493697.87522624  577  582
  119  511  512   6   7     79493997.75123225  579  575
  120  511  512  10  11     79487417.67703976  579  574
  121  513  512   6   6     79493306.47509325  578  573
  122  513  512   8   8     79487909.39373726  578  572
  123  512  513   4   4     79487403.52010125  576  577
  124  512  513   8   9     79492536.31151475  577  574
  125  512  513  10  10     79492589.71195325  578  574
  126  512  513   5   5     79488335.19512025  576  575
  127  512  513   8   8     79493661.25728776  578  574
  128  512  513   8   9     79487914.98186225  577  574
  129  512  513   5   5     79487392.91247626  577  576
  130  512  513   4   4     79492808.24789475  577  576
  131  512  513   7   8     79493236.90765475  577  574
  132  512  513   6   7     79493667.65710025  578  574
  133 </PRE>
  134 </CODE></BLOCKQUOTE>
  135 
  136 <li> Filter events through a circular region for a range of pha, while excluding an inner circle
  137 <BLOCKQUOTE><CODE>
  138 <PRE>
  139 fundisp foo.fits'[circle(512,512,1)&&pha=6:7;-cir 512 512 .5]'
  140  
  141    X    Y PHA  PI                  TIME   DX   DY
  142 ---- ---- --- --- --------------------- ---- ----
  143  512  511   6   7     79492607.35239075  580  573
  144  512  511   6   7     79493574.08603576  580  573
  145  512  511   7   8     79488537.75487424  579  572
  146  511  512   6   7     79493997.75123225  579  575
  147  513  512   6   6     79493306.47509325  578  573
  148  512  513   7   8     79493236.90765475  577  574
  149  512  513   6   7     79493667.65710025  578  574
  150 </PRE>
  151 </CODE></BLOCKQUOTE>
  152 
  153 <li> Filter events through a circular region for ranges of pha and pi, while excluding an inner circle
  154 <BLOCKQUOTE><CODE>
  155 <PRE>
  156 fundisp foo.fits'[circle(512,512,1)&&pha=5:7 && pi=6:8;-cir 512 512 .5]'
  157  
  158    X    Y PHA  PI                  TIME   DX   DY
  159 ---- ---- --- --- --------------------- ---- ----
  160  512  511   6   7     79492607.35239075  580  573
  161  512  511   6   7     79493574.08603576  580  573
  162  512  511   7   8     79488537.75487424  579  572
  163  511  512   5   6     79492586.05470325  579  576
  164  511  512   6   7     79493997.75123225  579  575
  165  513  512   6   6     79493306.47509325  578  573
  166  512  513   7   8     79493236.90765475  577  574
  167  512  513   6   7     79493667.65710025  578  574
  168 </PRE>
  169 </CODE></BLOCKQUOTE>
  170 
  171 <li> Filter events through a circular region in fk5 coords (degrees)
  172 <BLOCKQUOTE><CODE>
  173 <PRE>
  174 fundisp foo.fits'[fk5;circle(345.25391,58.879774,3.9999997")]'
  175  
  176    X    Y PHA  PI                  TIME   DX   DY
  177 ---- ---- --- --- --------------------- ---- ----
  178  512  512   6   7     79493997.45854475  578  574
  179  512  512   8   9     79494575.58943175  579  573
  180  512  512   5   6     79493631.03866175  578  575
  181  512  512   5   5     79493290.86521725  578  575
  182  512  512   8   9     79493432.00990875  579  573
  183 </PRE>
  184 </CODE></BLOCKQUOTE>
  185 
  186 <li> Filter events through a circular region retrieved from ds9
  187 <BLOCKQUOTE><CODE>
  188 <PRE>
  189 cat foo.reg
  190 # Region file format: DS9 version 4.0
  191 # Filename: foo.fits'[EVENTS]'
  192 global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
  193 fk5
  194 circle(345.25391,58.879774,3.9999997")
  195 
  196 fundisp foo.fits'[@foo.reg]'
  197  
  198    X    Y PHA  PI                  TIME   DX   DY
  199 ---- ---- --- --- --------------------- ---- ----
  200  512  512   6   7     79493997.45854475  578  574
  201  512  512   8   9     79494575.58943175  579  573
  202  512  512   5   6     79493631.03866175  578  575
  203  512  512   5   5     79493290.86521725  578  575
  204  512  512   8   9     79493432.00990875  579  573
  205 
  206 </PRE>
  207 </CODE></BLOCKQUOTE>
  208 
  209 </ol>
  210 
  211 </ol>