astrohack.core.image_comparison_tool

Classes

FITSImage

Functions

test_image(fits_image)

image_comparison_chunk(compare_params)

Chunk function for parallel execution of the image comparison tool.

extract_rms_from_xds(xds)

This simple function extracts FITSImage RMSes for a xds describing a FITSImage obj

create_fits_comparison_rms_table(parameters, xdt)

Module Contents

test_image(fits_image)[source]
class FITSImage[source]
filename = None[source]
telescope_name = None[source]
rootname = None[source]
factor = 1.0[source]
reference_name = None[source]
resampled = False[source]
header = None[source]
unit = None[source]
x_axis = None[source]
y_axis = None[source]
original_x_axis = None[source]
original_y_axis = None[source]
x_unit = None[source]
y_unit = None[source]
original_data = None[source]
data = None[source]
residuals = None[source]
residuals_percent = None[source]
divided_image = None[source]
classmethod from_xds(xds)[source]

Initialize a FITSImage object using as a base a Xarray dataset :param xds: Xarray dataset

Returns:

FITSImage object initialized from a xds

classmethod from_fits_file(fits_filename, telescope_name)[source]

Initialize a FITSImage object using as a base a FITS file. :param fits_filename: FITS file on disk :param telescope_name: Name of the telescope used

Returns:

FITSImage object initialized from a FITS file

classmethod from_zarr(zarr_filename)[source]

Initialize a FITSImage object using as a base a Xarray dataset store on disk in a zarr container :param zarr_filename: Xarray dataset on disk as a zarr container

Returns:

FITSImage object initialized from a xds

resample(ref_image)[source]

Resamples the data on this object onto the grid in ref_image :param ref_image: Reference FITSImage object

Returns:

None

compare_difference(ref_image)[source]

Does the difference comparison between self and ref_image. :param ref_image: Reference FITSImage object

Returns:

None

compare_scaled_difference(ref_image, rejection=10)[source]

Does the scaled difference comparison between self and ref_image. :param ref_image: Reference FITSImage object :param rejection: rejection level for scaling factor

Returns:

None

image_has_same_sampling(ref_image)[source]

Tests if self has the same X and Y sampling as ref_image :param ref_image: Reference FITSImage object

Returns:

True or False

mask_array(image_array)[source]

Applies base mask to image_array :param image_array: Data array to be masked

Returns:

Masked array

mask_original()[source]

Applies base mask equivalent to original data :returns: Masked original data

plot_images(destination, ref_image, plot_resampled=False, plot_percentuals=False, plot_reference=False, plot_original=False, plot_divided_image=False, z_scale=None, colormap='viridis', dpi=300, display=False)[source]

Plot image contents of the FITSImage object, always plots the residuals when called :param destination: Location onto which save plot files :param ref_image: reference image :param plot_resampled: Also plot data array? :param plot_percentuals: Also plot percentual residuals array? :param plot_reference: Also plot reference image? :param plot_original: Also plot original unresampled image? :param plot_divided_image: Also plot divided image? :param z_scale: Z scale for original, resampled, reference and residual images :param colormap: Colormap name for image plots :param dpi: png resolution on disk :param display: Show interactive view of plots

Returns:

None

export_as_xds()[source]

Create a Xarray DataSet from the FITSImage object :returns: Xarray DataSet

to_zarr(zarr_filename)[source]

Saves a xds representation of self on disk using the zarr format. :param zarr_filename: Name for the zarr container on disk

Returns:

None

export_to_fits(destination)[source]

Export internal images to FITS files. :param destination: location to store FITS files

Returns:

None

scatter_plot(destination, ref_image, dpi=300, display=False, max_radius=None, min_radius=None)[source]

Produce a scatter plot of self.data agains ref_image.data :param destination: Location to store scatter plot :param ref_image: Reference FITSImage object :param dpi: png resolution on disk :param display: Show interactive view of plot :param max_radius: Maximum radius for scatter plot comparison as the outer panels can be crappy. :param min_radius: Minimum radius for scatter plot comparison as the innermost panels can be crappy.

Returns:

None

image_comparison_chunk(compare_params)[source]

Chunk function for parallel execution of the image comparison tool. :param compare_params: Parameter dictionary for workflow control.

Returns:

A DataTree containing the Image and its reference Image.

extract_rms_from_xds(xds)[source]

This simple function extracts FITSImage RMSes for a xds describing a FITSImage obj :param xds: xds describing a FITSImage obj

Returns:

dict with RMS values

create_fits_comparison_rms_table(parameters, xdt)[source]