Graphical FrontEnd#

Main GUI.

class datadigitizer.gui.AboutWindow(master)[source]#

About window.

Parameters:
master: tkinter widget

Container.

class datadigitizer.gui.App(master=None)[source]#

The cursor is used to point a specific position in the graph whereas all operations are done through keyboard combinations or through the main menu.

Legend:

  • Red crosses are data points

  • Blue crosses are Xmin and Xmax

  • Green crosses are Ymin and Ymax

Commands:

  • <Ctrl-o> for loading image.

  • <Ctrl-a> add data point.

  • <Hold a+Left Click> add data point.

  • <Left Click> select a data point.

  • <Hold Ctrl+Left Click> multiple data point selection.

  • <Ctrl-g> set Xmin from last data point or from selected data point.

  • <Ctrl-h> set Xmax from last data point or from selected data point.

  • <Ctrl-j> set Ymin from last data point or from selected data point.

  • <Ctrl-k> set Ymax from last data point or from selected data point

  • <Ctrl-l> set all limits from last 4 data points or from last 4 selected data points.

  • <Ctrl-n> remove all limits.

  • <Ctrl-z> remove last data point.

  • <Ctrl-d> remove selected data point.

  • <Ctrl-D> remove all data points.

  • <Ctrl-m> compute the data points.

  • <Ctrl-t> view data table.

  • <Ctrl-s> save data points.

  • <Ctrl-w> clear all.

Parameters:
master: tkinter.Tk instance

Root instanciation of tkinter.

Methods

run()

Start the application.

stop()

Stop the main tk loop.

run()[source]#

Start the application.

stop()[source]#

Stop the main tk loop.

class datadigitizer.gui.DataTable(master, **kwargs)[source]#

Scrolled data table widget.

Parameters:
master: tkinter widget

Master container.

kwargs: dict, optional

Keyword arguments for the scrolled frame.

Methods

set_new_data(data)

Set new data in the displayed data table.

set_new_data(data)[source]#

Set new data in the displayed data table.

Parameters:
datastructured array, shape=(n,)

Numpy structured array used for registering the extracted data.

class datadigitizer.gui.DataWindow(master)[source]#

How to use window.

Parameters:
master: tkinter widget

Container.

class datadigitizer.gui.FigureFrame(master, **kwargs)[source]#

Tk frame encapsulating a matplotlib figure and a toolbar.

Parameters:
kwargs: dict, optional

Keyword arguments for the tk frame.

Methods

refresh()

Refresh the plot.

refresh()[source]#

Refresh the plot.

class datadigitizer.gui.HowToUse(master)[source]#

How to use window.

Parameters:
master: tkinter widget

Container.

class datadigitizer.gui.ScrolledFrame(master, **kwargs)[source]#

Scrolled Frame widget which may contain other widgets and can have a 3D border.

Parameters:
master: tkinter widget

Master container.

kwargs: dict, optional

Keyword arguments for the scrolled frame.

Attributes:
canvas

Return the canvas that contains the scrollbars.

frame

Return the frame that contains the widgets.

property canvas#

Return the canvas that contains the scrollbars.

property frame#

Return the frame that contains the widgets.

class datadigitizer.gui.Transform(values_min: float, values_max: float, pix_min: int | float, pix_max: int | float, which: str = 'linear')[source]#

Transform class converting values coordinates into pixel coordinates.

Parameters:
values_min: int, float

Minimum value.

values_max: int, float

Maximum value.

pix_min: int, float

Minimum pixel.

pix_max: int, float

Maximum pixel.

which: str, optional

Which kind of transform i.e. linear or log.

Attributes:
backward_scale

Return the scale for transforming pixels into values.

forward_scale

Return the scale for transforming values into pixels.

Methods

backward(x)

Transform pixels to values.

forward(x)

Transform values to pixels.

backward(x: int | float | ndarray)[source]#

Transform pixels to values.

Parameters:
x: int or floats or array-like, shape(n,)

Pixels to be transformed.

Returns:
values: int or floats or array-like, shape(n,)

Values corresponding to the pixels.

Notes

x = (x_{pix}-x_{pix, min})\frac{x_{max} - x_{min}}{x_{pix,max}-x_{pix, min}} + x_{min}

property backward_scale#

Return the scale for transforming pixels into values.

\frac{x_{max} - x_{min}}{x_{pix,max}-x_{pix, min}}

forward(x: int | float | ndarray)[source]#

Transform values to pixels.

Parameters:
x: int or floats or array-like, shape(n,)

Values to be transformed.

Returns:
pixels: int or floats or array-like, shape(n,)

Values corresponding to the pixels.

Notes

x_{pix} = (x-x_{min})\frac{x_{pix, max} - x_{pix, min}}{x_{max}-x_{min}} + x_{pix,min}

property forward_scale#

Return the scale for transforming values into pixels.

\frac{x_{pix, max} - x_{pix, min}}{x_{max}-x_{min}}

Icon#

Create icon for the app.

Settings#

Settings module.

datadigitizer.settings.save_cfg()[source]#

Save the configuration file.

Tests#

Tests module.

class datadigitizer.tests.TestPlotData(methodName='runTest')[source]#

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Methods

test_linear()

Test linear plot.

test_loglog()

Test log-log plot.

test_xlog()

Test x semi-log plot.

test_ylog()

Test y semi-log plot.

test_linear()[source]#

Test linear plot.

test_loglog()[source]#

Test log-log plot.

test_xlog()[source]#

Test x semi-log plot.

test_ylog()[source]#

Test y semi-log plot.

datadigitizer.tests.test_linear() Path[source]#

Generate the linear plot and data.

Returns:
fpath: Path object

Path to the linear plot.

datadigitizer.tests.test_loglog() Path[source]#

Generate the log-log plot and data.

Returns:
fpath: Path object

Path to the log-log plot.

datadigitizer.tests.test_xlog() Path[source]#

Generate the semi-log plot and data.

Returns:
fpath: Path object

Path to the semi-log plot.

datadigitizer.tests.test_ylog() Path[source]#

Generate the semi-log plot and data.

Returns:
fpath: Path object

Path to the semi-log plot.