Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
running under 3.9 and mpl 3.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
kwinkunks committed Mar 25, 2022
1 parent 4afaea9 commit 5d48995
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ data/*.pdf
data/*.png
.ipynb
.ipynb_checkpoints
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A utility for plotting `SEG-Y files <http://www.agilegeoscience.com/blog/2014/3/


Installation
-------
------------

If you don't already have a reliable Python installation, and know how to wield it, I recommend downloading and installing Anaconda.

Expand All @@ -38,7 +38,7 @@ If you prefer to use ``obspy`` instead of ``segyio`` for SEG-Y reading, you can


Quick start
-------
-----------

You can see what the thing does with::

Expand Down Expand Up @@ -74,10 +74,10 @@ Example


Recently added features
-------
-----------------------

- Uses ``segyio`` by default; ``obspy`` is still an option.
- The ability to plot from 3D seismic, inlcuding a dual inline/crossline plot, and a timeslice.
- The ability to plot from 3D seismic, including a dual inline/crossline plot, and a timeslice.
- An intersection line on dual inline/crossline displays for 3Ds.
- You can specify min and max time for the plot(s).
- Optional gridlines on the seismic plot.
Expand Down
2 changes: 0 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
# config.yml
# Configuration file for seisplot.py

# Dimensions. Overriden by command line option -d.
Expand Down
3 changes: 1 addition & 2 deletions notice.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Notices during runtime.
:copyright: 2015 Agile Geoscience
:copyright: 2015-22 Agile Scientific
:license: Apache 2.0
"""

Expand Down
2 changes: 1 addition & 1 deletion patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Patterns for finding info in seismic headers heuristically.
:copyright: 2016 Agile Geoscience
:copyright: 2016-22 Agile Scientific
:license: Apache 2.0
"""
import numpy as np
Expand Down
10 changes: 5 additions & 5 deletions plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"""
Simple seismic plotting functions.
:copyright: 2016 Agile Geoscience
:copyright: 2016-22 Agile Scientific
:license: Apache 2.0
"""
import numpy as np
import matplotlib.font_manager as fm
from matplotlib import cm
from matplotlib.colors import makeMappingArray
import utils


Expand Down Expand Up @@ -83,7 +82,7 @@ def plot_header(head_ax, s, fs, cfg, version=''):
head_ax.set_yticks([])
if cfg['credit']:
head_ax.text(40, 42,
'plot by github.com/agile-geoscience/seisplot v{}'.format(version),
'plot by github.com/agilescientific/seisplot v{}'.format(version),
size=fs, color='lightgray',
ha='right', va='top'
)
Expand Down Expand Up @@ -125,7 +124,8 @@ def plot_histogram(ax, data, tickfmt, cfg):
alpha=0.6, color=color, lw=0)

ax.set_xlim(-clip_val, clip_val)
ax.set_xticklabels(ax.get_xticks(), fontsize=fs-4)
ax.tick_params(axis='x', labelsize=fs-4)

ax.set_xlabel('amplitude', fontsize=fs - 4)
ax.xaxis.set_label_coords(0.5, -0.12)
ax.set_ylim([0, y.max()])
Expand Down Expand Up @@ -181,7 +181,7 @@ def plot_colourbar(clr_ax, cmap, data=None, mima=False, plusminus=False, zorder=
"""
seisbar = cm.get_cmap(cmap)
ncolours = 32
seis_array = makeMappingArray(ncolours, seisbar)
seis_array = seisbar(np.linspace(0, 1, ncolours))
color_arr = seis_array[np.newaxis, :]
color_arr = color_arr[:, :, :-1]
colour_roll = np.rollaxis(color_arr, 1)
Expand Down
7 changes: 3 additions & 4 deletions seismic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Seismic object for seisplot and beyond.
:copyright: 2016 Agile Geoscience
:copyright: 2016-22 Agile Scientific
:license: Apache 2.0
"""
from functools import partial
Expand Down Expand Up @@ -318,7 +318,7 @@ def plot_spectrum(self,
w is window length for smoothing filter
"""
if tickfmt is None:
# Set the tickformat.
# Set the tickformat.
tickfmt = mtick.FormatStrFormatter('%.0f')

if ax is None:
Expand Down Expand Up @@ -370,8 +370,7 @@ def plot_spectrum(self,
ax.set_xlabel('frequency [Hz]', fontsize=fontsize - 4)
ax.xaxis.set_label_coords(0.5, -0.12)
ax.set_xlim([0, np.amax(f)])
ax.set_xticklabels(ax.get_xticks(), fontsize=fontsize - 4)
ax.set_yticklabels(ax.get_yticks(), fontsize=fontsize - 4)
ax.tick_params(axis='both', labelsize=fontsize - 4)
ax.set_ylabel('power [dB]', fontsize=fontsize - 4)
ax.text(.98, .95, 'AMPLITUDE SPECTRUM',
horizontalalignment='right',
Expand Down
10 changes: 5 additions & 5 deletions seisplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Seismic plotter.
:copyright: 2016 Agile Geoscience
:copyright: 2016-22 Agile Scientific
:license: Apache 2.0
"""
import argparse
Expand Down Expand Up @@ -203,7 +203,7 @@ def main(target, cfg):
pady = 0.75 / h # 0.75 inch
padx = 0.75 / w # 0.75 inch
cstrip = 0.3/h # color_strip height = 0.3 in
charth = 1.5/h # height of charts = 1.5 in
charth = 1.25/h # height of charts = 1.25 in
chartw = wsl/w - mr/w - padx # or ml/w for left-hand sidelabel; same thing
chartx = (ssl + padx)
histy = 1.5 * mb/h + charth + pady
Expand Down Expand Up @@ -278,8 +278,8 @@ def main(target, cfg):
ax.set_xlabel(utils.LABELS[line.xlabel],
fontsize=cfg['fontsize'],
ha='center')
ax.set_xticklabels(ax.get_xticks(), fontsize=cfg['fontsize'] - 2)
ax.set_yticklabels(ax.get_yticks(), fontsize=cfg['fontsize'] - 2)
ax.tick_params(axis='both', labelsize=cfg['fontsize'] - 2)

ax.xaxis.set_major_formatter(tickfmt)
ax.yaxis.set_major_formatter(tickfmt)
if ('tslice' not in direction):
Expand All @@ -293,7 +293,7 @@ def main(target, cfg):
alpha=0.5
)
except IndexError:
print("Problem with slineidx")
pass # Nevermind.

# Grid, optional.
if cfg['grid_time'] or cfg['grid_traces']:
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Utility functions for seisplot.
:copyright: 2016 Agile Geoscience
:copyright: 2016-22 Agile Scientific
:license: Apache 2.0
"""
import os
Expand Down

0 comments on commit 5d48995

Please sign in to comment.