utils_io.py
#
Miscellaneous utility functions for file I/O.
read_and_merge(files, splitter='UTM', **kwargs_csv)
#
Read files
list into combined pandas.DataFrame
.
Parameters:
-
files
(list
) –List of file paths.
-
splitter
(str
, default:'UTM'
) –String used to split filename to derive "original" filename (default:
UTM60S
). -
**kwargs_csv
(dict
, default:{}
) –Optional parameter for
pd.read_csv
function.
Returns:
-
DataFrame
–Combined DataFrame of all read files.
Source code in pseudo_3D_interpolation\functions\utils_io.py
read_auxiliary_files(path, fsuffix, prefix=None, suffix=None, index_cols=['line', 'tracl'], splitter='UTM')
#
Read auxiliary files (e.g. nav
, tide
, or mistie
) into Pandas DataFrame.
Parameters:
-
path
(str
) –Path of (a) directory or (b) datalist with SEG-Y file(s).
-
fsuffix
(str
) –File suffix.
-
prefix
(str
, default:None
) –Filename prefix for filtering (default:
None
). -
suffix
(str
, default:None
) –Filename suffix for filtering (default:
None
) -
index_cols
(list
, default:['line', 'tracl']
) –Index columns of returned DataFrame.
-
splitter
(str
, default:'UTM'
) –Split filename using given string (default:
UTM
).
Returns:
-
df
(DataFrame
) –Combined DataFrame of all auxiliary files with (filtered using
fsuffix
andprefix
).
Source code in pseudo_3D_interpolation\functions\utils_io.py
export_coords(out_path, xcoords, ycoords, coordinate_units, index_label=None, aux_info=None, aux_cols=None)
#
Export function for (reprojected) coordinates.
Parameters:
-
out_path
(str
) –Output file path.
-
xcoords
(ndarray
) –Array of X coordinates.
-
ycoords
(ndarray
) –Array of Y coordinates.
-
coordinate_units
(int
) –SEG-Y specific coordinate unit specifier integer.
-
index_label
(str
, default:None
) –Label to use for pandas index column (default: None).
-
aux_info
(list
, default:None
) –List of auxiliary SEG-Y header information to write (default: None).
-
aux_cols
(list
, default:None
) –List of auxiliary SEG-Y header names (default: None).
Source code in pseudo_3D_interpolation\functions\utils_io.py
extract_navigation_from_segy(path, fsuffix='sgy', fnprefix=None, fnsuffix=None, splitter='UTM60S', src_coords_bytes=(73, 77), kwargs_segyio=None, write_aux=False)
#
Extract coordinates from SEG-Y file(s) in given directory or specified in datalist.
Parameters:
-
path
(str
) –Path of (a) directory or (b) datalist with SEG-Y file(s).
-
fsuffix
(str
, default:'sgy'
) –File suffix (default: 'sgy'). Only used if
path
is a directory. -
fnprefix
(str
, default:None
) –Filename prefix for filtering (default: None). Only used if
path
is a directory. -
fnsuffix
(str
, default:None
) –Filename suffix for filtering (default: None). Only used if
path
is a directory. -
splitter
(str
, default:'UTM60S'
) –String used to split filename to derive "original" filename (default: 'UTM60S').
-
src_coords_bytes
(tuple
, default:(73, 77)
) –Byte position of coordinates in SEG-Y trace headers (default: (73, 77)).
-
kwargs_segyio
(dict
, default:None
) –Parameter for
segyio.open()
(default: None). -
write_aux
(bool
, default:False
) –Write extracted navigation to individual auxiliary files (*.nav).
Source code in pseudo_3D_interpolation\functions\utils_io.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
|