AOFlagger
|
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 |
ImageSet & | operator= (const ImageSet &sourceImageSet) |
Assign to this image set. Only references to images are copied. | |
ImageSet & | operator= (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 |
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).
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.
aoflagger::ImageSet::ImageSet | ( | ImageSet && | sourceImageSet | ) |
Move from the image set.
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:
will return the value at position x,y.
float * aoflagger::ImageSet::ImageBuffer | ( | size_t | imageIndex | ) |
Get access to the data buffer of an image.
imageIndex | Index of image. See class description for ordering. |
const float * aoflagger::ImageSet::ImageBuffer | ( | size_t | imageIndex | ) | const |
Get constant access to the data buffer of an image.
imageIndex | Index of image. See class description for ordering. |
Move assign to this image set.
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.
newWidth | The new width of the images. Should satisfy newWidth <= HorizontalStride(). |
void aoflagger::ImageSet::Set | ( | float | newValue | ) |
Set all samples to the specified value.
newValue | The new value for all values of all images in the set. |