Skip to content

Improve aca coord transforms#202

Open
taldcroft wants to merge 23 commits intomasterfrom
improve-aca-coord-transforms
Open

Improve aca coord transforms#202
taldcroft wants to merge 23 commits intomasterfrom
improve-aca-coord-transforms

Conversation

@taldcroft
Copy link
Member

@taldcroft taldcroft commented Mar 16, 2026

Description

This is a major update to the ACA pixel row,col <=> angle yag,zag transformations.

This includes:

  • For pixels_to_yagzag use the 2020 calibration coefficents by default.
  • For yagzag_to_pixels use Newton's method to accurately invert pixels_to_yagzag using a good starting point.
  • Correctly account for the ACA temperature for both ground (CXC) and flight transformations.

This PR uses numba-accelerated routines to improve performance and accuracy.

TODO:

Fixes #152

Interface impacts

  • Default t_aca=35.0 (from previous 20.0) is likely going to cause regressions (albeit benign) in places. This will change some answers but for the better in the modern era.
  • Default allow_bad change to True could result in not raising an exception. Likely not impacting.

Testing

Unit tests

  • Mac
(ska3) ➜  chandra_aca git:(improve-aca-coord-transforms) git rev-parse --short HEAD
06d34eb
(ska3) ➜  chandra_aca git:(improve-aca-coord-transforms) pytest
====================================== test session starts =======================================
platform darwin -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: anyio-4.12.1, timeout-2.4.0
collected 268 items                                                                              

chandra_aca/tests/test_aca_image.py .....................                                  [  7%]
chandra_aca/tests/test_attitude.py ....................................................... [ 28%]
......                                                                                     [ 30%]
chandra_aca/tests/test_dark_model.py ............                                          [ 35%]
chandra_aca/tests/test_dark_subtract.py .........                                          [ 38%]
chandra_aca/tests/test_drift.py ..............................................             [ 55%]
chandra_aca/tests/test_manvr_mon_images.py .......                                         [ 58%]
chandra_aca/tests/test_maude_decom.py .........................                            [ 67%]
chandra_aca/tests/test_planets.py .................                                        [ 73%]
chandra_aca/tests/test_psf.py ...                                                          [ 75%]
chandra_aca/tests/test_residuals.py .....                                                  [ 76%]
chandra_aca/tests/test_star_probs.py .................................                     [ 89%]
chandra_aca/tests/test_transform.py .............................                          [100%]

====================================== 268 passed in 40.36s ======================================

Independent check of unit tests by Jean

  • Linux on ska3/aca
jeanconn-kady> pytest
======================================================================= test session starts =======================================================================
platform linux -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.12.1, timeout-2.4.0
collected 280 items                                                                                                                                               

chandra_aca/tests/test_aca_image.py .....................                                                                                                   [  7%]
chandra_aca/tests/test_all.py ...............s.........................                                                                                     [ 22%]
chandra_aca/tests/test_attitude.py .............................................................                                                            [ 43%]
chandra_aca/tests/test_dark_model.py ............                                                                                                           [ 48%]
chandra_aca/tests/test_dark_subtract.py .........                                                                                                           [ 51%]
chandra_aca/tests/test_drift.py ..............................................                                                                              [ 67%]
chandra_aca/tests/test_manvr_mon_images.py .......                                                                                                          [ 70%]
chandra_aca/tests/test_maude_decom.py .........................                                                                                             [ 79%]
chandra_aca/tests/test_planets.py .................                                                                                                         [ 85%]
chandra_aca/tests/test_psf.py ...                                                                                                                           [ 86%]
chandra_aca/tests/test_residuals.py .....                                                                                                                   [ 88%]
chandra_aca/tests/test_star_probs.py .................................                                                                                      [100%]

============================================================ 279 passed, 1 skipped in 68.00s (0:01:07) ============================================================
jeanconn-kady> git rev-parse HEAD
e2599b48b01a2e494189c177418aa0851519fb2f

Functional tests

No functional testing.

@taldcroft
Copy link
Member Author

@jeanconn - I have completed all TODOs and planned work for this PR so it is ready for final review.

@jeanconn
Copy link
Contributor

It looked to me like the proseco tests are failing again which I didn't completely understand in the context of the chandra_aca changes since they last passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with yagzag_to_pixels and pixels_to_yagzag

2 participants