Skip to content

Add the METimage instrument definition - #245

Open
mraspaud wants to merge 1 commit into
pytroll:mainfrom
mraspaud:add-metimage-instrument
Open

Add the METimage instrument definition#245
mraspaud wants to merge 1 commit into
pytroll:mainfrom
mraspaud:add-metimage-instrument

Conversation

@mraspaud

@mraspaud mraspaud commented Sep 2, 2026

Copy link
Copy Markdown
Member

METimage (VII) on Metop-SG-A is a whisk-broom scanner recording 24 lines per sweep of its rotating telescope, so it fits MultiLineWhiskbroomScan directly. The geometry comes from the EPS-SG VII L1B product format specification (3144 across-track samples, 24 along-track samples per scan) and from the instrument description (1.729 s per revolution at constant scan angle, 0.6 mrad IFOV, 108 degrees of Earth view).

Without this, trollsched fails with an AttributeError when computing a METimage swath boundary, as it looks the instrument up by name in pyorbital.geoloc_instrument_definitions.

  • Tests added

METimage (VII) on Metop-SG-A is a whisk-broom scanner recording 24 lines
per sweep of its rotating telescope, so it fits MultiLineWhiskbroomScan
directly.  The geometry comes from the EPS-SG VII L1B product format
specification (3144 across-track samples, 24 along-track samples per
scan) and from the instrument description (1.729 s per revolution at
constant scan angle, 0.6 mrad IFOV, 108 degrees of Earth view).

Without this, trollsched fails with an AttributeError when computing a
METimage swath boundary, as it looks the instrument up by name in
pyorbital.geoloc_instrument_definitions.
@mraspaud mraspaud self-assigned this Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.29%. Comparing base (caf82e9) to head (206d42e).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #245      +/-   ##
==========================================
+ Coverage   92.17%   92.29%   +0.11%     
==========================================
  Files          19       19              
  Lines        4127     4190      +63     
==========================================
+ Hits         3804     3867      +63     
  Misses        323      323              
Flag Coverage Δ
unittests 92.29% <100.00%> (+0.11%) ⬆️

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.

@Manny7717 Manny7717 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verified on head 206d42e vs base origin/main 3840769.

Purpose confirmed. geoloc_instrument_definitions previously had no METimage entry, so trollsched's swath-boundary lookup by instrument name would AttributeError (as the PR body states). The new metimage()/metimage_edge_geom() + METIMAGE_SCAN (MultiLineWhiskbroomScan) close that gap.

Geometry is internally consistent and matches the cited sources. Numbers cross-check: 108° Earth view / 3144 pixels = 0.6 mrad/pixel (matches the documented IFOV); scan half-angle (pixels−1)/2 steps ≈ 53.98°; pixel dwell time = sweep time / pixels where sweep time = 1.729 s × 108/360 (constant scan rate); along-track step = same sampling step (square pixels, 24 lines/scan). All are documented with the EPS-SG VII spec + Cao/Bruens references in the header.

Regression-proven. The 6 new tests (shape, ±54° swath edges, edge-to-edge 108°, 0.6 mrad IFOV cross-check, scan timing 108/360 fraction + full-revolution scan spacing, and a real geolocation of the edge geometry with a Metop-A TLE landing ~2800 km swath at zero altitude) all FAIL on base (6 failed — no metimage symbol) and PASS on head (6 passed).

Zero regressions. Full test_geoloc.py: head 115 passed / 1 skipped vs base 109 passed / 1 skipped — delta is exactly the 6 new tests, identical skip, no failures on either side. ruff (v0.16.1, repo pre-commit pin) clean on both changed files.

Non-blocking notes: (1) metimage_edge_geom hardcodes np.array([0, _METIMAGE_PIXELS - 1]) instead of reading pixel 1 as "left" via the scan's own convention, but the sign convention is asserted in the tests (cross_track[0] > 0) so drift would be caught; (2) the module-level scan objects pattern matches the existing viirs/modis style, so no new pattern introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants