Skip to content

Commit

Permalink
Reduce memory usage of make_residual_image
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybradley committed Aug 11, 2023
1 parent 689bcf1 commit 255d2fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ New Features

- Added new ``PSFPhotometry``, ``IterativePSFPhotometry``, and
``SourceGrouper`` classes. [#1558, #1559, #1563, #1566, #1567,
#1581, #1586, #1590, #1594, #1603]
#1581, #1586, #1590, #1594, #1603, #1604]

- Added a ``GriddedPSFModel`` ``fill_value`` attribute, [#1583]

Expand Down
3 changes: 2 additions & 1 deletion photutils/psf/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,8 @@ def make_residual_image(self, data, psf_shape):
if isinstance(data, u.Quantity):
unit = data.unit
data = data.value
residual = data - self.make_model_image(data.shape, psf_shape)
residual = -self.make_model_image(data.shape, psf_shape)
residual += data

if unit is not None:
residual <<= unit
Expand Down

0 comments on commit 255d2fa

Please sign in to comment.