Skip to content

Instantly share code, notes, and snippets.

View kwinkunks's full-sized avatar
🐍
Writing bugs

Matt Hall kwinkunks

🐍
Writing bugs
View GitHub Profile
@kwinkunks
kwinkunks / Spectral_decomposition.ipynb
Created September 24, 2021 18:03
Spectral decomposition
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kwinkunks
kwinkunks / Image-based_modeling_with_PSF.ipynb
Created September 8, 2021 17:18
Forward model seismic data by convolution of a reflectivity series with a point-spread function
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kwinkunks
kwinkunks / README.md
Last active April 28, 2021 17:18
Convert SEG-Y into WAV files

You'll need to install Python somehow before using this script.

I recommend installing Miniconda

Then do this in the terminal (or Anaconda prompt on Windows):

conda create -n segy2wav python=3.8 scipy
conda activate segy2wav
pip install click segyio

python segy2wav.py --help

@kwinkunks
kwinkunks / spwla.py
Last active June 15, 2021 19:41
Reads special core analysis and core description from SPWLA formatted files.
#!/usr/bin/env python
"""
Reads special core analysis and core description from SPWLA formatted files.
Usage:
./spwla.py infile.spwla outfile.csv
Author:
Matt Hall, ca. 2021
© agilescientific.com
@kwinkunks
kwinkunks / read_from_web.py
Last active October 25, 2021 17:37
Read a file from the Internet to give to an arbitrary function
import re
import urllib
from io import BytesIO
# If the fname you gave me looks like a URL...
if re.match(r'https?://.+\..+/.+?', fname) is not None:
try:
data = urllib.request.urlopen(fname).read()
except urllib.error.HTTPError as e:
@kwinkunks
kwinkunks / check_seg2.py
Last active March 24, 2021 19:28
Read a SEG2 formatted seismic or GPR file.
"""
Run as a script:
python test_check.py /path/to/myfile.seg2
Adapted from https://github.com/agile-geoscience/jeepr
"""
from struct import unpack
import sys
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kwinkunks
kwinkunks / segy2tiff.csh
Created March 19, 2021 13:56
Old-school conversion of SEG-Y to TIFF (requires segy2ascii and pnmtotiff)
#!/bin/csh
# ++++++++++++++++++++++
# segy2ascii
# Matt Hall, October 2009
# Converts SEGY file to a TIFF, one sample per pixel
# First, export a SEGY file from Poststack, putting Trace in byte 13
# Note the name of the project and the name of the file
# Run this file and follow the instructions
# ++++++++++++++++++++++
#
@kwinkunks
kwinkunks / las2ppm.awk
Created March 19, 2021 13:50
Make a plain PPM image from 3 wireline logs in a LAS file
#!/usr/bin/gawk -f
#
# This file makes 8-bit RGB images from 3 logs
# The output is PLAIN (not RAW) PPM
# You need an LAS file containing only these logs
# Then run this script on that LAS file
# The Height should be set to the number of samples in the logs
#
# Set up the PGM Plain File format header
BEGIN {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.