Survey Geometry
Functions and utilities related to SEG-Y/Seismic Geometry
fit_plane(x, y, z, p0=(1.0, 1.0, 1.0))
Calculate the plane function coefficients for input data and return a partial plane function.
Source code in segysak/geometry.py
Python | |
---|---|
16 17 18 19 20 21 |
|
get_uniform_spacing(points, extra=None, bin_spacing_hint=10, method='linear')
Interpolate the cdp_x, cdp_y arrays uniformly while staying close to the requested bin spacing
Assumes no gaps in the points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
points |
array
|
cdp_x, cdp_y point pairs [M, 2] defining the path segments. |
required |
extra |
List[array]
|
a list of 1D arrays [M] to also interpolate along the path. |
None
|
bin_spacing_hint |
float
|
A bin spacing to stay close to, in cdp world units. Default: 10 |
10
|
method |
str
|
The scipy interp1d interpolation method between points. |
'linear'
|
Returns:
Type | Description |
---|---|
Tuple[array, Union[List[array], None]]
|
Interpolated points, Interpolated extra vars: Uniform sampling using the bin_spacing hint. |
Source code in segysak/geometry.py
Python | |
---|---|
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
|
lsq_affine_transform(x, y, zero_small_values=True, estimate_error=False)
Calculate the Affine transform from the least squared solver.
Note, this is not an exact solution as there can be numeric error, but it is more robust than exact methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
array
|
The input coordinates as pairs [M, 2]. E.g. [[iline, xline], ...] |
required |
y |
array
|
The output coordinates as pairs [M, 2]. E.g. [[cdp_x, cdp_y], ...] |
required |
zero_small_values |
bool
|
Set small values in the LSQ solution to zero. |
True
|
estimate_error |
bool
|
Optionally use the transform to return a tuple of (mean, max) error for estimated transform. |
False
|
Returns:
Type | Description |
---|---|
Tuple[Affine2D, Tuple[float, float]]
|
transform, error: Returns the matplotlib Affine2D object and optionally an error estimate tuple. |
Source code in segysak/geometry.py
Python | |
---|---|
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 |
|
orthogonal_point_affine_transform(x, y, estimate_error=False)
Calculate an affine transform using orthogonal points. This assumes an orthogonal survey. If you have a
skewed goemetry, use lsq_affine_transform
.
^ (2, 2)
|
|
|
|
|_
|_|____________>
(0, 0) (1, 1)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tuple
|
The input coordinates as pairs [3, 2]. E.g. [[iline, xline], ...] |
required |
y |
array
|
The output coordinates as pairs [3, 2]. E.g. [[cdp_x, cdp_y], ...] |
required |
estimate_error |
bool
|
Optionally use the transform to return a tuple of (mean, max) error for estimated transform. |
False
|
Returns:
Type | Description |
---|---|
Tuple[Affine2D, Tuple[float, float]]
|
transform, error: Returns the matplotlib Affine2D object and optionally an error estimate tuple. |
Source code in segysak/geometry.py
Python | |
---|---|
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 |
|
plane(xy, a, b, c)
Function of a plane for linear fitting using curve_fit
Source code in segysak/geometry.py
Python | |
---|---|
10 11 12 13 |
|