DeconvV0

class DeconvV0[source]

Bases: object

deconvolution of the shadowgrams

based on ‘CodedMaskImage’ python program of Cyril Lachaud

constructor

init with everything at 0

self.epsilon=1E-9 : we remove anything below that threshold in the images…

mask is set from data/maskECLAIRs.fits rebinned mask is set from data/maskECLAIRs_rebinned.fits

Methods Summary

build_array_with_padding(myarray) Builds an array containing the myarray in the center and a padding with zeroes outside
build_sky_image([showarrays]) compute the sky image
remove_padding_from_sky(myarray) Returns an array containing the data array in the center and no Padding border
set_rebinned_mask_and_shadowgram_for_deconvolution() Builds the arrays used for deconvolution (Decon suffix) by padding them correctly
set_sky() Builds the sky array
set_weight([filename]) set the weight “W” matrix

Methods Documentation

build_array_with_padding(myarray)[source]

Builds an array containing the myarray in the center and a padding with zeroes outside

myarray should be smaller that the sky array. the build padded array has the dimension of the sky array.

Parameters:myarray (2D array) – array to add the padding to
Returns:array with padding
Return type:2D array
build_sky_image(showarrays=False)[source]

compute the sky image

The core of the imagery.

In principle it should not produce dividing by zero error.

The shadowgrams corrected for the background has to be set before.

A and B deconvolution matrix are cleaned using padding.

Parameters:showarrays (bool) – plot sky count, variance and snr. Default=False.
Returns:sky_count, sky_variance, sky_snr
Return type:array, array, array
remove_padding_from_sky(myarray)[source]

Returns an array containing the data array in the center and no Padding border

the array without padding is the dimension of the shadowgrams

Parameters:myarray (2D array) – padded array
Returns:array with no padding
Return type:2D array
set_rebinned_mask_and_shadowgram_for_deconvolution()[source]

Builds the arrays used for deconvolution (Decon suffix) by padding them correctly

set_sky()[source]

Builds the sky array

Builds the sky array with the correct shape = Rebinned (120) + 2* shadowgrams (80) = 280x280

set_weight(filename=None)[source]

set the weight “W” matrix

if filename==None, W is set with ones

Parameters:filename (string) – PATH/name of the fits file containing the weight matrix