Skip to content

Commit

Permalink
Use consistent definition of usable CCD area for guide
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Dec 20, 2018
1 parent 39bba94 commit 7c486c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions proseco/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@ def process_include_ids(self, cand_guides, stars):
:param stars: stars table
"""
ok = ((np.abs(stars['row']) < CHAR.max_ccd_row) &
(np.abs(stars['col']) < CHAR.max_ccd_col))
row_max = CCD['row_max'] - CCD['row_pad'] - CCD['window_pad']
col_max = CCD['col_max'] - CCD['col_pad'] - CCD['window_pad']

ok = ((np.abs(stars['row']) < row_max) &
(np.abs(stars['col']) < col_max))

super().process_include_ids(cand_guides, stars[ok])

Expand Down
7 changes: 5 additions & 2 deletions proseco/tests/test_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,20 @@ def test_guides_include_bad():
- Including a star (otherwise acceptable) just off the CCD is not allowed.
"""
row_max = CCD['row_max'] - CCD['row_pad'] - CCD['window_pad']
col_max = CCD['col_max'] - CCD['col_pad'] - CCD['window_pad']

stars = StarsTable.empty()

stars.add_fake_constellation(mag=[7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7],
id=[1, 2, 3, 4, 5, 6, 7, 8],
size=2000, n_stars=8)

# Bright star but class 1, not picked
stars.add_fake_star(mag=6.5, row=50, col=50, id=10, CLASS=1)
stars.add_fake_star(mag=6.5, row=row_max - 1, col=col_max - 1, id=10, CLASS=1)

# Bright star just off the FOV, not picked
stars.add_fake_star(mag=6.5, row=512, col=0, id=20)
stars.add_fake_star(mag=6.5, row=row_max + 1, col=col_max + 1, id=20)

# Make sure baseline catalog is working like expected
guides = get_guide_catalog(**STD_INFO, stars=stars)
Expand Down

0 comments on commit 7c486c3

Please sign in to comment.