Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add img_size guide parameter to control guide star image readout size #344

Merged
merged 6 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions proseco/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def get_guide_catalog(obsid=0, **kwargs):

class ImgSizeMetaAttribute(MetaAttribute):
def __set__(self, instance, value):
if value not in (6, 8, None):
raise ValueError('img_size must be 6, 8, or None')
if value not in (4, 6, 8, None):
raise ValueError('img_size must be 4, 6, 8, or None')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I was thinking this would get checked on the sparkles side but fine to do it here.

instance.meta[self.name] = value


Expand Down
9 changes: 7 additions & 2 deletions proseco/tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,5 +796,10 @@ def test_img_size_guide():
assert np.all(aca.guides['sz'] == '6x6')
assert aca.guides.img_size == 6

with pytest.raises(ValueError, match='img_size must be 6, 8, or None'):
get_aca_catalog(**mod_std_info(stars=stars, dark=dark, img_size_guide=4))
# Confirm that for explicit img_size_guide of 6 boxes are '6x6'
aca = get_aca_catalog(**mod_std_info(stars=stars, dark=dark, n_fid=0, img_size_guide=4))
assert np.all(aca.guides['sz'] == '4x4')
assert aca.guides.img_size == 4

with pytest.raises(ValueError, match='img_size must be 4, 6, 8, or None'):
get_aca_catalog(**mod_std_info(stars=stars, dark=dark, img_size_guide=3))