pyglimer.plot#
pyglimer.plot.plot_map#
- copyright:
The PyGLImER development team (makus@gfz-potsdam.de).
- license:
GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)
- author:
Peter Makus (makus@gfz-potsdam.de)
Created: Tuesday, 4th August 2020 11:02:52 am Last Modified: Thursday, 19th August 2021 03:08:57 pm
- pyglimer.plot.plot_map.plot_map(cl=0.0, lat=None, lon=None, profile=None, p_direct=True, geology=False, states=False)[source]#
plot a map
- pyglimer.plot.plot_map.plot_map_ccp(lat: tuple, lon: tuple, stations: bool, slat: list, slon: list, bins: bool, bincoords: tuple, dbin, illum: bool, illummatrix: ndarray, profile: list, p_direct=True, outputfile=None, format='pdf', dpi=300, geology=False, title=None)[source]#
Create a map plot of the CCP Stack containing user-defined information.
- Parameters:
lat (tuple, optional) – boundaries for the map view
lon (tuple, optional) – boundaries for the map view
stations (bool, optional) – Plot the station locations, by default False
illum (bool, optional) – Plot bin location with colour depending on the depth-cumulative illumination at bin b, by default False
profile (list or tupleor None, optional) – Plot locations of cross sections into the plot. Information about each cross section is given as a tuple (lon1, lon2, lat1, lat2), several cross sections are given as a list of tuples in said format, by default None.
p_direct (bool, optional) – If true the list in profile decribes areas with coordinates of the lower left and upper right corner, by default True
outputfile (str or None, optional) – Save plot to file, by default None
format (str, optional) – Format for the file to be saved as, by default ‘pdf’
dpi (int, optional) – DPI for none vector format plots, by default 300
geology (bool, optional) – Plot a geological map. Requires internet connection
title (str, optional) – Set title for plot.
- pyglimer.plot.plot_map.plot_vel_grad(coords, a, z, plot_amplitude: bool, lat: tuple, lon: tuple, outputfile=None, format='pdf', dpi=300, cmap: str = 'gist_rainbow', geology=False, title=None)[source]#
Plot velocity gradient. Use method implemented into object!
- Parameters:
coords (np.ndarray) – lats and lons
a (np.ndarray) – picked amplitudes
z (np.ndarray) – picked depths
plot_amplitude (bool) – Plot Amplitude or depth?
lat (tuple or None) – Latitude boarder for map
lon (tuple o rNone) – Longitude boarder for map
outputfile (str, optional) – write plot to file, by default None
format (str, optional) – file format, by default ‘pdf’
dpi (int, optional) – resolution for none-vector plots, by default 300
pyglimer.plot.plot_utils#
Plot utilities not to modify plots or base plots.
- copyright:
The PyGLImER development team (makus@gfz-potsdam.de).
- license:
GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)
- author:
Lucas Sawade (lsawade@princeton.edu) Peter Makus (makus@gfz-potsdam.de)
Created: Wednesday, 20th October 2021 05:05:08 pm Last Modified: Wednesday, 19th October 2022 11:29:22 am
- pyglimer.plot.plot_utils.baz_hist(az, nbins, bold=False)[source]#
Takes in backazimuth distribution and number of bins to compute the distribution of incoming angles.
- Parameters:
az (numpy.ndarray) – azimuthal distribution in 1D array
nbins (int) – Number of bins
Returns –
-------å –
None –
- pyglimer.plot.plot_utils.plot_catalog(catalog)[source]#
Takes in event catalog and plots events as a function of location and moment magnitude.
- pyglimer.plot.plot_utils.plot_section(rfst, channel='PRF', timelimits: Optional[list] = None, epilimits: Optional[list] = None, scalingfactor: float = 2.0, ax: Optional[Axes] = None, line: bool = True, linewidth: float = 0.25, outputfile: Optional[str] = None, title: Optional[str] = None, show: bool = True, format: Optional[str] = None, color: str = 'seismic', bold: bool = False)[source]#
Creates plot of a receiver function section as a function of epicentral distance.
- Parameters:
rfst (
pyglimer.RFStream
) – Stream of receiver functionstimelimits (list or tuple or None) – y axis time limits in seconds (len(list)==2). If None full traces is plotted. Default None.
epilimits (list or tuple or None = None,) – y axis time limits in seconds (len(list)==2). If None from 30 to 90 degrees plotted. Default None.
scalingfactor (float) – sets the scale for the traces. Could be automated in future functions(Something like mean distance between traces) Defaults to 2.0
line (bool) – plots black line of the actual RF Defaults to True
linewidth (float) – sets linewidth of individual traces
ax (matplotlib.pyplot.Axes) – Can define an axes to plot the RF into. Defaults to None. If None, new figure is created.
outputdir (str, optional) – If set, saves a pdf of the plot to the directory. If None, plot will be shown instantly. Defaults to None.
clean (bool) – If True, clears out all axes and plots RF only. Defaults to False.
color (str, optional) –
- Color-scale to use. Options are ‘seismic’, ‘pyglimer’, or ‘mono’.
Defaults to ‘seismic’.
Returns
------- –
ax –
- pyglimer.plot.plot_utils.plot_single_rf(rf, tlim: Optional[list] = None, ylim: Optional[list] = None, depth: Optional[ndarray] = None, ax: Optional[Axes] = None, outputdir: Optional[str] = None, pre_fix: Optional[str] = None, post_fix: Optional[str] = None, format: str = 'pdf', clean: bool = False, std: Optional[ndarray] = None, flipxy: bool = False, color: str = 'seismic', show: bool = True, bold: bool = False)[source]#
Creates plot of a single receiver function
- Parameters:
rf (
pyglimer.RFTrace
) – single receiver function tracetlim (list or tuple or None) – x axis time limits in seconds if type==’time’ or depth in km if type==depth (len(list)==2). If None full trace is plotted. Default None.
ylim (list or tuple or None) – y axis amplitude limits in. If None ± 1.05 absmax. Default None.
depth (
numpy.ndarray
) – 1D array of depthsax (matplotlib.pyplot.Axes) – Can define an axes to plot the RF into. Defaults to None. If None, new figure is created.
outputdir (str, optional) – If set, saves a pdf of the plot to the directory. If None, plot will be shown instantly. Defaults to None.
pre_fix (str, optional) – prepend filename
post_fix (str, optional) – append to filename
clean (bool, optional) – If True, clears out all axes and plots RF only. Defaults to False.
std (np.ndarray, optional) – Only if self.type == stastack. Plots the upper and lower limit of the standard deviation in the plot. Provide the std as a numpy array (can be easily computed from the output of
bootstrap()
)flipxy (bool, optional) – Plot Depth/Time on the Y-Axis and amplitude on the x-axis. Defaults to False.
color (str, optional) – Color-scale to use. Options are ‘seismic’, ‘pyglimer’, or ‘mono’. Defaults to ‘seismic’.
show (bool, optional) –
Execute plt.show()? Defaults to True
Returns
------- –
ax –
- pyglimer.plot.plot_utils.rayp_hist(rayp, nbins, v=5.8, bold=False)[source]#
Takes in rayparameter distribution and number of bins to compute the distribution of incoming angles.
- Parameters:
rayp (numpy.ndarray) – 1D ndarray of rayparameters
nbins (int) – Number of bins
v (float) – assummed surface velocity for the computation of the incidence angle. Default 5.8 km/s.
phase (string) – indicates which incidence wave is meant ‘S’ or ‘P’. Default is ‘P’ simple defines boundaries of the plot nothing more nothing less.
- Return type:
None
Notes
Get Incidence angle p = sin i/v <–> v sin i / p <–> i = asin(vp) Default value 5.8 km/s taken from PREM.
- pyglimer.plot.plot_utils.remove_all(ax=None, top=False, bottom=False, left=False, right=False, xticks='none', yticks='none')[source]#
Removes all frames and ticks.
- pyglimer.plot.plot_utils.remove_topright(ax=None)[source]#
Removes top and right border and ticks from input axes.
- pyglimer.plot.plot_utils.stream_dist(rayp: list, baz: list, nbins: float = 50, v: float = 5.8, phase: str = 'P', outputfile: Optional[str] = None, format: str = 'pdf', dpi: int = 300, title: Optional[str] = None, bold: bool = False)[source]#
Uses backazimuth and rayparameter histogram plotting tools to create combined overview over the Distribution of incident waves.
- Parameters:
rayp (numpy.ndarray) – 1D ndarray of rayparameters
az (numpy.ndarray) – azimuthal distribution in 1D array
nbins (int) – Number of bins
v (float) – assummed surface velocity for the computation of the incidence angle. Default 5.8 km/s.
phase (string) – indicates which incidence wave is meant ‘S’ or ‘P’. Default is ‘P’ simple defines boundaries of the rayparemeter plot nothing more nothing less.
outputfile (str or None) – Path to savefile. If None plot is not saved just shown. Defaults to None.
format (str) – outputfile format
dpi (int) – only used if file format is none vector.
bold (bool, optional) – Print titles and labels larger
pyglimer.plot.plot_volume#
- copyright:
The PyGLImER development team (makus@gfz-potsdam.de).
- license:
GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)
- author:
Lucas Sawade (lsawade@princeton.edu)
Last Update: June 19, 2020
pyglimer.plot.ui_utils#
- copyright:
The PyGLImER development team (makus@gfz-potsdam.de).
- license:
GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)
- author:
Lucas Sawade (lsawade@princeton.edu)
Last Update: June 19, 2020