Skip to content

Commit

Permalink
Merge pull request #60 from svank/normalize-to-center
Browse files Browse the repository at this point in the history
Normalize patches by the star-center value rather than the patch maximum
  • Loading branch information
jmbhughes authored Sep 22, 2023
2 parents ad9d8aa + 4d58b0b commit a0dffba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion regularizepsf/fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def average(self, corners: np.ndarray, patch_size: int, psf_size: int, # noqa:

for identifier, patch in self.patches.items():
# Normalize the patch
patch = patch / np.max(patch)
patch = patch / patch[psf_size//2, psf_size//2]

# Determine which average region it belongs to
center_x = identifier.x + self.size // 2
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_coordinate_patch_average():
})
for patch in collection.values():
# Make the normalization of each patch a no-op
patch[-1, -1] = 1
patch[5, 5] = 1

averaged_collection = collection.average(
np.array([[0, 0]]), 10, 10, mode='median')
Expand Down

0 comments on commit a0dffba

Please sign in to comment.