PyDV API Specification¶
pydvpy module¶
curve module¶
- class pydv.curve.Curve(x=array([], dtype=float64), y=array([], dtype=float64), name='', filename='', xlabel='', ylabel='', title='', record_id='', step=False, step_original_x=array([], dtype=float64), step_original_y=array([], dtype=float64), xticks_labels=None, plotname='', color='', edited=False, scatter=False, linespoints=False, linewidth=None, linestyle='-', drawstyle='default', dashes=None, hidden=False, ebar=None, erange=None, marker='.', markerstyle=None, markersize=3, markerfacecolor=None, markeredgecolor=None, plotprecedence=0, legend_show=True, math_interp_left=None, math_interp_right=None, math_interp_period=None)¶
Bases:
object- copy()¶
Return a new copy of the curve object
- normalize()¶
Return a new normalized copy of the curve object
- pydv.curve.append(a, b)¶
Merge curve a and curve b over the union of their domains. Where domains overlap, take the average of the curve’s y-values.
- Parameters:
a (curve) – Curve A
b (curve) – Curve B
- Returns:
a new curve resulting from the merging of curve a and curve b
- pydv.curve.getinterp(a, b, a_left=None, a_right=None, a_period=None, b_left=None, b_right=None, b_period=None, samples=100, match='domain')¶
Gets the interpolated and domain matched versions of the two curves.
- Parameters:
a (curve) – Curve A
b (curve) – Curve B
a_left (float, optional) – numpy.interp() left parameter for internal curve math methods for Curve A
a_right – numpy.interp() right parameter for internal curve math methods for Curve A
a_period – numpy.interp() period parameter for internal curve math methods for Curve A
b_left (float, optional) – numpy.interp() left parameter for internal curve math methods for Curve B
b_right – numpy.interp() right parameter for internal curve math methods for Curve B
b_period – numpy.interp() period parameter for internal curve math methods for Curve B
{'domain','step'},optional (match) – A string indicating how to interpolate the two curves
- Type:
a_right: float, optional
- Type:
a_period: float, optional
- Type:
b_right: float, optional
- Type:
b_period: float, optional
- Returns:
curve pair – the interpolated and domain matched versions of a and b
- pydv.curve.interp1d(a, num=100, retstep=False)¶
Gets the interpolated values of the curve with the specified number of samples.
- Parameters:
a (curve) – Curve A
num – Number of samples to generate. Default is 100. Must be non-negative.
retstep – return the spacing between samples
- Type:
num: int, optional
- Type:
retstep: bool, optional
- Returns:
ia: curve – the interpolated and dimensions matched version of a step: float, optional – only returned if retstep is True. Size of the spacing between samples
pdv module¶
pdvplot module¶
- class pydv.pdvplot.Plotter(pydvcmd)¶
Bases:
QMainWindow- canvas = None¶
- closeEvent(self, a0: QCloseEvent | None)¶
- defaultPlotLayout = None¶
- fig = None¶
- figcolor = 'white'¶
- plotChanged = False¶
- showCurvelistDialog()¶
Shows a dialog with the output of the list command in a table.
- showMenuDialog()¶
Shows a dialog with the output of the menu command in a table.
- style = 'ggplot'¶
- updateDialogs()¶
Updates the list and menu dialogs if visible.
- updatePlotGeometry(geometry='de')¶
Updates the size and location of the window. Using an action to trigger the update to ensure that the resizing is happening on the main GUI thread.
pdvutil module¶
- exception pydv.pdvutil.CurveIndexError¶
Bases:
ValueError
- pydv.pdvutil.getCurveIndex(plotname, plotlist)¶
Returns integer index to curve in plotlist from plotname
- pydv.pdvutil.get_actual_index(origref, val)¶
- pydv.pdvutil.getletterargs(line)¶
Get a full list of arguments from compact list or mixed notation (ex a:d)
- pydv.pdvutil.getnumberargs(line, filelist)¶
Get a full list of arguments from compact list or mixed notation (ex 4:11)
- pydv.pdvutil.parsemath(line, plotlist, commander, xdomain)¶
Parses and calculates mathematical input for curves, then updates plot
- pydv.pdvutil.print_own_docstring(self)¶
Prints the docstring of the calling method.
- pydv.pdvutil.truncate(string, size, justify='left')¶
Truncate a string to given length