Skip to content

Document that the rate fields are not the heritage gimbal rates - #187

Draft
mmaclay wants to merge 3 commits into
mainfrom
clock-cone-rate-conventions
Draft

mmaclay wants to merge 3 commits into
mainfrom
clock-cone-rate-conventions

Conversation

@mmaclay

@mmaclay mmaclay commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Documentation only in curryer/compute/geometry.py. No behavior change, no API change.

cone_angle_rate and clock_angle_rate are the time derivatives their names say they are: np.gradient of the orbital-frame cone and clock angles. The ERBE/CERES L2 product fields carrying those same names are something else — backward two-point differences of the instrument's gimbal encoder angles over the sample interval, elevation for the cone rate and azimuth for the clock rate.

Nothing in the module said so, and the omission cost us. libera_rad populated its Cone_Angle_Rate and Clock_Angle_Rate from these columns on the reasonable assumption that matching names meant matching quantities, and shipped a different quantity than its product definition describes. Clock_Angle_Rate reached thousands of degrees per second at every nadir crossing against a declared range of [-20, 20], which was then managed with a 12-degree off-nadir gate that filled 15% of samples. LASP-Libera/libera_rad#34 fixes that downstream; this note is what stops the next mission repeating the mapping.

The docstrings now state:

  • Where the two definitions part company. Away from nadir they agree. Near closest approach they do not, and no crossing is required — a scan that misses nadir still drives the cone angle through a smooth minimum, so the geometric derivative falls to zero there while the encoder keeps turning at the scan rate. Libera's boresight misses nadir by 0.42 degrees and never crosses it, and the two still disagree by 60 deg/s at closest approach.
  • That the clock derivative's spike is a property of the coordinate, not the instrument. The clock angle is an azimuth about nadir, so nadir is its pole. Gating near nadir looks like a way to make this column resemble the product field, and is not one — the heritage flags apply no range edit to those fields at all (QA-7): their only failure mode is a missing angle.
  • Where the definitions come from. CERES BDS QA-6 for the encoder difference, with the rate fields at SCI-34/SCI-35.
  • That the encoder differences belong in mission code. They depend on a mission's own gimbal frames — for Libera, a chain of LIBERA_*_COORD frame names — so they are deliberately not added here. curryer keeps the generic geometry and the honest names.

Commits

The first commit adds the note; the two that follow correct it, after review caught claims that were narrower or stronger than the truth:

  • "part company at a nadir crossing" understated the divergence, which spans the whole neighbourhood of closest approach.
  • "the derivative of an azimuth about nadir is singular" contradicted that same sentence — at a non-zero miss the derivative peaks at a finite value and only diverges as the miss goes to zero.
  • The inserted paragraph had stranded "Its sign gives the direction the boresight sweeps relative to nadir" from the np.gradient it refers to, so "its" read as the CERES field named just before it, inverting the sentence. It also orphaned a note about cone_angle's [0, 90] range away from the conventions paragraph it belongs to.

I could not verify the QA-6 / QA-7 / SCI-34 / SCI-35 citations from inside this repo; they come from the heritage flag definitions supplied by the RBSP team, and confirmation of the controlling document version is an open follow-up.

mmaclay and others added 2 commits August 31, 2026 11:57
``cone_angle_rate`` and ``clock_angle_rate`` are the time derivatives their names say
they are, and the docstrings now say so explicitly, because the ERBE/CERES L2 product
fields carrying those same names are something else: finite differences of the
instrument's gimbal encoder angles, elevation for the cone rate and azimuth for the
clock rate.

The two agree away from nadir and part company at a nadir crossing. There the encoder
keeps turning at the scan rate, while the derivative of an azimuth about nadir is
singular and the derivative of the cone angle passes smoothly through its minimum. A
mission that populates those product fields from these columns therefore ships a
different quantity than the product definition describes, and no gate on the clock
derivative recovers the mechanism rate.

Nothing computational changes. The encoder differences depend on a mission's own gimbal
frames, so they belong in mission code rather than here, and the note says that too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The note now points at where the claim comes from rather than asserting it: CERES BDS QA-6
defines the scan rate as the absolute elevation gimbal position difference between the
current and previous measurement over the sample interval, and QA-7 places the rate fields
at SCI-34/SCI-35.

QA-7 also states that no edit checks are performed on those fields -- the only failure mode
is a missing angle. That is worth recording here, because gating this module's clock
derivative near nadir looks like a way to make it resemble the product field and is not one.

Still documentation only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.40%. Comparing base (f019d47) to head (8037675).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #187   +/-   ##
=======================================
  Coverage   79.40%   79.40%           
=======================================
  Files          98       98           
  Lines       14596    14596           
  Branches     1443     1443           
=======================================
  Hits        11590    11590           
  Misses       2498     2498           
  Partials      508      508           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Three wording fixes from review, no behavior change.

"Part company at a nadir crossing" was narrower than the divergence it describes. The two
definitions part company through the whole neighbourhood of closest approach, since a scan that
misses nadir still drives the cone angle through a smooth minimum, and no crossing is required
-- which is the Libera case, where the boresight misses nadir by 0.42 degrees and never crosses
it at all.

"The derivative of an azimuth about nadir is singular" contradicted that same sentence: at a
non-zero miss the derivative peaks at a finite value and only diverges as the miss goes to
zero. It now says that.

The paragraph added in the previous commit also stranded "Its sign gives the direction the
boresight sweeps relative to nadir" from the np.gradient it refers to, so "its" read as the
ERBE/CERES field named just before it -- inverting the sentence. The paragraph moved below it,
and the orphaned note about cone_angle's [0, 90] range returned to the conventions paragraph it
belongs to.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mmaclay mmaclay changed the title Clock cone rate conventions Document that the rate fields are not the heritage gimbal rates Sep 2, 2026
@mmaclay

mmaclay commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

I want to rethink this. I think we should simply REMOVE Cone angle rate and Clock angle rate from curryer since they are unused downstream, and the version used for libera needs to be calculated in libera Rad.

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.

1 participant