Skip to content

Commit

Permalink
Merge pull request #140 from york-stsci/master
Browse files Browse the repository at this point in the history
removed 0.5 pixel offset from WCS fit
  • Loading branch information
york-stsci authored Aug 18, 2021
2 parents e1a5dbf + 4b0c4ed commit aec023f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stips/astro_image/astro_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,10 @@ def addPoints(self, xs, ys, rates, *args, **kwargs):
"""Adds a set of point sources to the image given their co-ordinates and count rates."""
self.addHistory("Adding {} point sources".format(len(xs)))
self._log("info","Adding {} point sources to AstroImage {}".format(len(xs),self.name))
xs = np.floor(xs).astype(int)
ys = np.floor(ys).astype(int)
# This acts essentially the same as rounding, but is substantially faster in
# most cases.
xs = np.floor(np.array(xs)+0.5).astype(int)
ys = np.floor(np.array(ys)+0.5).astype(int)
with ImageData(self.fname, self.shape, memmap=self.memmap) as dat:
dat[ys, xs] += rates

Expand Down

0 comments on commit aec023f

Please sign in to comment.