wrapper_optmask

psfsubtraction.fitpsf.wrapper_optmask(func)[source] [edit on github]

Wrap an optregion function to apply an additional global mask.

This function wraps the optregion function func. Optimization regions are determined by that function, but are then additionally filtered such that points that are masked as True in self.optmask are not included in the optimization region.

One use case is an image with a source hidden in the PSF. Assume that this source is already known. We want to include it in region to make sure that the PSF is removed under it, but we do not want to include when optimize the PSF. (A better alternative might be to fit its PSF at the same time, but that is beyond the scope of this module.)

Parameters:
func : callable

function to be wrapped.

Returns:
func_and_optmask : function

wrapped func