CASA Contributed Script: flag reason stats: Difference between revisions

From CASA Guides
Jump to navigationJump to search
(Created page with "== List Flag Statistics for each "Reason" == \Flag_reason_stats.py‎ is a script that can list the statistics of flags in categories of "reason". * Download Script: [[File:F...")
 
No edit summary
Line 4: Line 4:
\Flag_reason_stats.py‎ is a script that can list the statistics of flags in categories of "reason".  
\Flag_reason_stats.py‎ is a script that can list the statistics of flags in categories of "reason".  


* Download Script: [[File:Flag_reason_stats.py‎ Flag_reason_stats.py‎]]
* Download Script: [[File:Flag_reason_stats.py‎‎]]


Here is an example, on a small MS where spw=8 is filled with exact
Here is an example, on a small MS where spw=8 is filled with exact
Line 10: Line 10:
count zeros and RFI separately.
count zeros and RFI separately.


<source lang="python">
<pre style="background-color: #ffe4b5;">
execfile('flag_reason_stats.py');
execfile('flag_reason_stats.py');


Line 24: Line 24:
Summary  0 ( Zeros ) :  Flagged :  274944.0  out of  274944.0
Summary  0 ( Zeros ) :  Flagged :  274944.0  out of  274944.0
Summary  1 ( TFCrop ) :  Flagged :  0.0  out of  274944.0
Summary  1 ( TFCrop ) :  Flagged :  0.0  out of  274944.0
</source>
</pre>

Revision as of 10:17, 28 March 2012

List Flag Statistics for each "Reason"

\Flag_reason_stats.py‎ is a script that can list the statistics of flags in categories of "reason".

Here is an example, on a small MS where spw=8 is filled with exact zeros, spw='9' has RFI, and I want to clip zeros and run tfcrop, and count zeros and RFI separately.

execfile('flag_reason_stats.py');

CASA <17>: countlist = task_reason_stats(msname='Four_ants_3C286.ms',spw='8,9');
Summary  0 ( Zeros ) :  Flagged :  274944.0  out of  549888.0
Summary  1 ( TFCrop ) :  Flagged :  18633.0  out of  549888.0

CASA <18>: countlist = task_reason_stats(msname='Four_ants_3C286.ms',spw='9');
Summary  0 ( Zeros ) :  Flagged :  0.0  out of  274944.0
Summary  1 ( TFCrop ) :  Flagged :  18633.0  out of  274944.0

CASA <19>: countlist = task_reason_stats(msname='Four_ants_3C286.ms',spw='8');
Summary  0 ( Zeros ) :  Flagged :  274944.0  out of  274944.0
Summary  1 ( TFCrop ) :  Flagged :  0.0  out of  274944.0