comet.pyhed.plot package

Submodules

comet.pyhed.plot.plotHankel module

Part of comet/pyhed/plot

comet.pyhed.plot.plotHankel.plotHankel(order)[source]
comet.pyhed.plot.plotHankel.plotKey(order)[source]

comet.pyhed.plot.plot_bib module

Part of comet/pyhed/plot

comet.pyhed.plot.plot_bib.addPatch(ax, cbar_ax=None, offset_left=28.5, offset_top=1, distance=1, color='lightgray', lw=0, z_order=0)[source]
comet.pyhed.plot.plot_bib.amp(field)[source]

Amplitude of a complex field. Internally used.

comet.pyhed.plot.plot_bib.cmap_phase()[source]
comet.pyhed.plot.plot_bib.drawCWeight(ax, mesh, cweight, lmin=0, lmax=0.8, cmin=0.2, cmax=1, min_plot=0.02, color='black', cell_indices=None)[source]

Draws the given cweights defined for given mesh on given ax.

Parameters:
  • ax (plt.ax) – Ax to plot constraint weights in.
  • mesh (pg.Mesh) – Mesh object where the constraints are defined in.
  • cweight (np.ndarray) – Constraint values to be plotted.
  • lmin (float [ 0 ]) – Minimum linewidth for maximum cweight defined via cmax. Note that by default high constraint values are plotted with thinner lines.
  • lmin (float [ 0.8 ]) – Maximum linewidth for minimum cweight defined via cmin.
  • cmin (float [ 0 ]) – Minimum constraint weight to plot. All values smaller than cmin are plotted with the same linewidth as cmin.
  • cmax (float [ 1 ]) – Maximum constraint weight to plot. All values greater than cmax are plotted with the same linewidth as cmax.
  • min_plot (float [ 0.02 ]) – Minimum linewidth to plot to avoid large pdfs.
  • color (string [ ‘black’ ]) – Color of lines.
  • cell_indices [ None ]
  • f(cweight) -> linewidth – (cmin, cmax) -> (lmax, lmin) if cmin < cweight < cmax
  • Returns
  • ——–
  • None
comet.pyhed.plot.plot_bib.drawFid(ax, fid, clim=None, clab=None, draw='data', to_plot='real', cmap=None, cbar=True, gated=True, title=None)[source]

Plot any data (or response, error, misfit) cube nicely.

if response is True:
response vector from fid taken and used for plotting misfit.
comet.pyhed.plot.plot_bib.drawMeshLines(ax, mesh, color='white', linewidth=0.5, marker=None, **kwargs)[source]

Draw all mesh boundaries in given ax.

comet.pyhed.plot.plot_bib.getCMapAndLim(toplot, phase=False, misfit=False, perc=0.99, minimum=False, lut=None)[source]

Chooses colorbar limits and appropriate colobar based on input. lut: If lut is not None it must be an integer giving the number of entries desired in the lookup table, and name must be a standard mpl colormap name.

comet.pyhed.plot.plot_bib.loadPickledFig(savename)[source]
comet.pyhed.plot.plot_bib.markCbar(cbar, pos, text=None, color='white', linewidth=0.5, size=None, text_y_pos=1.35, cbar_horizontal=True, **kwargs)[source]

Marks a given colorbar of a plot at a specific position and optionally displaysa describing text. Useful to remind on a synthetic background or focus the view on a specific range.

Parameters:
  • cbar (matplotlib colorbar) – Colorbar to mark.
  • pos (float) – Marker position in values of the colorbar (data values).
  • text (string, optional) – Text to display. The default is None.
  • color (string, optional) – Color used for the marker. The string is redirected to matplotlib. The default is ‘white’.
  • linewidth (float, optional) – Thickness of the marker line. The default is 0.5.
  • size (integer, optional) – Size of the Text. If None the size of the ticklabel of the cbar axis is used. If no label is found the size is set to 9. The default is None.
  • text_y_pos (flat, optional) – Vertical Offset for the displayed text. (or horizontal offset for vertical colorbars, see next argument). The default is 1.35.
  • cbar_horizontal (boolean, optional) – Flag for a horizontal colorbar. The default is True.
  • **kwargs (dictionary) – Redirected to the text function. Filled with default values for ‘horizontalalignment’ (‘center’) and ‘verticalalignment’ (‘center’).
Returns:

Return type:

None.

comet.pyhed.plot.plot_bib.pickleFig(savename, fig)[source]
comet.pyhed.plot.plot_bib.printv(string, *args)[source]

print function for maintenance and debugging

comet.pyhed.plot.plot_bib.quantile(data, perc=0.99, add_rel=0.1, add_abs=0.0)[source]

Returns the the data point that lies over a given percentage (50 %) of a data set and returns value (+ 10%).

Parameters:
  • data – Dataset for which the value is to be searched.
  • perc (float [ 0.5 ]) – Percentage [0…1] defining he search for a parameter. Searches for the value in the dataset that lies above perc of the other data.
  • add_rel (float [ 0.1 ]) – Relative value added to the result of the search.
  • add_abs (float [ 0.0 ]) – Absolute value added to the result of the search.
  • For very small values in data, add_rel should be replaced by add_abs (and
  • an appropriate value) or set 0.
  • For add_rel = 0.0 and add_abs = 0.0, the returned value will always be part
  • of the given dataset.
  • Hint for colorbars (usually a median(data, perc=…) with perc = 0.95 for)
  • small data sets and perc = 0.99 for large data sets will result in nice
  • colorbar settings as it effectively removes spikes.
comet.pyhed.plot.plot_bib.returnFigureAndAx(ax, *args, **kwargs)[source]

Returns figure and ax of given ax or creates subplots. Not used inside pyhed.

comet.pyhed.plot.plot_bib.setAxSize(ax, size)[source]
comet.pyhed.plot.plot_bib.setOuterLabelOnly(ax, xlabel='X (m)', ylabel='Z (m)')[source]

Removes all ticks from the given axes and labels exept the outer left and lower axes which are labeled using the the given labels. This is a convenience function for multi ax plots, where the subplots have the same outer dimension.

comet.pyhed.plot.plot_bib.showEtraData(survey, to_plot='real', draw='data', savename='auto', rdir='.', praefix='', size=12, patch=True, clim=None, perc=0.995, cmap='auto', pdf=True, png=False)[source]

Plot function to create and save data and misfit plots of etra data.

Parameters:
  • datas (array_like) – Array containing the measured data in nV. Expect one dimensional array of concatenated datas. First dimension defines the different recievers. If array is real, expect first half to contain the real component and second half to contain the imaginary data.
  • gates (array_like) – Midpoints of the used time gates for plotting in s.
  • pulses (array_like) – Used pulse moments for plotting in As.
  • errors (array_like [ None ]) – Assumed errors of the datas for plotting of misfit. Same shape as data.
  • draw (string [ ‘data’ ]) – This function can plot ‘data’, ‘response’ or ‘misfit’. The last two only if fid are eqipped with proper response vector. See setResponse() of Survey class or setResponse() of Fid class for information about setting response vectors.
  • to_plot (string [ ‘real’ ]) – Decides weather real or imaginary part of the data is plotted. Alternatively ‘abs’ can be used to plot absolute values.
  • savename (string [ ‘auto’ ]) – If on auto, the savename is generated out of the other given parameters. If other than ‘auto’, the given savename is used to save the resulting figures. If on ‘auto’, see rdir and praefix for additional information.
  • rdir (string [‘.’]) – If *savename*==’auto’, rdir defines the directory the results are saved in. This is ignored if savename is not ‘auto’.
  • praefix (string [ ‘’ ]) – If savename*==’auto’, praefix can be used to distinguish different data sets in the same *rdir. This is ignored if savename is not ‘auto’.
  • size (integer [ 17 ]) – Fontsize for the exported figure ticks and labels.
  • patch (boolean [ True ]) – As the coincident measurement and the other seven get different colorbars (see clim), a grey patch is optionally used as background for the first data plot. This switch can be used to omit this patch.
  • clim (list or list of lists [ None ]) – The colorbar limits of the plots can be fixed. Except a list of min and maximum value for misfit and two of those lists for the data plot, whereas the first min and max is used fot the coincident measurement, and the second for the other seven measurements.
  • perc (float [ 0.999 ]) – Percentage to autodefine the colorbar values. The defaults sets the maximum value to the value that is greater than 99.9 % of the data.
comet.pyhed.plot.plot_bib.showLoop(pos, phi, ds, referenzpunkte=None, ax=None, color=None, **kwargs)[source]

Plots a loop as set of dipoles on a given axis. Used by show method of loop class.

comet.pyhed.plot.plot_bib.showLoopLayout(*loops, ax=None, **kwargs)[source]

Shows multiple loops at once on a given axis.

Module contents

Module comet/pyhed/plot