Go to the documentation of this file.
6 #ifndef AOFLAGGER_INTERFACE_H
7 #define AOFLAGGER_INTERFACE_H
59 static const unsigned NONE;
89 static const unsigned FAST;
196 size_t Width()
const;
223 void Set(
float newValue);
239 ImageSet(
size_t width,
size_t height,
size_t count);
241 ImageSet(
size_t width,
size_t height,
size_t count,
float initialValue);
243 ImageSet(
size_t width,
size_t height,
size_t count,
size_t widthCapacity);
245 ImageSet(
size_t width,
size_t height,
size_t count,
float initialValue,
size_t widthCapacity);
247 static void assertValidCount(
size_t count);
249 class ImageSetData* _data;
305 size_t Width()
const;
331 const bool*
Buffer()
const;
334 FlagMask(
size_t width,
size_t height);
335 FlagMask(
size_t width,
size_t height,
bool initialValue);
337 class FlagMaskData* _data;
373 Strategy(
enum TelescopeId telescopeId,
unsigned strategyFlags,
double frequency=0.0,
double timeRes=0.0,
double frequencyRes=0.0);
375 explicit Strategy(
const std::string& filename);
377 class StrategyData* _data;
443 QualityStatistics(
const double* scanTimes,
size_t nScans,
const double* channelFrequencies,
size_t nChannels,
size_t nPolarizations,
bool computeHistograms);
445 class QualityStatisticsData* _data;
470 virtual void OnStartTask(
size_t taskNo,
size_t taskCount,
const std::string& description)
495 virtual void OnException(std::exception& thrownException) = 0;
584 return ImageSet(width, height, count);
600 return ImageSet(width, height, count, widthCapacity);
613 return ImageSet(width, height, count, initialValue);
628 return ImageSet(width, height, count, initialValue, widthCapacity);
649 return FlagMask(width, height, initialValue);
673 return Strategy(telescopeId, strategyFlags, frequency, timeRes, frequencyRes);
776 static void GetVersion(
short& major,
short& minor,
short& subMinor);
797 _statusListener = statusListener;
807 void operator=(
const AOFlagger&) =
delete;
size_t ImageCount() const
Get number of images, see class description for details.
ImageSet MakeImageSet(size_t width, size_t height, size_t count, float initialValue)
Create a new initialized ImageSet with specified specs.
Definition: aoflagger.h:611
A base class which callers can inherit from to be able to receive progress updates and error messages...
Definition: aoflagger.h:454
~Strategy()
Destruct strategy.
WSRT, the Westerbork Synthesis Radio Telescope in the Netherlands.
Definition: aoflagger.h:41
AOFlagger()
Create and initialize the flagger main class.
Definition: aoflagger.h:568
ImageSet & operator=(const ImageSet &sourceImageSet)
Assign to this image set. Only references to images are copied.
static const unsigned FAST
Optimize for speed at cost of accuracy and robustness.
Definition: aoflagger.h:89
Strategy LoadStrategy(const std::string &filename)
Load a strategy from disk.
Definition: aoflagger.h:684
static const unsigned TRANSIENTS
Make strategy insensitive for transient effect.
Definition: aoflagger.h:78
float * ImageBuffer(size_t imageIndex)
Get access to the data buffer of an image.
void CollectStatistics(QualityStatistics &destination, const ImageSet &imageSet, const FlagMask &rfiFlags, const FlagMask &correlatorFlags, size_t antenna1, size_t antenna2)
Collect statistics from time-frequency images and masks.
virtual ~StatusListener()
Virtual destructor.
Definition: aoflagger.h:460
Parkes, the single dish telescope in New South Wales.
Definition: aoflagger.h:39
FlagMask MakeFlagMask(size_t width, size_t height, bool initialValue)
Create a new initialized FlagMask with specified dimensions.
Definition: aoflagger.h:647
JVLA, the Jansky Very Large Array in New Mexico.
Definition: aoflagger.h:33
Most generic strategy.
Definition: aoflagger.h:27
virtual void OnEndTask()
Called when at the end of the current task.
Definition: aoflagger.h:478
TelescopeId
Strategy identifier for the supported telescopes.
Definition: aoflagger.h:25
Strategy MakeStrategy(enum TelescopeId telescopeId=GENERIC_TELESCOPE, unsigned strategyFlags=StrategyFlags::NONE, double frequency=0.0, double timeRes=0.0, double frequencyRes=0.0)
Initialize a strategy for a specific telescope.
Definition: aoflagger.h:671
size_t Height() const
Get height (number of frequency channels) of images.
Holds a flagging strategy.
Definition: aoflagger.h:348
void Set(float newValue)
Set all samples to the specified value.
Strategy & operator=(const Strategy &sourceStrategy)
Assign to strategy.
static const unsigned SMALL_BANDWIDTH
Observation was made at smaller bandwidth than common.
Definition: aoflagger.h:68
size_t HorizontalStride() const
Get total number of floats in one row.
ImageSet()
Construct an empty ImageSet.
Main class for access to the flagger functionality.
Definition: aoflagger.h:564
void SetStatusListener(StatusListener *statusListener)
Set a handler for progress updates and exceptions.
Definition: aoflagger.h:795
~AOFlagger()
Destructor.
Definition: aoflagger.h:571
ImageSet MakeImageSet(size_t width, size_t height, size_t count)
Create a new uninitialized ImageSet with specified specs.
Definition: aoflagger.h:582
static std::string GetVersionString()
Get the AOFlagger version number as a string.
QualityStatistics & operator+=(const QualityStatistics &rhs)
Combine the statistics from the given object with the statistics in this object.
static const unsigned AUTO_CORRELATION
Erase any flags that are already set.
Definition: aoflagger.h:122
FlagMask & operator=(const FlagMask &source)
Copy assignment.
size_t Width() const
Get width (number of time steps) of images.
size_t Height() const
Get the height of the mask.
MWA, the Murchison Widefield Array in Western Australia.
Definition: aoflagger.h:37
LOFAR. the Low-Frequency Array in Europe.
Definition: aoflagger.h:35
A two-dimensional flag mask.
Definition: aoflagger.h:273
~FlagMask()
Destroy a flag mask. Destroys mask data if no longer references.
void WriteStatistics(const QualityStatistics &statistics, const std::string &measurementSetPath)
Write collected statistics in standard tables to a measurement set.
size_t Width() const
Get the width of the mask.
static const unsigned HIGH_TIME_RESOLUTION
Optimizes for observations with high time resolution.
Definition: aoflagger.h:130
virtual void OnProgress(size_t progress, size_t maxProgress)
Called while the current task is progressing.
Definition: aoflagger.h:487
static const unsigned ROBUST
Increase robustness by decreasing convergence speed.
Definition: aoflagger.h:86
size_t HorizontalStride() const
Get total number of bools in one row.
ImageSet MakeImageSet(size_t width, size_t height, size_t count, float initialValue, size_t widthCapacity)
Create a new initialized ImageSet with specified specs.
Definition: aoflagger.h:626
~QualityStatistics()
Destruct the object. Data is destroyed if no more references exist.
virtual void OnException(std::exception &thrownException)=0
Called when an exception occurs during execution of the strategy.
bool * Buffer()
Get access to the data buffer.
Lists the flags that can be used to alter a default strategy.
Definition: aoflagger.h:55
static void GetVersion(short &major, short &minor, short &subMinor)
Get the AOFlagger version number separated in major, minor and subminor fields.
static const unsigned INSENSITIVE
Make the strategy less sensitive to RFI than the default telescope settings.
Definition: aoflagger.h:97
Statistics that can be collected online and saved to a measurement set.
Definition: aoflagger.h:400
ImageSet MakeImageSet(size_t width, size_t height, size_t count, size_t widthCapacity)
Create a new uninitialized ImageSet with specified specs.
Definition: aoflagger.h:598
QualityStatistics MakeQualityStatistics(const double *scanTimes, size_t nScans, const double *channelFrequencies, size_t nChannels, size_t nPolarizations)
Create a new object for collecting statistics.
The AARTFAAC telescope, correlating the superterp antennas of LOFAR.
Definition: aoflagger.h:43
FlagMask MakeFlagMask(size_t width, size_t height)
Create a new uninitialized FlagMask with specified dimensions.
Definition: aoflagger.h:636
virtual void OnStartTask(size_t taskNo, size_t taskCount, const std::string &description)
This virtual method is called when a new task is started.
Definition: aoflagger.h:470
static const unsigned LARGE_BANDWIDTH
Observation was made at larger bandwidth than common.
Definition: aoflagger.h:65
~ImageSet()
Destruct image set. Destroys its images if no longer referenced.
static std::string GetVersionDate()
Get the date this version was released as a string.
QualityStatistics & operator=(const QualityStatistics &sourceQS)
Assign to this object. This is fast; only references are copied.
static const unsigned SENSITIVE
Make the strategy more sensitive to RFI than the default telescope settings.
Definition: aoflagger.h:106
void ResizeWithoutReallocation(size_t newWidth) const
Resize the image without reallocating new memory.
static const unsigned USE_ORIGINAL_FLAGS
Will assume that the original flags that are already set in the observation denote bad data and shoul...
Definition: aoflagger.h:112
Strategy(const Strategy &sourceStrategy)
Create a copy of a strategy.
FlagMask()
Construct an empty FlagMask. The properties of empty FlagMask can not be accessed.
static const unsigned NONE
No flags: use the default strategy for the telescope.
Definition: aoflagger.h:59
Bighorns, instrument aimed at achieving an averaged all-sky measurement of the Epoch of Reionisation ...
Definition: aoflagger.h:31
A set of time-frequency 'images' which together contain data for one correlated baseline or dish.
Definition: aoflagger.h:156
Contains all the public types used by the AOFlagger.
Definition: aoflagger.h:17
Arecibo radio telescope, the 305 m telescope in Puerto Rico.
Definition: aoflagger.h:29
FlagMask Run(Strategy &strategy, const ImageSet &input)
Run the flagging strategy on the given data.