Skip to content

Commit e5628b6

Browse files
committed
Update docs
1 parent 07833de commit e5628b6

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

docs/api_reference.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ and
3232
:members:
3333
```
3434

35+
### Grid Overrides
36+
37+
```{eval-rst}
38+
.. autopydantic_model:: mdio.GridOverrides
39+
```
40+
3541
## Core Functionality
3642

3743
### Dimensions

docs/guides/grid_overrides.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@ Grid overrides are transformations applied during SEG-Y import that modify how t
1010

1111
When importing SEG-Y data, MDIO maps trace header fields to dataset dimensions. However, real-world seismic data often has complexities that require additional processing. Grid overrides address these issues by transforming header values before indexing.
1212

13+
## Configuring grid overrides
14+
15+
Grid overrides are passed to {func}`mdio.segy_to_mdio` via the `grid_overrides` argument as an
16+
{class}`mdio.GridOverrides` instance:
17+
18+
```python
19+
from mdio import GridOverrides
20+
from mdio import segy_to_mdio
21+
22+
segy_to_mdio(
23+
...,
24+
grid_overrides=GridOverrides(calculate_shot_index=True),
25+
)
26+
```
27+
28+
Both modern `snake_case` field names and the legacy `CamelCase` aliases are accepted, so
29+
`GridOverrides(CalculateShotIndex=True)` is equivalent to the example above. Unknown keys
30+
are rejected at construction with a `pydantic.ValidationError`.
31+
32+
```{deprecated} 1.2
33+
Passing `grid_overrides` as a `dict` still works but logs a deprecation warning and will be
34+
removed in a future release. Switch to `mdio.GridOverrides`.
35+
```
36+
1337
## CalculateShotIndex
1438

1539
Calculates a dense `shot_index` dimension from sparse or interleaved `shot_point` values. Required for the `ObnReceiverGathers3D` template.
@@ -37,12 +61,15 @@ The override detects the geometry type and only applies the transformation when
3761
**Usage:**
3862

3963
```python
64+
from mdio import GridOverrides
65+
from mdio import segy_to_mdio
66+
4067
segy_to_mdio(
4168
input_path="obn_data.sgy",
4269
output_path="obn_data.mdio",
4370
segy_spec=obn_spec,
4471
mdio_template=get_template("ObnReceiverGathers3D"),
45-
grid_overrides={"CalculateShotIndex": True},
72+
grid_overrides=GridOverrides(calculate_shot_index=True),
4673
)
4774
```
4875

docs/guides/obn_data_import.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ A warning is logged when component is synthesized:
6666
from segy.schema import HeaderField
6767
from segy.standards import get_segy_standard
6868

69+
from mdio import GridOverrides
6970
from mdio import segy_to_mdio
7071
from mdio.builder.template_registry import get_template
7172

@@ -91,7 +92,7 @@ segy_to_mdio(
9192
output_path="obn_data.mdio",
9293
segy_spec=obn_spec,
9394
mdio_template=get_template("ObnReceiverGathers3D"),
94-
grid_overrides={"CalculateShotIndex": True},
95+
grid_overrides=GridOverrides(calculate_shot_index=True),
9596
overwrite=True,
9697
)
9798
```

0 commit comments

Comments
 (0)