sot / sparkles

ACA review of star catalogs from proseco
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Add dyn-bgd-n-faint option for review #189

Closed jeanconn closed 1 year ago

jeanconn commented 1 year ago

Description

Add dyn-bgd-n-faint option for review

Lets reviewer use dyn-bgd-n-faint without hacks in core.py

Interface impacts

Adds an info statement on every observation in the output.

Testing

"Still needs https://github.com/sot/ska_helpers/pull/32 and https://github.com/sot/ska_sun/pull/27 for current unit tests."

Unit tests

Independent check of unit tests by Javier

Test setup requiring ska_helper and ska_sun was not originally defined here - without those changes for the roll limits, the two test_review tests noted by Javier fail. This is OK for this PR -Jean.

Functional tests

Output including obsid 25821 (Abell 2029) at:

https://icxc.cfa.harvard.edu/aspect/test_review_outputs/sparkles-pr189/MAY2923P_2023_139_17_44_50_719_sparkles/#id25821

jeanconn commented 1 year ago

I think sparkles regress tests will probably need to be pinned to avoid issues with chandra_models roll table update too.

jeanconn commented 1 year ago

For this, I was holding merge until a reviewer did the independent unit test run.

javierggt commented 1 year ago

I ran the tests. The test that corresponds to this PR passes.

These two tests fail for me:

FAILED sparkles/tests/test_review.py::test_roll_options_dec89_9 - AssertionError: assert [' roll   P2 ...6601776', ...] == [' roll   P2 ... --       --']
FAILED sparkles/tests/test_review.py::test_roll_options_for_not_allowed_pitch - ValueError: Filtered data length must be at least 2

any idea why? is that the issue you just created?

jeanconn commented 1 year ago

And honestly, I've forgotten which roll limits worked for sparkles for the other tests (which are failing in master).

jeanconn commented 1 year ago

And I'd tried with ska_helpers and ska_sun and the tests still weren't working but now they are so I'll update the description.

taldcroft commented 1 year ago

Ugh, I just tried to run sparkles tests in a ska3-dev environment with current master for ska_sun and ska_helpers. This went even worse, with a failure to collect tests. Not sure what's happening...

(ska3-dev) ➜  sparkles git:(master) pytest sparkles -v     
=================================================== test session starts ====================================================
platform darwin -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0 -- /Users/aldcroft/miniconda3/envs/ska3-dev/bin/python3.1
cachedir: .pytest_cache
rootdir: /Users/aldcroft/git, configfile: pytest.ini
plugins: timeout-2.1.0, anyio-3.6.2
collected 59 items / 1 error                                                                                               

========================================================== ERRORS ==========================================================
_____________________________ ERROR collecting sparkles/sparkles/tests/test_find_er_catalog.py _____________________________
sparkles/tests/test_find_er_catalog.py:39: in <module>
    ACA = get_aca_catalog(**KWARGS)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/__init__.py:90: in get_aca_catalog
    return get_aca_catalog(*args, **kwargs)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/catalog.py:66: in get_aca_catalog
    aca = _get_aca_catalog(obsid=obsid, raise_exc=raise_exc, **kwargs)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/catalog.py:130: in _get_aca_catalog
    aca.acqs = get_acq_catalog(stars=aca.stars, **kwargs)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/acq.py:175: in get_acq_catalog
    acq["probs"] = AcqProbs(
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/acq.py:1481: in __init__
    p_acq_model = acq_success_prob(
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/chandra_aca/star_probs.py:309: in acq_success_prob
    probs = grid_model_acq_prob(mags, t_ccds, colors, halfwidths, model=model)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/chandra_aca/star_probs.py:515: in grid_model_acq_prob
    gfm = get_grid_func_model(
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/chandra_aca/star_probs.py:448: in get_grid_func_model
    "filename": info["data_file_path"],
E   TypeError: 'PosixPath' object is not subscriptable
================================================= short test summary info ==================================================
ERROR sparkles/tests/test_find_er_catalog.py - TypeError: 'PosixPath' object is not subscriptable
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
jeanconn commented 1 year ago

Current master just passed for me with the ska3-matlab-2023.4rc3 release and chandra_models 3.48 . What were you testing for chandra_aca and chandra_models?

(ska3-matlab-2023.4rc3) spark:sparkles jean$ pytest
================================================== test session starts ==================================================
platform darwin -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/jean/git/sparkles
plugins: timeout-2.1.0, anyio-3.6.2
collected 64 items                                                                                                      

sparkles/tests/test_checks.py .....................................                                               [ 57%]
sparkles/tests/test_find_er_catalog.py .....                                                                      [ 65%]
sparkles/tests/test_review.py ..................                                                                  [ 93%]
sparkles/tests/test_yoshi.py ....                                                                                 [100%]

============================================ 64 passed in 192.23s (0:03:12) =============================================
taldcroft commented 1 year ago

I had an out-of-date ska_helpers. All good now.