casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
casa::FlagAgentTimeFreqCrop Class Reference

#include <FlagAgentTimeFreqCrop.h>

Inheritance diagram for casa::FlagAgentTimeFreqCrop:
casa::FlagAgentBase casa::async::Thread

List of all members.

Public Member Functions

 FlagAgentTimeFreqCrop (FlagDataHandler *dh, Record config, Bool writePrivateFlagCube=false, Bool flag=true)
 ~FlagAgentTimeFreqCrop ()

Protected Member Functions

bool computeAntennaPairFlags (const vi::VisBuffer2 &visBuffer, VisMapper &visibilities, FlagMapper &flags, Int antenna1, Int antenna2, vector< uInt > &rows)
 Compute flags for a given (time,freq) map.
void setAgentParameters (Record config)
 Parse configuration parameters.

Private Member Functions

void fitBaseAndFlag (String fittype, String direction, VisMapper &visibilities, FlagMapper &flags)
 Read original flags or not.
Float calcMean (Vector< Float > &vect, Vector< Bool > &flag)
 Calculate Mean, Variance, Stddev while accounting for flags.
Float calcVar (Vector< Float > &vect, Vector< Bool > &flag, Vector< Float > &fit)
Float calcStd (Vector< Float > &vect, Vector< Bool > &flag, Vector< Float > &fit)
Float calcStd (Vector< Float > &vect, Vector< Bool > &flag, Float mean)
void fitPiecewisePoly (Vector< Float > &data, Vector< Bool > &flag, Vector< Float > &fit, uInt maxnpieces, uInt maxdeg)
 Fit a piece-wise polynomial according to the supplied specs.
void polyFit (Vector< Float > &data, Vector< Bool > &flag, Vector< Float > &fit, uInt lim1, uInt lim2, uInt deg)
 Fit a polynomial of specified degree to a range of data points.
void lineFit (Vector< Float > &data, Vector< Bool > &flag, Vector< Float > &fit, uInt lim1, uInt lim2)
 Fit a line to a range of data points.

Private Attributes

Double time_cutoff_p
 Input parameters ///.
Double freq_cutoff_p
 Flag threshold in frequency.
Int maxNPieces_p
 Maximum number of pieces to allow in the piecewise-polynomial fits (1-9)
String timeFitType_p
 Fitting function for the time direction ('line' or 'poly')
String freqFitType_p
 Fitting function for the frequency direction ('line' or 'poly')
String flagDimension_p
 Choose the directions along which to perform flagging ('time', 'freq', 'timefreq', 'freqtime')
Int halfWin_p
 Half width of sliding window to use with 'usewindowstats' (1,2,3 for 3-point, 5-point or 7-point window sizes)
String winStats_p
 Use sliding-window statistics to find additional flags ('none', 'sum', 'std', 'both' )

Detailed Description

Definition at line 30 of file FlagAgentTimeFreqCrop.h.


Constructor & Destructor Documentation

casa::FlagAgentTimeFreqCrop::FlagAgentTimeFreqCrop ( FlagDataHandler dh,
Record  config,
Bool  writePrivateFlagCube = false,
Bool  flag = true 
)

Member Function Documentation

Float casa::FlagAgentTimeFreqCrop::calcMean ( Vector< Float > &  vect,
Vector< Bool > &  flag 
) [private]

Calculate Mean, Variance, Stddev while accounting for flags.

Float casa::FlagAgentTimeFreqCrop::calcStd ( Vector< Float > &  vect,
Vector< Bool > &  flag,
Vector< Float > &  fit 
) [private]
Float casa::FlagAgentTimeFreqCrop::calcStd ( Vector< Float > &  vect,
Vector< Bool > &  flag,
Float  mean 
) [private]
Float casa::FlagAgentTimeFreqCrop::calcVar ( Vector< Float > &  vect,
Vector< Bool > &  flag,
Vector< Float > &  fit 
) [private]
bool casa::FlagAgentTimeFreqCrop::computeAntennaPairFlags ( const vi::VisBuffer2 visBuffer,
VisMapper visibilities,
FlagMapper flags,
Int  antenna1,
Int  antenna2,
vector< uInt > &  rows 
) [protected, virtual]

Compute flags for a given (time,freq) map.

Reimplemented from casa::FlagAgentBase.

void casa::FlagAgentTimeFreqCrop::fitBaseAndFlag ( String  fittype,
String  direction,
VisMapper visibilities,
FlagMapper flags 
) [private]

Read original flags or not.

  Note : original flags are those in the MS (and not those generated by agents)
  True/False 
   Bool usePreFlags_p;

/// TFCROP functions

  Average the data, fit a piecewise polynomial, divide it out, flag outliers.  
void casa::FlagAgentTimeFreqCrop::fitPiecewisePoly ( Vector< Float > &  data,
Vector< Bool > &  flag,
Vector< Float > &  fit,
uInt  maxnpieces,
uInt  maxdeg 
) [private]

Fit a piece-wise polynomial according to the supplied specs.

void casa::FlagAgentTimeFreqCrop::lineFit ( Vector< Float > &  data,
Vector< Bool > &  flag,
Vector< Float > &  fit,
uInt  lim1,
uInt  lim2 
) [private]

Fit a line to a range of data points.

void casa::FlagAgentTimeFreqCrop::polyFit ( Vector< Float > &  data,
Vector< Bool > &  flag,
Vector< Float > &  fit,
uInt  lim1,
uInt  lim2,
uInt  deg 
) [private]

Fit a polynomial of specified degree to a range of data points.

void casa::FlagAgentTimeFreqCrop::setAgentParameters ( Record  config) [protected, virtual]

Parse configuration parameters.

Reimplemented from casa::FlagAgentBase.


Member Data Documentation

Choose the directions along which to perform flagging ('time', 'freq', 'timefreq', 'freqtime')

Definition at line 63 of file FlagAgentTimeFreqCrop.h.

Flag threshold in frequency.

(flag all data-points further than N-stddev from the fit).

Definition at line 54 of file FlagAgentTimeFreqCrop.h.

Fitting function for the frequency direction ('line' or 'poly')

Definition at line 60 of file FlagAgentTimeFreqCrop.h.

Half width of sliding window to use with 'usewindowstats' (1,2,3 for 3-point, 5-point or 7-point window sizes)

Definition at line 66 of file FlagAgentTimeFreqCrop.h.

Maximum number of pieces to allow in the piecewise-polynomial fits (1-9)

Definition at line 56 of file FlagAgentTimeFreqCrop.h.

Input parameters ///.

Flag threshold in time. (flag all data-points further than N-stddev from the fit).

Definition at line 51 of file FlagAgentTimeFreqCrop.h.

Fitting function for the time direction ('line' or 'poly')

Definition at line 58 of file FlagAgentTimeFreqCrop.h.

Use sliding-window statistics to find additional flags ('none', 'sum', 'std', 'both' )

Definition at line 69 of file FlagAgentTimeFreqCrop.h.


The documentation for this class was generated from the following file: