Class description
- class mustard.mustard.mustard_estimator(science_data: ndarray, angles: ndarray, scale=None, coro=6, pupil='edge', psf=None, hid_mask=None, Badframes=None, savedir='./', ref=None)
MUSTARD Algorithm main class
- __init__(science_data: ndarray, angles: ndarray, scale=None, coro=6, pupil='edge', psf=None, hid_mask=None, Badframes=None, savedir='./', ref=None)
Initialisation of estimator object
Parameters
- science_datanp.ndarray
ADI cube. The first dimensions should be the number of frames.
- anglesnp.array
List of angles. Should be the same size as the ADI cube 1st dimension (number of frames)
- scalenp.array or None
List of scaling coeff for SDI
- coroint or str
Size of the coronograph
- pupilint or None or “edge”
Size of the pupil. If pupil is set to “edge” : the pupil raduis will be half the size of the frame If pupil is set to None : there will be no pupil at all
- psfnp.ndarray or None
If a psf is provided, will perform deconvolution (i.e conv by psf inculded in forward model)
- Hid_mask: np.array or None
Mask to indicate the corrected region. Used for coronograph with specific corrected area (i.e : vapp)
- Badframestuple or list or None
Bad frames that you will not be taken into account
- savedirstr
Path for outputs
- configR1(mode: str, smoothL=True, p_L=1, p_X=1, epsi=1e-07)
Configuration of first regularization. (smooth-like)
- configR2(Msk=None, mode='mask', penaliz='X', invert=False, save=False)
Configuration for Second regularization. Two possible mode : R = M*X (mode ‘mask’)
or R = dist(M-X) (mode ‘dist’) or R = sum(X) (mode ‘l1’)
Parameters
- saveFalse
Save your mask
- Msknumpy.array or torch.tensor
Prior mask of X.
- mode{“mask”,”dist”}.
- if “mask”R = norm(M*X)
if M will be normalize to have values from 0 to 1.
if “dist” : R = dist(M-X)
- penaliz{“X”,”L”,”both”}
Unknown to penaliz. With mode mask :
if “X” : R = norm(M*X) if “L” : R = norm((1-M)*L) if “B” : R = norm(M*X) + norm((1-M)*L)
- With mode dist :
if “X” : R = dist(M-X) if “L” : R = dist(M-L) if “B” : R = dist(M-X) - dist(M-L)
- With mode l1 :
if “X” : R = sum(X) if “L” : R = sum(L) if “B” : R = sum(X) - sum(L)
- invertBool
Reverse penalize mode bewteen L and X.
Returns
- configR3(mode: str, smoothL=True, p_L=1, p_X=1, epsi=1e-07)
Configuration of first regularization. (smooth-like)
- estimate(w_r=0.03, w_r2=0.03, w_r3=0.01, w_pcent=True, estimI='Both', med_sub=False, weighted_rot=True, w_way=(0, 1), maxiter=10, gtol=1e-10, kactiv=0, kdactiv=None, save='./', suffix='', gif=False, verbose=False, history=True, init_maxL=False, mask_L=None)
- Resole the minimization of probleme neo-mayo
The first step with pca aim to find a good initialisation The second step process to the minimization
Parameters
- init_maxL: bool
if True, all ambiguities will be set to L : stellar halo/speakles map. (no recommended) Default is False.
- w_rfloat
Weight regularization, hyperparameter to control R1 regularization (smooth regul)
- w_r2float
Weight regularization, hyperparameter to control R2 regularization (mask regul)
- estimIstr (beta)
If “None” : normal minimization if “L” : With estimate a flux variation of the speakles map if “Frame” : With estimate a flux variation between each frame if “Both” : Will estimate both flux variation between each frame and bewteen frame’s speakles map
- med_subbool
If True, will proceed to a median subtraction (recommended)
- weighted_rotbool (beta)
if True, each frame will be weighted by the delta of rotation.
- w_waytuple ints
If (1,0) : ADI model constructed with the cube and rotate R (direct way) If (0,1) : ADI model constructed with the derotated cube and rotate L (reverse way) iI (1,1) : will do both
- maxiterint
Maximum number of optimization steps
- gtolfloat
Gradient tolerance; Set the break point of minimization. The break point is define as abs(J_n - J-(n-1)) < gtol
- kactivint
Activate regularization at a specific iteration. Allow to be more accurate on the regul/data-attachment term ratio
- kdactivint or {“converg”}
Deactivate regularization at a specific iteration If set to “converg”, will be deactivated when break point is reach Equivalent to re-run a minimization with no regul and L and X initialized at converged value
- savestr or bool
If True save at ./mustard_out/ If path is given, save at the given path + ./mustard_out/
- suffixstring
String suffix to named the simulation outputs
- gifbool
If path is given, save each the minimization step as a gif
- verbosebool
Activate or deactivate print
- historybool
If verbose == True and history == True, information on current iteration will not be overwritten
- L_est, X_est: ndarray
Estimated starlight (L) and circunstlellar (X) contributions
- get_cube_without_speckles(way='direct', save=False)
Return input cube and angles
- get_evo_convergence(show=True, save=False)
Return loss evolution
- get_flux(show=True, save=False)
Return relative flux variations between frame
- get_initialisation(save=False)
Return input cube and angles
- get_reconstruction(way='direct', save=False)
Return input cube and angles
- get_residual(way='direct', save=False)
Return input cube and angles
- get_rot_weight(show=True, save=False)
Return loss evolution
- get_science_data()
Return input cube and angles
- mustard_results(per_vmax=99, r_no_scale=False)
Return loss evolution