Parsers API
Format parsers for geophysical instruments.
DT1File
Sensors & Software .DT1/.HD format handler.
The .HD ASCII header provides survey-level metadata (samples per trace, time window, channels). The .DT1 binary file contains interleaved 128-byte trace headers and trace data.
Usage
dt1 = DT1File("survey.dt1") data = dt1.traces # (num_traces, samples_per_trace) array pos = dt1.trace_positions # odometer position per trace (m)
Source code in dig/parsers/dt1.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
hd_metadata
property
Raw .HD key-value pairs.
trace_elevations
property
GPS elevation (m) for each trace.
trace_positions
property
Odometer position (m) for each trace.
trace_time_zeros
property
Time-zero offset (ns) for each trace.
traces
property
2D array of shape (num_traces, samples_per_trace).
get_trace(index)
Return a single trace as a 1D array.
Source code in dig/parsers/dt1.py
141 142 143 144 145 | |
DZTFile
GSSI .DZT format handler.
Wraps the Rust DZT parser and provides NumPy array access to trace data via memory-mapped I/O. Supports .DZG sidecar GPS files for georeferencing.
Usage
dzt = DZTFile("survey.dzt") data = dzt.traces # (num_traces, samples_per_trace) array gps = dzt.gps_positions # [(trace_idx, lat, lon, alt), ...]
Source code in dig/parsers/dzt.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
gps_positions
property
GPS positions from .DZG sidecar: [(trace_idx, lat, lon, alt), ...].
traces
property
2D array of shape (num_traces, samples_per_trace).
get_trace(index)
Return a single trace as a 1D array.
Source code in dig/parsers/dzt.py
113 114 115 116 117 | |
MagnetometryFile
Bartington/Geoscan .dat/.grd format handler.
Parses the .grd ASCII header for grid metadata and the .dat binary file for magnetic gradient measurements. Handles zig-zag traverse reversal and void value detection.
Usage
mag = MagnetometryFile("survey.dat", "survey.grd") data = mag.data # (rows, cols) int16 array grid = mag.grid_metadata # dict of .grd parameters
Source code in dig/parsers/magnetometry.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
cell_size
property
Grid cell size in meters.
data
property
2D array of shape (rows, cols) with magnetic gradient values (int16).
Void values (-32768) indicate missing/no-data cells. Use np.ma.masked_equal(mag.data, VOID_VALUE) for masked arrays.
grid_metadata
property
Raw .grd key-value pairs.
origin_easting
property
Grid origin easting coordinate.
origin_northing
property
Grid origin northing coordinate.
rotation_deg
property
Grid rotation in degrees.
shape
property
Grid dimensions (rows, cols).
void_mask
property
Boolean mask: True where data is void/missing.
SEGYFile
SEG-Y format handler.
SEG-Y is the Society of Exploration Geophysicists interchange format, widely used as a universal interoperability standard.
Source code in dig/parsers/segy.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |