AOFlagger ImageSet Class Reference
The ImageSet class is a foundational building block of AOFlagger, the radio-frequency interference mitigation platform created by André Offringa. It acts as a container that manages several images—for example Stokes parameters or frequency bands—as one logical unit, so flagging and analysis can be carried out efficiently across the whole collection.
Overview
Within AOFlagger, an ImageSet groups images that share common metadata and are processed together. This abstraction is especially valuable for multi-frequency or multi-polarization data, where flagging choices often rely on how images relate to one another. The class takes care of loading, saving, and accessing individual images while keeping the set consistent throughout.
ImageSet is usually combined with AOFlagger's flagging strategies and quality assessment tools. It lets algorithms work on the entire set without managing each image separately, which simplifies code and lowers the chance of mistakes.
Key Features
- Multi-image management: Store and access several images as a single entity, with indexing and iteration support.
- Metadata handling: Preserve and propagate metadata such as observation parameters, coordinate systems, and units across every image in the set.
- I/O operations: Read from and write to common astronomical image formats, including FITS, with automatic handling of data types and scaling.
- Integration with flagging algorithms: Built to work seamlessly with AOFlagger's flagging strategies so flags are applied consistently across the set.
- Memory efficiency: Lazy loading and caching mechanisms help manage large datasets without excessive memory usage.
Usage Example
The example below shows how to create an ImageSet, load images from FITS files, and apply a simple flagging operation. It is illustrative only and may need adaptation for your specific AOFlagger version and data.
#include <aoflagger/msio/imageset.h>
// Create an ImageSet
aoflagger::ImageSet imageSet;
// Load images from FITS files
imageSet.Load(\"observation.fits\");
// Access the first image
aoflagger::Image& image = imageSet.GetImage(0);
// Apply flagging (using a strategy)
aoflagger::Strategy strategy = aoflagger::Strategy::CreateFromFile(\"strategy.rfis\");
strategy.Run(imageSet);
// Save the flagged images
imageSet.Save(\"flagged.fits\");For detailed API information, consult the class declaration in the AOFlagger source code and the accompanying Doxygen documentation.
Related Classes and Functions
The ImageSet class interacts with several other AOFlagger components:
- Image: Represents a single image within the set, providing pixel access and basic operations.
- Strategy: Defines the flagging algorithm applied to an ImageSet.
- FlagMask: Holds flagging information for an image or a set of images.
- ImageSetReader and ImageSetWriter: Manage input and output for ImageSet objects.
These classes belong to the aoflagger namespace and are documented in the AOFlagger API reference.
Frequently Asked Questions
Working with an ImageSet keeps related images—such as different frequencies or Stokes parameters—organized under shared metadata, so flagging strategies can be applied uniformly. Pair it with the Image, Strategy, and FlagMask classes described above to build a complete AOFlagger workflow.