agentleFS
SteadfastAsArtSteadfastAsArt/geoscience-skills/segysak/SKILL.md

segysak

Skill67 starsChanged 10 months agoMITView on GitHub

Read SEG-Y as labelled xarray datasets with SEGY-SAK, inspect header-defined survey dimensions and process seismic volumes lazily. Use for SEG-Y/xarray/Dask workflows; use segyio for exact low-level trace and header editing.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check dimension key uniqueness and missing traces.

    line 28
  2. Distinctive:

    Use the current documentation and backend source.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SEGY-SAK

Map trace headers to labelled dimensions without losing the original survey geometry. Header byte assignments are evidence to inspect, not safe guesses.

Before opening

Inspect format/endian, trace count, sample count/interval, delay recording time, inline/crossline or CDP headers, coordinate units and scalar. SEG-Y sample intervals are stored in microseconds; the backend's vertical samples use milliseconds for ordinary time sections. A depth section needs an explicit depth convention. Confirm actual data units before labelling an axis.

Check dimension key uniqueness and missing traces. Sparse or irregular geometry may not form a complete rectangular cube. Keep the original trace index for exports. A dimension byte offset is one-based SEG-Y numbering (CDP ensemble is 21, inline is 189, crossline is 193); some upstream old examples use a wrong CDP offset. Use the actual file's header convention.

Labelled read

This fragment needs an existing, verified rectangular post-stack file. It uses the 0.5 backend API; old segy_loader tutorials describe a different interface.

# example: labelled-segy
import xarray as xr
import segysak  # registers accessors; the installed distribution provides the backend

with xr.open_dataset(
    seismic_path,
    engine="sgy_engine",
    dim_byte_fields={"iline": 189, "xline": 193},
) as seismic:
    inline_labels = seismic.iline.values.copy()
    crossline_labels = seismic.xline.values.copy()
    sample_coordinate = seismic.samples.values.copy()
    amplitudes = seismic["data"].load().copy(deep=True)

For large surveys, open with Dask chunks chosen for the access pattern and retain lazy operations until the selected result fits memory. Avoid .load() on a whole production cube. Inspect coordinate variables before .sel() and use .isel() only for integer positions.

Validation and exports

Compare several labelled traces against original trace samples using segyio, including the last sample and nonzero start time. Verify shape, orientation, missing-trace behavior and coordinate scalars. Round-trip any export and compare headers as well as amplitudes; xarray labels alone do not preserve every SEG-Y header or prove geographic CRS. Keep source hash, byte mapping and transforms.

Use the current documentation and backend source.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.