Skip to content

Commit

Permalink
Enable user to set total flux for MEM.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRyanIrish committed Nov 29, 2024
1 parent 3a0be98 commit f428b7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xrayvision/mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit f428b7f

Please sign in to comment.