HCI metric plots

Asterix.utils.hci_metrics.plot_contrast_curves(reduced_data, xcen=None, ycen=None, delta_raddii=3, numberofpix_per_loD=None, numberofmas_per_pix=None, type_of_contrast='mean', mask_DH=None, xtitle=None, ytitle=None, title=None, legend_labels=None, xrange=None, yrange=None, path='', filename='')

Plot contrast curves from image or image cube as pdf file to disk.

Plot and contrast curves from an image or a cube of images (assumed to be several iterations of a loop) using concentric rings. You can choose the center, the size of the rings, the type of contrast (mean or std) The DH is set using a binary mask (1s where the DH is, 0 elsewhere) The abscissa unit can be in pixel mas or in lambda/D.

AUTHOR: J. Mazoyer 16/03/2022

Parameters:
reduced_dataarray [dim, dim] or [nb_iter, dim, dim]

array containing the reduced data. Assume to be already in contrast unit (divided by max of PSF) if the array is of dimension 3, the first dimension is assumed to be the number of iter and a contrast curve will be plotted for each

xcenfloat, default None (reduced_data.shape[0]/2 - 1/2)

pixel, position x of the star

ycenfloat, default None (reduced_data.shape[1]/2 - 1/2)

pixel, position y of the star

delta_raddiifloat, default 3

pixel, width of the small concentric rings

type_of_contraststring, default ‘mean’
can be ‘mean’mean contrast on the rings

‘stddev_1sig’ : 1 sigma standard deviation on the rings ‘stddev_5sig’ : 5 sigma standard deviation on the rings

numberofpix_per_loDfloat, defaut None

resolution of the focal plane in # of pixel per lambda/D (useful for testbed) If set the absciss unit will be in lambda/D

numberofmas_per_pixfloat, default None

Resolution of the focal plane in # of mas per pixel (useful for real instruments) If set the absciss unit will be in mas If none of these keywords are set, the absciss unit will be in pixels If both are set, it will raise an error

mask_DH2d binary Array default is all focal plane

mask delimiting the DH

pathstring, default ‘’

path where to save the pdf plot file

filenamestring, default ‘’

Filename prefix for pdf files of the plots saved to disk.

legend_labelsstring array of the same number of images in the first cube, default None

Name of the legend labels, If None and if the array is of dimension 2, no legend If None and if the array is of dimension 3, we assume these are iterations

Asterix.utils.hci_metrics.contrast_curves(reduced_data, xcen=None, ycen=None, delta_raddii=3, type_of_contrast='mean', mask_DH=None)

create a contrast curve from a image using concentric rings You can chooose the center, the size of the rings, the type of contrast (mean or std) The DH is set using a binary mask (1s where the DH is, 0 elsewhere)

AUTHOR: J. Mazoyer 16/03/2022

Parameters:
reduced_data[dim, dim] array

Coronagraphic reduced data.

xcenfloat, default None (reduced_data.shape[0]/2 -1/2)

Pixel, position x of the star.

ycenfloat, default None (reduced_data.shape[1]/2 -1/2)

pixel, position y of the star.

delta_raddiifloat, default 3

Width of the small concentric rings in pixel.

type_of_contraststring, default ‘mean’
Can be ‘mean’mean contrast on the rings.

‘stddev_1sig’ : 1 sigma standard deviation on the rings. ‘stddev_5sig’ : 5 sigmas standard deviation on the rings.

mask_DH2d binary Array, default is all focal plane

Mask delimiting the DH.

Returns:
contrast_curve1d numpy array

array with the contrast on concentric rings measure with different metrics. Values outside of the mask are nan