Skip to content

Improve aca coord transforms#202

Merged
taldcroft merged 23 commits intomasterfrom
improve-aca-coord-transforms
Mar 26, 2026
Merged

Improve aca coord transforms#202
taldcroft merged 23 commits intomasterfrom
improve-aca-coord-transforms

Conversation

@taldcroft
Copy link
Copy Markdown
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.

Comment thread chandra_aca/transform.py
Comment thread chandra_aca/transform.py Outdated
@taldcroft
Copy link
Copy Markdown
Member Author

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

@jeanconn
Copy link
Copy Markdown
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.

@taldcroft
Copy link
Copy Markdown
Member Author

@jeanconn - I'm looking into proseco today, but those regressions are independent of whether this PR is correct by itself. Of course you can review / approve with a lien on having a good proseco patch.

@taldcroft taldcroft requested a review from jeanconn March 26, 2026 14:05
@taldcroft
Copy link
Copy Markdown
Member Author

@jeanconn - are you good with this now that proseco is passing and you approved that update PR?

@jeanconn
Copy link
Copy Markdown
Contributor

What are your thoughts on sot/sparkles#228 ?

@jeanconn
Copy link
Copy Markdown
Contributor

Actually, nevermind, I've got a new failure in sparkles so I'll go fix that.

@jeanconn
Copy link
Copy Markdown
Contributor

OK, sparkles tests re-passing so that could use review.

@taldcroft
Copy link
Copy Markdown
Member Author

I just approved the sparkles PR.

@taldcroft taldcroft merged commit 9424e95 into master Mar 26, 2026
2 checks passed
@taldcroft taldcroft deleted the improve-aca-coord-transforms branch March 26, 2026 15:43
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