Harpspol - #38
Conversation
HARPSPOL dual-beam traces are ordered bottom-to-top on the CCD, i.e.
red-to-blue, matching the config wavelength range directly — so no
reversal is needed (unlike single-fiber HARPS). Ship dedicated
wavecal_{blue,red}_2D.npz with order numbering matching that trace
ordering instead of borrowing the HARPS non-pol files.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The scatter step is no longer run for HARPSPOL reductions (matches the harpspol pipeline dropping it from steps and calibration products). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 0.9 trace rewrite numbers traces bottom-up (blue-first for
HARPSPOL), so the red-first config wavelength_range must be reversed
to line up with spectrum rows. Without this, wavecal matched the 2D
reference against reversed orders, discarded >80% of lines, and wrote
reversed + extrapolated wavelengths (verified on the 2012-07-15 night;
first calib night reduced end-to-end under 0.9b1).
Note: the shipped wavecal_{blue,red}_2D.npz linelists are still
red-first and only work with the pre-0.9 ordering — run the
wavecal_init step (atlas bootstrap) instead of relying on them.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Remap ORDER -> nord-1-ORDER (blue-first, matching bottom-up trace numbering). Validated absolutely by correlating extracted ThAr against the ThAr atlas per order (corr 0.7-0.9 with the flipped solution vs ~0 without). This test also revealed the previous (pre-0.9) solutions were off by one order: each order carried the wavelengths of its one-redder neighbor, self-consistently, because ThAr lines repeat in adjacent-order overlaps. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks Alexis — reviewed this against master (branch is based on the v0.9 tip, and nothing on master has touched HARPSPOL since, so no conflicts). Two of the four commits cancel each other out, and I think one of the cancellations is unintentional. Before merging I'd like your confirmation on three points. 1. The two new npz files are content-identical to the HARPS ones. I extracted
Those three keys are read nowhere in PyReduce ( So the 2. The scatter block removal is a silent behaviour change.
3. Two doc nits, easy to fix once the above is settled.
Unrelated suggestion, for later: HARPSPOL ships no |
|
Thanks Thomas — I've checked all three and you're right on each. Confirmations and one addition. 1. Confirmed, and the npz files should go. I reproduced your comparison at the PR head: More usefully, I can show the flip isn't needed. The reduction I've been running for the HARPSpol archive uses exactly this state — So: delete both npz files and let One more for the squash message — 2. Confirmed, and worth going further than restoring the block. I ran an A/B on a full month (17 sequences, 4 calibration nights, 2015-06), reduced both ways, and then a per-value test on one observation, HD 136504:
The trend is monotonic — a larger height masks more of the order, so less stellar flux leaks into the background fit — but 20 still keeps only 2.3% of the blue flux and 24% of the red, and leaves 21 orders unnormalisable. Across the full month at 0.6 the count of such orders went from 6 to 1066. So restoring the block doesn't rescue the step; it moves it from badly broken to slightly less badly broken. Your objection stands regardless, since deleting the block while leaving the step discoverable is a silent change, but the more useful conclusion is that scatter is currently unusable for HARPSPOL at any of these settings. The damage scales with target faintness (α Cen −3.4×, CPD-246168 −325×), which points at the model being fitted on the bright For this PR I'd take your second option: drop the 3. Confirmed — the docstring is the wrong one. Order 0 is 3830 Å in blue and 5369 Å in red, both the bluest. The On |
|
Agreed on all three — and thanks for the scatter A/B, that's more than I asked for. Please do open the separate issue with those numbers. Waiting on you for: delete the two npz files and delegate I'll check separately whether |
- Delete the HARPSPOL wavecal_{blue,red}_2D.npz copies and restore
get_wavecal_filename's delegation to the HARPS directory. The copies were
byte-identical to the HARPS files in cs_lines and obase, differing only by
dropping solution_2d, oincr and bad_order, none of which PyReduce reads, so
they added ~250 kB to the wheel and changed nothing. The ORDER flip they were
meant to carry is not present in them; the ordering fix is the wave_range
reversal, which is retained.
- Drop the scatter entry from get_expected_values, so HARPSPOL no longer
declares a step it cannot currently use. Note this does NOT make the step
unreachable: pipeline.from_instrument falls back to the flat files
(`files.get("scatter", files.get("flat"))`), so an explicit steps=(...,
"scatter", ...) still runs, on the same LAMP,LAMP,TUN frames id_scatter
would have selected. Making it genuinely unavailable needs a guard upstream
or the scaling fixed; see the separate issue.
- Correct the get_wavecal_filename docstring, which claimed order 0 is the
reddest. It is the bluest: 3830 A in blue, 5369 A in red.
Verified: get_wavecal_filename resolves to the HARPS files with order 0 bluest
in both channels, the package imports cleanly, and requesting scatter
explicitly still constructs a pipeline that runs it via the flat fallback.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #38 +/- ##
=========================================
Coverage ? 57.02%
=========================================
Files ? 58
Lines ? 8994
Branches ? 0
=========================================
Hits ? 5129
Misses ? 3865
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Pushed the four changes — One correction on your point 2, from testing rather than reading: dropping the expectation does not make the step unreachable. "scatter": lambda: pipe.scatter(files.get("scatter", files.get("flat"))),— so an explicit Scatter numbers and the scaling trace are in #39 — including that Suggested squash message, since the net change is now much smaller than the branch history suggests: |
No description provided.