flint.leakage¶
Construct a leakge map between two polarisations, typically V/I
Attributes¶
Classes¶
Container to couple FITS header, image and WCS |
|
Description of the filtering options to apply to components |
|
Slim container to help collect and maintain pixel coordinates. Not intended for extensive use |
|
Simple container for statistics around the extraction of leakage polarisation statistics |
Functions¶
|
Create the output leakage catalogue name |
|
Return a table given either a loaded table or a path to a table on disk |
|
Load in a FITS image and package the components into a consistent |
|
|
|
Create a component catalogue that includes enough information to describe the |
|
Construct two boxes around nominated pixel coordinates to: |
|
Apply the pre-processing operations to catalogue components to select an |
|
|
|
Convert (RA, Dec) positions in a catalogue into (x, y)-pixels given an WCS |
|
Load in a component catalogue table and apply filters to them. The |
Module Contents¶
- class flint.leakage.FITSImage[source]¶
Bases:
NamedTupleContainer to couple FITS header, image and WCS
- class flint.leakage.LeakageFilters[source]¶
Bases:
NamedTupleDescription of the filtering options to apply to components when characterising leakage
- class flint.leakage.PixelCoords[source]¶
Bases:
NamedTupleSlim container to help collect and maintain pixel coordinates. Not intended for extensive use
- class flint.leakage.PolStatistics[source]¶
Bases:
NamedTupleSimple container for statistics around the extraction of leakage polarisation statistics
- flint.leakage._get_output_catalogue_path(input_path: pathlib.Path, pol: str, output_path: pathlib.Path | None = None) pathlib.Path[source]¶
Create the output leakage catalogue name
- flint.leakage._load_component_table(catalogue: TableOrPath) astropy.table.Table[source]¶
Return a table given either a loaded table or a path to a table on disk
- flint.leakage._load_fits_image(fits_path: pathlib.Path) FITSImage[source]¶
Load in a FITS image and package the components into a consistent form. Not intended for extensive use.
- Parameters:
fits_path (Path) – The path of the FITS image to examining
- Returns:
Loaded FITS properties
- Return type:
- flint.leakage.create_leakge_component_table(pol_image: pathlib.Path, catalogue: astropy.table.Table | pathlib.Path, pol: str = 'v', output_path: pathlib.Path | None = None) pathlib.Path[source]¶
Create a component catalogue that includes enough information to describe the polarisation fraction of sources across a field. This is intended to be used for leakage characterisation.
New catalogue columns will be added:
pol_fraction: The POL/I fraction. The peak flux is taken from the catalogue, using the appropriate column name
pol_peak: The peak polarised signal in the nearby region of a component position
pol_noise: The noise in the polarised image pixels around the component position
- Parameters:
pol_image (Path) – The polarised image that will be used to extract peak polarised flux from
catalogue (Union[Table, Path]) – Component table describing positions to extract flux from
pol (str, optional) – The polarisation stokes being considered. Defaults to “v”.
output_path (Optional[Path], optional) – The path of the new catalogue. If None it is derived from the input catalogue path. Defaults to None.
- Returns:
Path to the new catalogue use for leakage
- Return type:
Path
- flint.leakage.extract_pol_stats_in_box(pol_image: numpy.ndarray, pixel_coords: PixelCoords, search_box_size: int, noise_box_size: int, mean_box_size: int) PolStatistics[source]¶
Construct two boxes around nominated pixel coordinates to:
extract the peak signal within
calculate a local RMS value for
- Parameters:
pol_image (np.ndarray) – The loaded polarised image
pixel_coords (PixelCoords) – Collection of pixel positioncs to evaluate the peak polarisation and noise at
search_box_size (int) – Size of box to extract the maximum polarised signal from
noise_box_size (int) – Size of box to calculate the RMS over
mean_box_size (int) – Size of box to calculate an mean over
- Returns:
Extracted statistics, including peak polarised signal, noise and mean
- Return type:
- flint.leakage.filter_components(table: astropy.table.Table, peak_col: str, int_col: str, int_err_col: str, leakage_filters: LeakageFilters, ra_col: str | None = None, dec_col: str | None = None) astropy.table.Table[source]¶
Apply the pre-processing operations to catalogue components to select an optimal sample of sources for leakage characterisation. Sources will be selected based on:
how isolated they are
compactness, as traced by their int/peak
- Parameters:
table (Table) – Collection of sources, as produced from a source finder
peak_col (str) – The column name describing the peak flux density
int_col (str) – The column name describing integrated flux
int_err_col (str) – The column container errors that correspond to int_col to use when computing signal-to-noise
leakage_filters (LeakageFilters) – Criteria applied to the source components in the table
ra_col (Optional[str], optional) – The RA column name. If None, it will be guessed. Defaults to None.
dec_col (Optional[str], optional) – The Dec column name. If None, it will be guessed. Defaults to None.
- Returns:
A filtered table
- Return type:
Table
- flint.leakage.get_xy_pixel_coords(table: astropy.table.Table, wcs: astropy.wcs.WCS, ra_col: str | None = None, dec_col: str | None = None) PixelCoords[source]¶
Convert (RA, Dec) positions in a catalogue into (x, y)-pixels given an WCS
- Parameters:
table (Table) – The table containing sources to collect (x, y)-coordinates
wcs (WCS) – The WCS description to use to resolve (RA, Dec) to (x, y)
ra_col (Optional[str], optional) – The RA column name. If None, it will be guessed. Defaults to None.
dec_col (Optional[str], optional) – The Dec column name. If None, it will be guessed. Defaults to None.
- Returns:
_description_
- Return type:
- flint.leakage.load_and_filter_components(catalogue: TableOrPath, leakage_filters: LeakageFilters) astropy.table.Table[source]¶
Load in a component catalogue table and apply filters to them. The remaining components will be used to characterise leakage
- Parameters:
catalogue (TableOrPath) – The path to a component catalogue, or a loaded component catalogue
leakage_filters (LeakageFilters) – Filtering options to find ideal components for leakage characterisation
- Returns:
Filtered component catalogue
- Return type:
Table