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

A set of time-frequency 'images' which together contain data for one correlated baseline or dish. More...

#include <aoflagger.h>

Public Member Functions

 ImageSet ()
 Construct an empty ImageSet. More...
 
 ImageSet (const ImageSet &sourceImageSet)
 Copy the image set. Only references to images are copied.
 
 ImageSet (ImageSet &&sourceImageSet)
 Move from the image set. More...
 
 ~ImageSet ()
 Destruct image set. Destroys its images if no longer referenced.
 
size_t Antenna1 () const
 
size_t Antenna2 () const
 
size_t Band () const
 
bool HasAntennas () const
 
bool HasBand () const
 
bool HasInterval () const
 
size_t Height () const
 Get height (number of frequency channels) of images.
 
size_t HorizontalStride () const
 Get total number of floats in one row. More...
 
float * ImageBuffer (size_t imageIndex)
 Get access to the data buffer of an image. More...
 
const float * ImageBuffer (size_t imageIndex) const
 Get constant access to the data buffer of an image. More...
 
size_t ImageCount () const
 Get number of images, see class description for details.
 
size_t Interval () const
 
ImageSetoperator= (const ImageSet &sourceImageSet)
 Assign to this image set. Only references to images are copied.
 
ImageSetoperator= (ImageSet &&sourceImageSet)
 Move assign to this image set. More...
 
void ResizeWithoutReallocation (size_t newWidth) const
 Resize the image without reallocating new memory. More...
 
void Set (float newValue)
 Set all samples to the specified value. More...
 
void SetAntennas (size_t antenna1Index, size_t antenna2Index)
 
void SetBand (size_t index)
 
void SetInterval (size_t index)
 
size_t Width () const
 Get width (number of time steps) of images.
 

Friends

class AOFlagger
 
class QualityStatistics
 
class Strategy
 

Detailed Description

A set of time-frequency 'images' which together contain data for one correlated baseline or dish.

The class either holds 1, 2, 4 or 8 images. These images have time on the x-axis (most rapidly changing index) and frequency on the y-axis. The cells specify flux levels, which do not need to have been calibrated.

If the set contains only one image, it specifies amplitudes of a single polarization. If it contains two images, it specifies the real and imaginary parts of a single polarization. With four images, it contains the real and imaginary values of two polarizations (ordered real pol A, imag pol A, real pol B, imag pol B). With eight images, it contains complex values for four correlated polarizations (ordered real pol A, imag pol A, real pol B, ... etc).

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

Constructor & Destructor Documentation

◆ ImageSet() [1/2]

aoflagger::ImageSet::ImageSet ( )

Construct an empty ImageSet.

The only operations allowed on an empty ImageSet are to assign to it. Use AOFlagger::MakeImageSet() to construct a non-empty ImageSet.

◆ ImageSet() [2/2]

aoflagger::ImageSet::ImageSet ( ImageSet &&  sourceImageSet)

Move from the image set.

Since
Version 2.10

Member Function Documentation

◆ HorizontalStride()

size_t aoflagger::ImageSet::HorizontalStride ( ) const

Get total number of floats 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 float in the next row (channel).

Example:

size_t HorizontalStride() const
Get total number of floats in one row.
float * ImageBuffer(size_t imageIndex)
Get access to the data buffer of an image.

will return the value at position x,y.

◆ ImageBuffer() [1/2]

float * aoflagger::ImageSet::ImageBuffer ( size_t  imageIndex)

Get access to the data buffer of an image.

Parameters
imageIndexIndex of image. See class description for ordering.
Note
Rows are padded, see HorizontalStride().

◆ ImageBuffer() [2/2]

const float * aoflagger::ImageSet::ImageBuffer ( size_t  imageIndex) const

Get constant access to the data buffer of an image.

Parameters
imageIndexIndex of image. See class description for ordering.
Note
Rows are padded, see HorizontalStride().

◆ operator=()

ImageSet & aoflagger::ImageSet::operator= ( ImageSet &&  sourceImageSet)

Move assign to this image set.

Since
Version 2.10

◆ ResizeWithoutReallocation()

void aoflagger::ImageSet::ResizeWithoutReallocation ( size_t  newWidth) const

Resize the image without reallocating new memory.

This function allows to quickly change the dimension of the images in the imageset. The new width has to fit in the image capacity as specified during creation. When flagging many images of "almost" the same size, using this method to change the size of images is drastically faster compared to freeing and then allocating new images. It was added after rather severe memory fragmentation problems in the Cotter MWA pipeline.

Parameters
newWidthThe new width of the images. Should satisfy newWidth <= HorizontalStride().
Since
2.5

◆ Set()

void aoflagger::ImageSet::Set ( float  newValue)

Set all samples to the specified value.

Parameters
newValueThe new value for all values of all images in the set.
Since
2.5

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