Skip to content

Rename axis_line to axis_ion, and let each ion emit several spectral lines - #57

Open
roytsmart wants to merge 1 commit into
mainfrom
feature/ions
Open

roytsmart wants to merge 1 commit into
mainfrom
feature/ions

Conversation

@roytsmart

Copy link
Copy Markdown
Contributor

The Level-4 model of ESIS ties some of its spectral lines together, and ctis had no way to. This lets an ion of the scene emit several lines, and renames the axis of the scene which separates the ions to axis_ion.

Why

O IV 608 and 610 come from one ion, as do Mg X 610 and 625. Tempest inverts one scene for each pair and images it at both lines with a fixed ratio (0.538 for O IV, 0.52 for Mg X), so M8 needs the same to reproduce its product. The roadmap left the API open; this names the axis of the scene after the ions and describes the lines of each ion beside it.

What changes

  • axis_ion is the axis of the scene which separates its spectral bands, the name axis_line had until now. This breaks a released name, so the next release is 0.8.0. Code which still passes axis_line alone is refused with an error which says that the fields of the lines are given together.
  • The lines of each ion, three new abstract properties of AbstractInstrument and fields of IdealInstrument and OptikaInstrument, given all three or none:
    • axis_line, the axis of the lines;
    • wavelength_line, the rest wavelength of each line, along axis_line only;
    • ratio_line, with the axes axis_ion and axis_line: the photons which each line emits for each photon of the scene of its ion, and zero for the lines of other ions. Each line belongs to one ion, and each ion emits at least one line.
  • The scene of an ion with lines is the spectrum of its velocities, on a na.DopplerPositionalVectorArray grid, and each line images it at its rest wavelength times 1 + v/c. An ion with no lines given is one line, as before.
  • The matrices keep each line as a voxel of its own, with its own gain, quantum yield and variance-to-mean ratio, fed the scene of its ion times its ratio. Their size is that of the untied model, which ran at production in the first look at frame 15 (Add the first look at frame 15 of the flight to the MART roadmap #55).
  • The backprojection blends the lines of each ion with the weights of tempest: the share of each line in the flux of its ion, its ratio times the sum of its weights before any mask, which the first pass of the build now totals. Operators gains index_line, ratio, blend and scale_backproject_scene, the backprojection factor of each ion, which the first guess of MartInverter now uses.
  • The methods of both instruments do the same without the matrices: image(), backproject() and snr(), integrated along wavelength or not. A photon of the scene has the energy of the lines it emits.
  • The roadmap gains a row for this change, marks the weighting of the lines of an ion as resolved, and says that M8 is ours.

Checked

  • The whole suite passes locally (747 tests), black and ruff are clean, and every added line of the package is covered.
  • For both instruments:
    • ions with one line each give the results of an instrument told nothing of lines;
    • the image of an ion is the sum of the images of its lines, computed by an instrument whose ions are those lines;
    • the matrices and the methods agree to about 1e-16 on the images, the backprojections and the blend, and on the variance of the sensor model of OptikaInstrument to 3e-4;
    • invalid lines are refused, in 13 ways.
  • MartInverter takes the same path to the same solution on the matrices as on the methods of the instrument, for both instruments. On OptikaInstrument the mean chi squared differs within the tolerance of the existing test of lines.

Notes:

  • wavelength_line lists each line once, and ratio_line places each line in its ion, so no ion needs placeholder lines. For ESIS that is 7 wavelengths and a table of 5 ions by 7 lines.
  • For one line per ion, scale_backproject_scene is the old backprojection factor.

🤖 Generated with Claude Code

https://claude.ai/code/session_01StcJvVHMXbjJmyFFwf4Pcn

…ral lines

The Level-4 model of ESIS ties spectral lines: O IV 608 and 610 come
from one ion, as do Mg X 610 and 625, so tempest inverts one scene for
each pair and images it at both lines, with a fixed ratio between
them. ctis had no way to say that two lines share a scene.

The axis of the scene which separates its spectral bands is now
`axis_ion`, the name `axis_line` had until now. An ion may emit several
lines, given by three new fields of `AbstractInstrument`,
`IdealInstrument` and `OptikaInstrument`, all three or none:
`axis_line`, the axis of the lines; `wavelength_line`, the rest
wavelength of each line along it; and `ratio_line`, with the axes of
the ions and of the lines, the photons which each line emits for each
photon of the scene of its ion, and zero for the lines of other ions.
The scene of an ion is then the spectrum of its velocities, on a
Doppler grid, and each of its lines images that spectrum at its own
wavelengths, its rest wavelength times 1 + v/c. An ion with no lines
given is one line, as before.

The matrices keep each line as a voxel of its own, with its own gain
and noise, fed the scene of its ion times its ratio, so they are the
size of the untied model. The backprojection blends the lines of each
ion with the weights of tempest, the share of each line in the flux
of its ion, which the first pass of the build now totals, and the
first guess of MART uses the backprojection factor of each ion. The
methods of both instruments do the same without the matrices.

This renames a field of a released version, so the next release is
0.8.0. Code which still passes `axis_line` alone is refused, since the
three fields of the lines are given together.

The roadmap gains a row for this change, marks the weighting of the
lines of an ion as resolved, and says that M8 is ours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StcJvVHMXbjJmyFFwf4Pcn
@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (682c535) to head (a594465).

Additional details and impacted files
@@            Coverage Diff             @@
##              main       #57    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           29        29            
  Lines         4997      5537   +540     
==========================================
+ Hits          4997      5537   +540     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

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