AstroZOGY - EranOfek/AstroPack GitHub Wiki
AstroZOGY class for ZOGY and Translient image subtraction and transients detection
The AstroZOGY class supports transient detection operations via the ZOGY and Translient image subtraction (differencing). The topic of image subtraction is covered in the image subtraction page. AstroZOGY (inherits from AstroDiff, which by itself inherits from AstroImage), is a container for the New and Ref images as well the ZOGY D image.
AstroDiff and AstroZOGY
AstroZOGY inherits from AstroDiff which inherits from AstroImage.
Properties
Here we list all the main properties of AstroZOGY, including those its inherits from AstroDiff and AstroImage.
The AstroImage main properties include:
- Image - The difference image (ZOGY, D image).
- Back - The background image.
- Var - The variance image.
- Mask - The bit mask image.
- CatData - Catalog of sources detected in the Image.
- PSFData - The PSF of the D image.
- WCS - The WCS.
- HeaderData - Header
Additional AstroImage properties are listed in the AstroImage class page.
- New - An AstroImage containing the New image.
- Ref - An AstroImage containing the Reference image.
- IsRegistered - A logical indicating if the New and Ref are registered.
Numerical properties containing additional information:
- Fn - Flux normalization factor for the New image. By default, this is set to 1 (i.e., Ref is scaled to New). The getter of this function will populate it (and Fr) using the zero-point information from the header. The zero point header keyword is defined as an input arguments of the estimateFnFr function. By default the header keyword name in which the zero point is searched is 'PH_ZP' and it is assumed to be in units of magnitudes.
- Fr - Flux normalization factor for the Ref image.
- Fd - $F_D$ as defined by ZOGY. The $D$ image is multiplied by this factor such that it has units of flux similar to $N$.
- BackN - Background level (scalar) of New. This is populated automatically using the estimateBackVar function.
- BackR - Background level (scalar) of Ref.
- VarN - Variance (scalar) of New. This is populated automatically using the estimateBackVar function.
- VarR - Variance (scalar) of Ref.
Hidden and dependent properties (created on demand)
- Nbs - A background subtracted New image.
- Rbs - A background subtracted Reference image.
Hidden properties, for padding additional rows and columns in FFT operations. If [] (default), then no padding.
- ZeroPadRowsFFT - FFT rows padding for all FFT operations. If empty, then no padding. Default is [].
- ZeroPadColsFFT - FFT cols padding for all FFT operations. If empty, then no padding. Default is [].
Properties in AstroZOGY (Hidden):
-
S - The ZOGY score image in units of standard deviation of the noise.
-
Scorr - The ZOGY $S_{corr}$ image in units of standard deviation of the noise. Like $S$ but in which the source noise is propagated.
-
R_hat - fft of the Ref image.
-
Pr_hat - fft of the full-size Ref PSF shifted to the origin.
-
N_hat - fft of the New image.
-
Pn_hat - fft of the full-size New PSF shifted to the origin.
-
D_hat - fft of the $D$ image.
-
Pd_hat - fft of the PSF of the $D$ image. This is the full-size PSF shifted to the origin.
-
S_hat - fft of the $S$ image.
Auxilary parameters:
-
D_den_hat
-
D_num_hat
-
D_denSqrt_hat
-
P_deltaNhat
-
P_deltaRhat
-
F_S - Flux scaling of $S$.
-
Z2 - Translient $Z^{2}$ statistics.
-
S2 - ZOGY $S^{2}$ statistics.
-
Sflux - S in units of flux (prior to the normalization).
-
Zvec_hat - Translient $\vec{\widehat{z}}$.
Methods
Here we list all the main functions of AstroZOGY, including those it inherits from AstroDiff, but not the methods of AstroImage.
Utility functions
- replaceNaN - Replace NaN pixels in New and Ref with Back value or other value.
- astrometryRefine - Refine the astrometry of the New and Ref images using imProc.astrometry.astrometryRefine
- register - Register the New and Ref images in AstroDiff using their WCS. Use imProc.transIm.interp2wcs to register the Ref and New images. By default will register the Ref image into the New image. By default will also apply replaceNaN.
- estimateFnFr - Estimate Fn/Fr (flux matching) and return matching factors such that Fn=1.
- estimateBackVar - Estimate global background and variance of New and Ref images and populate the BackN, BackR, VarN, VarR properties.
- subAsFunFn - Return statistics of D image as a function of Fr. Perform subtraction with variable Fr in order to find best Fn/Fr. This function will not generate a D and Pd in the AstroDiff.
Subtraction functions
- subtractionD - Calculate ZOGY D images and its PSF Pd. Given New and Ref images, this function will create the ZOGY subtraction image $D$ (proper subtraction image) and populate it in AstroDiff along with its PSF Pd. By default, the D image will be normalized to units of flux using Fd. If needed the New and Ref will be registered prior to subtraction.
- subtractionS - Given D and Pd, populate S and S_hat.
- knkr - Return kn_hat, kr_hat, kn, kr.
- subtractionScorr - Calculate the ZOGY $S_{corr}$ statistics - S corrected for source noise and astrometric noise. This function requires that New and Ref will be in units of electrons.
- translient - Apply translient image subtraction to New and Ref in AstroFiff object. Using: imUtil.properSub.translient. This function can be executed only after subtractionD was executed.
Measurements on subtraction images
find Transients
Simulations
Examples
% Create AstroZOGY object:
AD = AstroZOGY;
% populate the New and Ref images:
cd /marvin/LAST.01.05.01/2023/12/14/proc/000545v0
AD.Ref = AstroImage.readFileNamesObj('LAST.01.05.01_20231215.000535.997_clear_TXS0506+056_000_001_010_sci_coadd_Image_1.fits');
cd /marvin/LAST.01.05.01/2023/12/14/proc/002834v0
AD.New = AstroImage.readFileNamesObj('LAST.01.05.01_20231215.002824.520_clear_TXS0506+056_000_001_010_sci_coadd_Image_1.fits');
% refine astrometry (if needed)
AD.astrometryRefine
% Register the Ref image into the New image (New won't change)
AD.register;
% Check/estimate Fn and Fr.
RR=AD.subAsFunFn
% Subtraction
AD.subtractionD;
AD.subtractionS;
AD.subtractionS('NormMethod','none')
AD.translient;
AD.subtractionScorr;