AOFlagger
Public Member Functions | Friends | List of all members
aoflagger::FlagMask Class Reference

A two-dimensional flag mask. More...

#include <aoflagger.h>

Public Member Functions

 FlagMask ()
 Construct an empty FlagMask. The properties of an empty FlagMask can not be accessed.
 
 FlagMask (const FlagMask &sourceMask)
 Copy a flag mask. Only copies a reference, not the data.
 
 FlagMask (FlagMask &&sourceMask)
 Move construct a flag mask. More...
 
 ~FlagMask ()
 Destroy a flag mask. Destroys mask data if no longer references.
 
bool * Buffer ()
 Get access to the data buffer. More...
 
const bool * Buffer () const
 Get constant access to the data buffer. More...
 
size_t Height () const
 Get the height of the mask.
 
size_t HorizontalStride () const
 Get total number of bools in one row. More...
 
FlagMaskoperator= (const FlagMask &source)
 Copy assignment. More...
 
FlagMaskoperator= (FlagMask &&source)
 Move assignment. More...
 
size_t Width () const
 Get the width of the mask.
 

Friends

class AOFlagger
 
class QualityStatistics
 
class Strategy
 

Detailed Description

A two-dimensional flag mask.

The flag mask specifies which values in an ImageSet are flagged. A value true means a value is flagged, i.e., contains RFI and should not be used in further data processing (calibration, imaging, etc.). A flag denotes that the value at that time-frequency position should be ignored for all polarizations. This normally makes sense, because if one polarization is contaminated by RFI, all polarizations are probably affected. Also, solving for Stokes matrices during calibration might not work well when the polarizations are not flagged equally.

If polarization-specific flags are needed, one could run the flagger on each polarization individually. However, note that some algorithms, like the morphological scale-invariant rank operator (SIR operator), work best when seeing the flags from all polarizations.

Note
When accesses the flag data, note that there might be more items on one row than the width of the mask. The rows are padded to align them e.g. for SSE instructions. Use HorizontalStride() to get the actual number of bools per row.

Constructor & Destructor Documentation

◆ FlagMask()

aoflagger::FlagMask::FlagMask ( FlagMask &&  sourceMask)

Move construct a flag mask.

Since
Version 2.10

Member Function Documentation

◆ Buffer() [1/2]

bool * aoflagger::FlagMask::Buffer ( )

Get access to the data buffer.

Note
The buffer is padded, see HorizontalStride().

◆ Buffer() [2/2]

const bool * aoflagger::FlagMask::Buffer ( ) const

Get constant access to the data buffer.

Note
The buffer is padded, see HorizontalStride().

◆ HorizontalStride()

size_t aoflagger::FlagMask::HorizontalStride ( ) const

Get total number of bools in one row.

Row might have been padded to allow for SSE instructions and other optimizations. Therefore, one should add the horizontal stride to a data pointer to get the flags in the next row (channel).

Example:

*(FlagMask::Buffer() + x + y * Buffer::HorizontalStride())
bool * Buffer()
Get access to the data buffer.

will return the flag value at position x,y.

◆ operator=() [1/2]

FlagMask & aoflagger::FlagMask::operator= ( const FlagMask source)

Copy assignment.

Since
Version 2.10

◆ operator=() [2/2]

FlagMask & aoflagger::FlagMask::operator= ( FlagMask &&  source)

Move assignment.

Since
Version 2.10

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