Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions photutils/psf/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class ModelImageMixin:
residuals.
"""

def make_model_image(self, shape, psf_shape=None, include_localbkg=False):
def make_model_image(self, shape, psf_shape=None, include_localbkg=False, model_params=None):
"""
Create a 2D image from the fit PSF models and optional local
background.
Create a 2D image from the fit PSF models or a provided catalog
and optional local background.

Parameters
----------
Expand All @@ -68,6 +68,12 @@ def make_model_image(self, shape, psf_shape=None, include_localbkg=False):
sources overlap will have the local background added
multiple times.

model_params : `~astropy.table.Table`, optional
A table of objects to simulate using the PSF model.
The table must contain columns that match those output
of fitting, typically `x_0`, `y_0`, and `flux`.
If `None`, the most recent fit will be used.

Returns
-------
array : 2D `~numpy.ndarray`
Expand Down Expand Up @@ -102,7 +108,8 @@ def make_model_image(self, shape, psf_shape=None, include_localbkg=False):
fit_params = self.fit_results[-1]._fit_model_params
local_bkgs = self.fit_results[-1].init_params['local_bkg']

model_params = fit_params
if model_params is None:
model_params = fit_params

if include_localbkg:
# add local_bkg
Expand Down
Loading