Skip to content

Improve ACA header 3 decom support#325

Merged
taldcroft merged 10 commits intomasterfrom
support-read-quad-zero-offsets
Feb 17, 2026
Merged

Improve ACA header 3 decom support#325
taldcroft merged 10 commits intomasterfrom
support-read-quad-zero-offsets

Conversation

@taldcroft
Copy link
Copy Markdown
Member

@taldcroft taldcroft commented Feb 5, 2026

Description

This PR gives the aca_hdr3.py module a modernization refresh and improves the functionality:

  • Remove use of masked arrays since there is not any missing data.
  • Change unit of voltage MSIDs from mV to V.
  • Fix ccd_setpoint to be in degC.
  • Refactor code so that the MSID class does the work and the MSIDset class is a thin wrapper supporting multiple MSIDs.
  • Support decoding the HDR3 telemetry containing the four 16-bit quadrant zero-offset values.
  • Add a validation notebook that makes a plot of all the supported MSIDs.

Interface impacts

Testing

Unit tests

  • Mac

The failures below are unrelated and seem to indicate that the tests for skipping are not quite working.

(ska3) ➜  mica git:(support-read-quad-zero-offsets) git rev-parse --short HEAD
0d12953
(ska3) ➜  mica git:(support-read-quad-zero-offsets) pytest
========================================== test session starts ==========================================
platform darwin -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: anyio-4.7.0, timeout-2.3.1
collected 117 items                                                                                     

mica/archive/tests/test_aca_dark_cal.py ..................                                        [ 15%]
mica/archive/tests/test_aca_hdr3.py ..                                                            [ 17%]
mica/archive/tests/test_aca_l0.py ...FF                                                           [ 21%]
mica/archive/tests/test_asp_l1.py FFFFFsF                                                         [ 27%]
mica/archive/tests/test_cda.py ..................................................                 [ 70%]
mica/archive/tests/test_obspar.py .                                                               [ 70%]
mica/report/tests/test_report.py ss                                                               [ 72%]
mica/report/tests/test_write_report.py s                                                          [ 73%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                      [ 86%]
mica/stats/tests/test_acq_stats.py .ss                                                            [ 88%]
mica/stats/tests/test_guide_stats.py .sss                                                         [ 92%]
mica/vv/tests/test_vv.py ssssFFFFF                                                                [100%]

=============================================== FAILURES ================================================

Independent check of unit tests by Jean

  • Linux
(ska3-latest) 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: timeout-2.4.0, anyio-4.12.1
collected 117 items                                                                                                                                                  

mica/archive/tests/test_aca_dark_cal.py ..................                                                                                                     [ 15%]
mica/archive/tests/test_aca_hdr3.py ..                                                                                                                         [ 17%]
mica/archive/tests/test_aca_l0.py .....                                                                                                                        [ 21%]
mica/archive/tests/test_asp_l1.py .......                                                                                                                      [ 27%]
mica/archive/tests/test_cda.py ..................................................                                                                              [ 70%]
mica/archive/tests/test_obspar.py .                                                                                                                            [ 70%]
mica/report/tests/test_report.py ..                                                                                                                            [ 72%]
mica/report/tests/test_write_report.py .                                                                                                                       [ 73%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                                                   [ 86%]
mica/stats/tests/test_acq_stats.py ...                                                                                                                         [ 88%]
mica/stats/tests/test_guide_stats.py ....                                                                                                                      [ 92%]
mica/vv/tests/test_vv.py .........                                                                                                                             [100%]

========================================================================== warnings summary ==========================================================================
mica/mica/archive/tests/test_asp_l1.py::test_update_l1_archive
  /export/jeanconn/miniforge3/envs/ska3-latest/lib/python3.13/pty.py:95: DeprecationWarning: This process (pid=1697319) is multi-threaded, use of forkpty() may lead to deadlocks in the child.
    pid, fd = os.forkpty()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================= 117 passed, 1 warning in 368.31s (0:06:08)

Functional tests

Plots included in the new validation notebook.

@taldcroft taldcroft changed the title Support reading 16bit quadrant zero offset MSIDs Improve ACA header 3 decom support Feb 11, 2026
@taldcroft taldcroft requested a review from jeanconn February 11, 2026 11:45
Comment thread mica/archive/aca_hdr3.py Outdated
@jeanconn
Copy link
Copy Markdown
Contributor

I note there's some weirdness with the day 163 data as read by the hdr3 code, but this isn't a regression
2025163

Copy link
Copy Markdown
Contributor

@jeanconn jeanconn left a comment

Choose a reason for hiding this comment

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

I'm not as sure about the 2^15 offset which isn't described in the documentation afaict, but since the point is to have something reasonable and this matches the values from MB, this seems good to me.

@taldcroft taldcroft merged commit dd50833 into master Feb 17, 2026
2 checks passed
@taldcroft taldcroft deleted the support-read-quad-zero-offsets branch February 17, 2026 18:10
@javierggt javierggt mentioned this pull request Mar 20, 2026
@javierggt javierggt mentioned this pull request Apr 7, 2026
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.

2 participants