Skip to content

[EsvIntersection]: Use bilinear interpolation instead of cell-based readout for seismic layers - #1886

Open
rubenthoms wants to merge 7 commits into
equinor:mainfrom
rubenthoms:modules/improve-seismic-readout-accuracy
Open

rubenthoms wants to merge 7 commits into
equinor:mainfrom
rubenthoms:modules/improve-seismic-readout-accuracy

Conversation

@rubenthoms

Copy link
Copy Markdown
Collaborator

No description provided.

@rubenthoms rubenthoms self-assigned this Sep 7, 2026
@rubenthoms
rubenthoms requested review from HansKallekleiv and a balanced review from Copilot September 7, 2026 09:09
@rubenthoms rubenthoms changed the title Use bilinear interpolation instead of cell-based readout [EsvIntersection]: Use bilinear interpolation instead of cell-based readout for seismic layers Sep 7, 2026
@rubenthoms rubenthoms added the enhancement New feature or request label Sep 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Trace positioning, canvas pixel alignment, and missing-value handling can produce incorrect readouts.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds bilinear interpolation to seismic readouts for smoother values and RGB sampling.

Changes:

  • Interpolates RGB canvas pixels.
  • Interpolates seismic values across traces and depth samples.
File summaries
File Description
frontend/src/modules/_shared/components/EsvIntersection/utils/readoutItemUtils.tsx Adds bilinear seismic readout calculations.
Review details

Suppressed comments (2)

frontend/src/modules/_shared/components/EsvIntersection/utils/readoutItemUtils.tsx:482

  • Fence data uses NaN as its fill value, and the rendered image converts those entries to 0 before interpolation. Reading the raw array here means any missing neighbor makes the entire result NaN—even when its interpolation weight is zero—so valid sample centers can display no numeric value. Apply the same NaN-to-zero normalization used by createSeismicSliceImageDatapointsArrayFromFenceTracesArray.
            const valueAt = (traceNum: number, sampleNum: number) =>
                seismicData.fenceTracesArray[traceNum * seismicData.numSamplesPerTrace + sampleNum];

frontend/src/modules/_shared/components/EsvIntersection/utils/readoutItemUtils.tsx:466

  • This assumes traces are uniformly spaced at cell centers, but each trace is located at its entry in trajectoryFenceProjection, which is built from actual (potentially unequal) section lengths. The renderer likewise chooses the enclosing trajectory segment and interpolates by its local ratio (SeismicLayer.ts:261-279). As written, a cursor exactly on a trace can return a blend of adjacent traces. Locate the segment in trajectoryFenceProjection and derive traceFrac from that segment's two x coordinates instead.
            const sampleGridPos = (y - seismicData.minFenceDepth) / rowHeight;
            const traceGridPos = (x - seismicInfo.minX) / columnWidth;
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Horizontal interpolation incorrectly assumes uniformly spaced traces instead of using actual trajectory coordinates.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Missing seismic samples can produce NaN readouts inconsistent with the rendered layer.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The interpolation logic aligns with seismic rendering and correctly handles boundaries and missing values.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants