Skip to content

Commit 1e7a22d

Browse files
authored
Merge pull request #658 from achaikou/extheader1
Trace header extension 1
2 parents d1edaa8 + 8c3a5fd commit 1e7a22d

18 files changed

Lines changed: 667 additions & 125 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,10 @@ discriminate between the revisions, but instead tries to use information
357357
available in the file. For an *actual* standard's reference, please see the
358358
publications by SEG:
359359

360-
- [SEG-Y 0 (1975)](https://library.seg.org/pb-assets/technical-standards/seg_y_rev0-1686080980707.pdf)
361-
- [SEG-Y 1 (2002)](https://library.seg.org/pb-assets/technical-standards/seg_y_rev1-1686080991247.pdf)
362-
- [SEG-Y 2 (2017)](https://library.seg.org/pb-assets/technical-standards/seg_y_rev2_0-mar2017-1686080998003.pdf)
363-
- [SEG-Y 2.1 (2023)](https://library.seg.org/pb-assets/technical-standards/seg_y_rev2_1-oct2023-1701361639333.pdf)
360+
- [SEG-Y 0 (1975)](https://seg.org/wp-content/uploads/2025/11/seg_y_rev0.pdf)
361+
- [SEG-Y 1 (2002)](https://seg.org/wp-content/uploads/2025/11/seg_y_rev1.pdf)
362+
- [SEG-Y 2 (2017)](https://seg.org/wp-content/uploads/2025/11/seg_y_rev2_0_mar2017.pdf)
363+
- [SEG-Y 2.1 (2023)](https://seg.org/wp-content/uploads/2025/11/seg_y_rev2_1-oct2023.pdf)
364364

365365
## Contributing ##
366366

lib/include/segyio/segy.h

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,35 @@ typedef enum {
157157
SEGY_TR_UNASSIGNED2 = 237
158158
} SEGY_FIELD;
159159

160+
typedef enum {
161+
SEGY_EXT1_SEQ_LINE = 1,
162+
SEGY_EXT1_SEQ_FILE = 9,
163+
SEGY_EXT1_FIELD_RECORD = 17,
164+
SEGY_EXT1_ENSEMBLE = 25,
165+
SEGY_EXT1_RECV_GROUP_ELEV = 33,
166+
SEGY_EXT1_RECV_GROUP_DEPTH = 41,
167+
SEGY_EXT1_SOURCE_SURF_ELEV = 49,
168+
SEGY_EXT1_SOURCE_DEPTH = 57,
169+
SEGY_EXT1_RECV_DATUM_ELEV = 65,
170+
SEGY_EXT1_SOURCE_DATUM_ELEV = 73,
171+
SEGY_EXT1_SOURCE_WATER_DEPTH = 81,
172+
SEGY_EXT1_GROUP_WATER_DEPTH = 89,
173+
SEGY_EXT1_SOURCE_X = 97,
174+
SEGY_EXT1_SOURCE_Y = 105,
175+
SEGY_EXT1_GROUP_X = 113,
176+
SEGY_EXT1_GROUP_Y = 121,
177+
SEGY_EXT1_OFFSET = 129,
178+
SEGY_EXT1_SAMPLE_COUNT = 137,
179+
SEGY_EXT1_NANOSEC_OF_SEC = 141,
180+
SEGY_EXT1_SAMPLE_INTER = 145,
181+
SEGY_EXT1_RECORDING_DEVICE_NR = 153,
182+
SEGY_EXT1_ADDITIONAL_TR_HEADERS = 157,
183+
SEGY_EXT1_LAST_TRACE_FLAG = 159,
184+
SEGY_EXT1_CDP_X = 161,
185+
SEGY_EXT1_CDP_Y = 169,
186+
SEGY_EXT1_TRACE_HEADER_NAME = 233
187+
} SEGY_EXTENSION1_FIELD;
188+
160189
typedef enum {
161190
SEGY_BIN_JOB_ID = 3201,
162191
SEGY_BIN_LINE_NUMBER = 3205,
@@ -377,7 +406,7 @@ struct segy_datasource {
377406
/* Standard traceheader mapping. */
378407
segy_header_mapping traceheader_mapping_standard;
379408
/* Traceheader extension 1 mapping. */
380-
//segy_header_mapping traceheader_mapping_extension1;
409+
segy_header_mapping traceheader_mapping_extension1;
381410

382411
segy_metadata metadata;
383412
};
@@ -474,6 +503,9 @@ int segy_samples( const char* binheader );
474503
*/
475504
int segy_traceheaders( const char* binheader, int* traceheader_count );
476505

506+
/* Reads into allocated memory traceheader names from first trace. */
507+
int segy_traceheader_names( segy_datasource* ds, char (*names)[8] );
508+
477509
/*
478510
* calculate delay recording time for the first trace.
479511
*/
@@ -507,13 +539,18 @@ int segy_encoding( segy_datasource*, int* encoding );
507539

508540
/* Converts entry type to actual datatype and returns it (not an error code). */
509541
int segy_entry_type_to_datatype( uint8_t entry_type );
510-
/* Binary header layout map. Indicies (offsets) are 0-based. */
542+
/* Binary header layout map. Indices (offsets) are 0-based. */
511543
const segy_entry_definition* segy_binheader_map( void );
512-
/* Default trace header layout map. Indicies (offsets) are 0-based. */
544+
/* Default trace header layout map. Indices (offsets) are 0-based. */
513545
const segy_entry_definition* segy_traceheader_default_map( void );
514-
/* Default trace header name to 1-based offset map. ndicies (names) correspond
546+
/* Default trace header extension 1 layout map. Indices (offsets) are 0-based. */
547+
const segy_entry_definition* segy_ext1_traceheader_default_map( void );
548+
/* Default trace header name to 1-based offset map. Indices (names) correspond
515549
* to SEGY_FIELD enum. */
516550
const uint8_t* segy_traceheader_default_name_map( void );
551+
/* Default trace header extension 1 name to 1-based offset map. Indices (names)
552+
* correspond to SEGY_EXTENSION1_FIELD enum. */
553+
const uint8_t* segy_ext1_traceheader_default_name_map( void );
517554

518555
/* Reads one trace field data from given 0-based header. 0-based
519556
* offset-to-entry-definition mapping should correspond to provided header.

0 commit comments

Comments
 (0)