From f428b7ffb3fe6cf102b9b89ad0c18155ec443ff0 Mon Sep 17 00:00:00 2001 From: DanRyanIrish Date: Fri, 29 Nov 2024 10:16:22 +0000 Subject: [PATCH] Enable user to set total flux for MEM. --- xrayvision/mem.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xrayvision/mem.py b/xrayvision/mem.py index bce4e95..846127c 100644 --- a/xrayvision/mem.py +++ b/xrayvision/mem.py @@ -584,6 +584,7 @@ def mem( maxiter: int = 1000, tol: float = 1e-3, map: bool = True, + total_flux = None, ) -> Union[Quantity, NDArray[np.float64]]: r""" Maximum Entropy Method visibility based image reconstruction @@ -605,11 +606,16 @@ def mem( tolerance value used in the stopping rule ( || x - x_old || <= tol || x_old ||) map : Return a sunpy map or bare array + total_flux : `astropy.units.Quantity` (optional) + The total flux/counts contained in the image. + If not set, total_flux is estimated using `_estimate_flux`. + Returns ------- """ - total_flux = _estimate_flux(vis, shape, pixel_size) + if total_flux is None: + total_flux = _estimate_flux(vis, shape, pixel_size) mean_vis = _get_mean_visibilities(vis, shape, pixel_size) Hv, Lip, Visib = _prepare_for_optimise(pixel_size, shape, mean_vis)