From a068b4d9635696c2c9a13e626eb82e8440de4d67 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Wed, 20 Feb 2019 20:06:40 -0500 Subject: [PATCH 1/3] Take advantage of new dark property in reporting --- proseco/report_acq.py | 2 -- proseco/report_guide.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/proseco/report_acq.py b/proseco/report_acq.py index 0aee0ac4..c92b97a1 100644 --- a/proseco/report_acq.py +++ b/proseco/report_acq.py @@ -172,8 +172,6 @@ def make_acq_star_details_report(acqs, cand_acqs, events, context, obsdir): ###################################################### # Candidate acq star detail sections ###################################################### - acqs.dark = get_dark_cal_image(date=acqs.date, select='before', - t_ccd_ref=acqs.t_ccd) context['cand_acqs'] = [] diff --git a/proseco/report_guide.py b/proseco/report_guide.py index 5439e5ad..a0f2bfe7 100644 --- a/proseco/report_guide.py +++ b/proseco/report_guide.py @@ -70,8 +70,6 @@ def make_report(obsid, rootdir='.'): # Get information that is not stored in the acqs pickle for space reasons guides.stars = StarsTable.from_agasc(guides.att, date=guides.date) - guides.dark = get_dark_cal_image(date=guides.date, select='before', - t_ccd_ref=guides.t_ccd) # For include/exclude stars, add some bookkeeping (the forced column) cand_guides['forced'] = False From 342e609fc6bda4ba6497b74727d08995fbb9f28a Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Wed, 20 Feb 2019 20:16:46 -0500 Subject: [PATCH 2/3] Format spoilers and imposters plots in one row --- proseco/index_template_acq.html | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/proseco/index_template_acq.html b/proseco/index_template_acq.html index 86035963..f291da79 100644 --- a/proseco/index_template_acq.html +++ b/proseco/index_template_acq.html @@ -134,14 +134,19 @@

Probability of acquisition from the chandra_aca model

Probability star is on the usable part of the CCD

{{ acq['p_on_ccd_table'] | safe }} -

Spoilers (stars)

- - {{ acq['spoilers_table'] | safe }} - -

Imposters (hot pixels)

- - {{ acq['imposters_table'] | safe }} - + + + + +
+

Spoilers (stars)

+ + {{ acq['spoilers_table'] | safe }} +
+

Imposters (hot pixels)

+ + {{ acq['imposters_table'] | safe }} +
{% endfor %} From 760fcb2efcacd42187141f8ee3e8e018e60bf8f3 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Thu, 21 Feb 2019 07:12:23 -0500 Subject: [PATCH 3/3] Change default of raise_exc from False to True --- proseco/catalog.py | 19 ++++++++++--------- proseco/tests/test_catalog.py | 9 +++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/proseco/catalog.py b/proseco/catalog.py index f99499ce..a8899ed3 100644 --- a/proseco/catalog.py +++ b/proseco/catalog.py @@ -28,6 +28,14 @@ def get_aca_catalog(obsid=0, **kwargs): appending this string, e.g. with ``obs_text + '--force-catalog'`` in the call to ``get_aca_catalog``. + NOTE on API: + + Keywords that have ``_acq`` and/or ``_guide`` suffixes are handled with + the AliasAttribute in core.py. If one calls get_aca_catalog() with e.g. + ``t_ccd=-10`` then that will set the CCD temperature for both acq and + guide selection. This is not part of the public API but is a private + feature of the implementation that works for now. + :param obsid: obsid (int) or starcheck text (str) (default=0) :param att: attitude (any object that can initialize Quat) :param n_acq: desired number of acquisition stars (default=8) @@ -51,19 +59,12 @@ def get_aca_catalog(obsid=0, **kwargs): :param optimize: optimize star catalog after initial selection (default=True) :param verbose: provide extra logging info (mostly calc_p_safe) (default=False) :param print_log: print the run log to stdout (default=False) + :param raise_exc: raise exception if it occurs in processing (default=True) :returns: ACATable of stars and fids """ - # NOTE on API: - # - # Keywords that have ``_acq`` and/or ``_guide`` suffixes are handled with - # the AliasAttribute in core.py. If one calls get_aca_catalog() with e.g. - # ``t_ccd=-10`` then that will set the CCD temperature for both acq and - # guide selection. This is not part of the public API but is a private - # feature of the implementation that works for now. - - raise_exc = kwargs.pop('raise_exc', None) # This cannot credibly fail + raise_exc = kwargs.pop('raise_exc', True) # This cannot credibly fail try: # If obsid is supplied as a string then it is taken to be starcheck text diff --git a/proseco/tests/test_catalog.py b/proseco/tests/test_catalog.py index 92ac4872..d1f2b267 100644 --- a/proseco/tests/test_catalog.py +++ b/proseco/tests/test_catalog.py @@ -115,7 +115,7 @@ def test_exception_handling(): t_ccd_acq=-10, t_ccd_guide=-10, detector='ACIS-S', sim_offset=0, focus_offset=0, n_guide=8, n_fid=3, n_acq=8, - include_ids_acq=[1]) # Fail + include_ids_acq=[1], raise_exc=False) # Fail assert 'include_ids and include_halfws must have same length' in aca.exception for obj in (aca, aca.acqs, aca.guides, aca.fids): @@ -149,7 +149,7 @@ def test_no_candidates(): dither_guide=(8.0, 8.0)) stars = StarsTable.empty() stars.add_fake_constellation(mag=13.0, n_stars=2) - acas = get_aca_catalog(**test_info, stars=stars) + acas = get_aca_catalog(**test_info, stars=stars, raise_exc=False) assert 'id' in acas.acqs.colnames assert 'halfw' in acas.acqs.colnames @@ -357,7 +357,8 @@ def test_t_ccd_effective_acq_guide(t_ccd_case): def test_call_args_attr(): - aca = get_aca_catalog(**mod_std_info(optimize=False, n_guide=0, n_acq=0, n_fid=0)) + aca = get_aca_catalog(**mod_std_info(optimize=False, n_guide=0, n_acq=0, n_fid=0), + raise_exc=False) assert aca.call_args == {'att': (0, 0, 0), 'date': '2018:001', 'detector': 'ACIS-S', @@ -374,7 +375,7 @@ def test_call_args_attr(): def test_bad_obsid(): - aca = get_aca_catalog(obsid='blah blah') # Expects this to be starcheck catalog + aca = get_aca_catalog(obsid='blah blah', raise_exc=False) # Expects this to be starcheck catalog assert 'ValueError: text does not have OBSID' in aca.exception assert aca.thumbs_up == 0