diff --git a/README.md b/README.md index 29f0931..cbaf3bc 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,8 @@ install as a special kernel when you are the user. found [here](https://janakiev.com/til/jupyter-virtual-envs/). ## Change Log +* 0.8.1 (May 15, 2023) + * BUG_FIX: Needed to reset cycles_on and cycles_off when speed updated. * 0.8.0 (May 12, 2023) * Added capability to do very slow compressions (< 1 cm/min) by moving the barriers intermittently at near their lowest continuous speed. diff --git a/docs/Trough.html b/docs/Trough.html index 8bb2974..f6703f3 100644 --- a/docs/Trough.html +++ b/docs/Trough.html @@ -83,7 +83,7 @@
This software is a custom controller and GUI for the research Langmuir trough \nin the Gutow Lab at UW Oshkosh. It is written in Python and expects to run in a\nJupyter notebook environment. However, all of the parts that are not elements\nof the user interface should work in a vanilla Python environment.
\n\nHardware requirements:\nRaspberry Pi compatible system with a Pi-Plates \nDAQC2 data acquisition plate \nand a trough controlled by the DAQC2 plate. This software could be used with \na trough controlled some other way by rewriting the routines in trough_util.\npy
. The GUI front end would need no rewriting to use with a different \ntrough if a custom backend controlling the barriers, reading the temperature \nand Whilhelmy balance is written. The backend needs to continually monitor \nthe trough and respond to the following commands: Stop, Send, Start, \nDirection, Speed, MoveTo, MotorCal, ConstPi, DataLabels, ShutDown
.
If you do not have compatible hardware the GUI will run with a simulated \ntrough, allowing you to see how it works.
\n\nOnce installed:
\n\npipenv shell
.jupyter notebook
(jupyter lab
also works and is now \nmore stable).from \nTrough import Trough_GUI
. This will take a while to run the first time \nit is run each day because it needs to check the movement of the barriers.Trough_GUI.Controls(Trough_GUI.calibrations)
Trough_GUI.Collect_data.Run(\"name_for_run\")
, \nwhere you replace name_for_run with the text for the name of the run (no \nspaces).By default in Ubuntu 20.04 for Pis the gpio and spi groups do not exist.\nThe i2c group does (not always).
\n\nrpi.gpio-common \npython3-pigpio python3-gpiozero python3-rpi.gpio
./etc/udev/rules.d/50-spidev.rules
containing SUBSYSTEM==\"spidev\", \nGROUP=\"spi\", MODE=\"0660\"
. The file should have rw permission for root \nand read permission for everyone else.python3 -m pip --version
or pip3 --version
. If you do not, \ninstall using apt \ninstall python3-pip
.To avoid library conflicts the software should be installed into a virtual environment.\nInstructions for doing this using pipenv\nfollow.
\n\nLog into your chosen user account:
\n\npip3 install \n--user pipenv
. You may\nneed to add ~/.local/bin
to your PATH
to make pipenv
\navailable in your command shell. More discussion: \nThe Hitchhiker's Guide to\nPython.$ mkdir Trough
).$ cd Trough
.$ pipenv shell
. To get out of\nthe environment you can issue the $ exit
command on the command line.$ pip install -U langmuir_trough
.$ jupyter notebook
. Jupyter should launch in your \nbrowser.\nfrom Trough import Trough_GUI
.\n When run this cell sets things up and tries to talk to the trough.$ pipenv shell
\nin the directory for virtual environment will do that.$ python -m ipykernel install --user --name=<name-you-want-for-kernel>
.Trough_GUI.newPlot()
, Trough_GUI.newFit()
and \nTrough_GUI.newCalculatedColumn()
.Trough
.spidev
package in requirements. pipenv shell
.pip install -e .
.pip \ninstall -U pdoc
..md
files included in _init_.py
.\npdoc --logo-link\nhttps://gutow.github.io/Langmuir_Trough/ --footer-text \"Langmuir_Trough vX.X.X\" \n--math -html -o docs Trough
where X.X.X
is the version number.doc
folder) with a ^C
to \nterminate it.Proceed only if testing of the build is successful.
\n\npip install -U setuptools wheel twine
setup.py
.python -m setup sdist bdist_wheel
.python -m twine upload dist/*
pip \ninstall -U ...
. Copy the actual link from pypi.org.\n`. If it does not work, pull the release.try ...
so that it can \nexit more gracefully and give up barrier monitoring?Trough
directory of the user \nTrough
.pipenv shell
jupyter lab
.from Trough import Trough_GUI
. If the \ntrough has not been started in the last 12 hours this will take a while \nas it checks the motor calibration for moving the barriers.This need to be done before each experiment.
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)
in an empty cell of the \nnotebook.Trough_GUI.Collect_Data.Run(\"XXX\")
, where XXX is replaced with a \nname for the run (e.g. \"clean_test_MMM_DD_YYYYa\") in an empty cell.It is extremely easy to contaminate the solvents with surface active \ncompounds at a level that will ruin experiments
\n\nFor most molecules we want to spread about 3.00 X 10-8 moles of \nmolecules on our trough to get a range of roughly 60 to 15 square Angstroms per \nmolecule during a compression.
\n\nTrough_GUI.Collect_Data.Run(\"XXX\")
, where XXX is replaced with a \n name for the run (e.g. \"CompoundName_MMM_DD_YYYYa\")This should be done at the beginning of any day real data is collected
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)\n
in an empty notebook cell.This only needs to be done if a check of the measured barrier separation \nis off by more than \u00b10.03 mm
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)\n
in an empty notebook cell.This is very stable so should not need to be done often
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)\n
in an empty notebook cell.The data is collected in Jupyter notebooks so that you can use the \nPandas_GUI \nanalysis tools or write python code \nto analyze the data sets. When a data set is loaded from file or collected \nusing the command Trough_GUI.Collect_Data.Run(\"Run_Name\")
a run is added \nto the list Trough_GUI.runs
. Data from a run is stored in its Pandas \nDataframe Trough_GUI.runs[i].df
, where i
is the zero based index of the run.\nThe Pandas_GUI \ntools which provide menu access to the data can be run using the commands:
Trough_GUI.newPlot()
.Trough_GUI.newCalculatedColumn()
.Trough_GUI.newFit()
.datapkg: list\nlist of lists containing trough data bundle, messages in the last list.
\n\nlist\nlist of strings consisting of the messages.
\n", "signature": "(datapkg):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.simulation", "modulename": "Trough.Trough_Control.simulation", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_Control.simulation.simulated_troughctl", "modulename": "Trough.Trough_Control.simulation", "qualname": "simulated_troughctl", "kind": "function", "doc": "Will run as separate process taking in commands through a pipe and\nreturning data on demand through a second pipe.
\n\nCTLPipe: Pipe\n commands come in on and messages go out on.
\n\nDATAPipe: Pipe\n data is sent out on
\n", "signature": "(CTLPipe, DATAPipe):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util", "modulename": "Trough.Trough_Control.trough_util", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_Control.trough_util.isnumber", "modulename": "Trough.Trough_Control.trough_util", "qualname": "isnumber", "kind": "function", "doc": "\n\n", "signature": "(obj):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.etol_call", "modulename": "Trough.Trough_Control.trough_util", "qualname": "etol_call", "kind": "function", "doc": "True is a number.
\n
Wrapping a callable object in this function will cause it to be called until\nit either returns without an error or the maximum recursion depth is reached.\nThis should only be used on calls that occasionally return errors because they\nare reading sensors or something like that.
\n\nobj: callable
\n\nparam: list\n a list containing the parameters in the function call
\n\nresult: any\n result of function call
\n", "signature": "(obj, param):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.pid_exists", "modulename": "Trough.Trough_Control.trough_util", "qualname": "pid_exists", "kind": "function", "doc": "Check whether pid exists in the current process table.\nUNIX only. From this stackoverflow suggestion:\nhttps://stackoverflow.com/a/6940314
\n", "signature": "(pid):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.is_trough_initialized", "modulename": "Trough.Trough_Control.trough_util", "qualname": "is_trough_initialized", "kind": "function", "doc": "Checks for a running Trough process and good connections to it.
\n\nbool\nTRUE if initialized
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.init_trough", "modulename": "Trough.Trough_Control.trough_util", "qualname": "init_trough", "kind": "function", "doc": "This initializes the trough control subprocess and creates the pipes to communicate\nwith it.
\n\npipe\ncmdsend: the end of the pipe to sent commands to the trough.
\n\npipe\ndatarcv: the end of the pipe the trough uses to send back data and messages.
\n\nProcess\nTROUGH: the process handle for the trough.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.troughctl", "modulename": "Trough.Trough_Control.trough_util", "qualname": "troughctl", "kind": "function", "doc": "Will run as separate process taking in commands through a pipe and\nreturning data on demand through a second pipe.\nIteration 1, collects data into a fifo and watches barrier position.
\n\nUses jupyter-pandas-GUI.new_pandas_column_GUI to provide a GUI expression\ncomposer. This method finds the datasets and launches the GUI.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.newPlot", "modulename": "Trough.Trough_GUI", "qualname": "newPlot", "kind": "function", "doc": "Uses jupyter-pandas-GUI.plot_pandas_GUI to provide a GUI expression\ncomposer. This method finds the datasets and launches the GUI.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.newFit", "modulename": "Trough.Trough_GUI", "qualname": "newFit", "kind": "function", "doc": "Uses jupyter-pandas-GUI.fit_pandas_GUI to provide a GUI expression\ncomposer. This method finds the datasets and launches the GUI.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data", "modulename": "Trough.Trough_GUI.Collect_data", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run", "kind": "class", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.__init__", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.__init__", "kind": "function", "doc": "Create a new run object
\n\nid: int\n 0 based index of run in current notebook\nfilename: str\n String representation of the filename used to store the data,\n with not type extension. This probably should not contain a path.\ntitle: str\n User friendly title (suggested default is same as filename).\nunits: str\n Units for the displayed barrier positions (cm, cm^2 or Ang^2/molec).\ntarget: float\n Numerical value in units for the targeted final trough area.\nspeed: float\n Numerical value in units for the speed to move the barriers.\nmoles: float\n moles of molecules initially spread in the trough.\nplate_circ: float\n circumference of the Whilhelmy plate in mm.\ndataframe: DataFrame or None\ntimestamp: float or None
\n", "signature": "(\tid,\tfilename,\ttitle,\tunits,\ttarget,\tspeed,\tmoles,\tplate_circ,\tdataframe=None,\ttimestamp=None)"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.from_html", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.from_html", "kind": "function", "doc": "Create a run from an html representation
\n\nhtml: str\n The html to be parsed to create the run object
\n\ntrough_run: trough_run\n A trough_run object
\n", "signature": "(self, html):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.run_caption", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.run_caption", "kind": "function", "doc": "Returns an html table with info about the run to use as a caption
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.init_collect_control", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.init_collect_control", "kind": "function", "doc": "This initializes the collection control widgets and VBox that\ncontains them. The VBox may be accessed as self.collect_control
This closes self.collect_control
which also minimizes\nthe objects maintained on the Python side.
Create an html string representing a run
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.write_run", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.write_run", "kind": "function", "doc": "Writes a run file with the base filename run.filename
into the\ndirectory specified. If a file with the current name exists\nattempts to make the name unique by appending self.timestamp\nto the filename. Currently only produces\nan html file that is also human-readable. Other file formats may be\navailable in the future through the use of key word arguments.
dirpath:\n pathlike object or string. Empty string means the current working\n directory.
\n\nkwargs:\n optional key word arguments for future adaptability
\n", "signature": "(self, dirpath, **kwargs):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.Run", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "Run", "kind": "function", "doc": "This routine creates a GUI for initializing, starting, collecting and\ncompleting a run. If the run has been completed it will simply reload it\nfrom the local datafile.
\n\nrun_name: str or Path\nThis should generally be the name for the file the data will be stored in\nwithout a file type extension. Recommend a naming scheme that produces\nUnique filenames, such as Trough_run_<username>_<timestamp>
. The file\nname will be run_name.trh.run.html
.
This is run in a separate thread and will update the figure and\nall status widgets at an interval of 2 seconds or a little longer. While\nthis is running nothing else will be able to talk to the trough.
\n\ntrough_lock: threading.lock\n When acquired this routine will talk to the trough. It is not\n released until the routine exits to avoid any data loss. It does\n call the status_widgets updater as often as it can while collecting\n the data.
\n\ncmdsend: Pipe\n End of Pipe to send commands to the Trough.
\n\ndatarcv: Pipe\n End of Pipe to receive data from the Trough.
\n\ncals: Trough_GUI.calibrations\n Used to convert the data to user units.
\n\nlastdirection: multiprocessing.Value\n Of type 'i' to indicate last direction the barriers moved.
\n\nrun_updater: multiprocessing.Value\n Of type 'c_bool'. True if this updater should keep running.
\n\nupdater_running: multiprocessing.Value\n Of type 'c_bool'. Set to True by this process when it starts\n and set to False before exiting.
\n\nrun: trough_run\n This object contains the live figure and the place to store the data.
\n", "signature": "(\ttrough_lock,\tcmdsend,\tdatarcv,\tcals,\tlastdirection,\trun_updater,\tupdater_running,\trun):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.update_collection", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "update_collection", "kind": "function", "doc": "Updates the graph and the data storage
\n", "signature": "(datapkg, cals, lastdirection, run_updater, updater_running, run):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Monitor_Calibrate", "modulename": "Trough.Trough_GUI.Monitor_Calibrate", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.Monitor_Calibrate.Monitor_Setup_Trough", "modulename": "Trough.Trough_GUI.Monitor_Calibrate", "qualname": "Monitor_Setup_Trough", "kind": "function", "doc": "This produces a user interface in jupyter notebooks using ipywidgets. The\ninterface allows monitoring of the trough barrier positions, balance\nsignal, and temperature signal. The barrier positions can be\nadjusted using this interface. Calibrations of all the signals are\nperformed using this interface.
\n\nCalibrations are stored in the calibration files in the .Trough/calibrations\ndirectory of the current user. The latest file is used. If none exists\none is created using default parameters. Users should calibrate all\nsignals before using the trough.
\n\nNOTE: some objects used here are global and created by importing from\nstatus_widgets.py and command_widgets.py.
\n\ncalibrations: Calibrations\n The object containing the calibrations be used and modified. See\n Trough_GUI.calibration_utils
.
Utilities for:
\n\n.Trough/calibrations
.Defines a calibration of type name
.
name: str\n calibration name.
\n\nunits: str\n string representation of the units the calibration yields.
\n\ntimestamp: float\n Unix floating point timestamp.
\n\nparam:list\n list of the numerical parameters for the fit yielding the\n calibration.
\n\nparam_stdev: list\n list of the numerical values for the estimated standard\n deviation of the parameters from the fit.\nparam_inv: list\n list of the numerical values for the fit (or equation) yielding the\n inverse of the calibration (return to the raw value).\nparam_inv_stdev: list\n list of the numerical values for the estimated standard deviation of\n the parameters for the inversion.\ncal_data_x: list\n x-data used for the calibration fit.
\n\ncal_data_y: list\n y-data used for the calibration fit.
\n\nfit_type: str\n string name for the fit type. Defaults to \"polynomial\"
\n\nfit_eqn_str: str\n string representation of the fit equation. Defaults to\n \"y = C0 + C1x + C2xx + C3xxx + ...\"
\n\nfit_ceof_lbls: list\n list of string labels for the coefficients, which should\n correlate to symbols in the fit_eqn_str. Defaults to [\"C0\", \"C1\",\n ...]. Automatically, truncated to the actual number of\n coefficients determined by the order of the polynomial.
\n\nadditional_data:dict\n a dictionary of key:value pairs where the keys are a short\n descriptive string. They can contain any additional data\n necessary for doing calculations on the data.
\n", "signature": "(\tname,\tunits,\ttimestamp,\tparam,\tparam_stdev,\tparam_inv,\tparam_inv_stdev,\tcal_data_x,\tcal_data_y,\tfit_type='polynomial',\tfit_eqn_str='y = C0 + C1*x + C2*x*x + C3*x*x*x + ...',\tfit_ceof_lbls=['C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7'],\tadditional_data={})"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_from_html", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_from_html", "kind": "function", "doc": "This takes in an html str, parses it and returns a new\ncalibration.
\n\nhtml: str\n The html to be parsed to create the calibration object
\n\ncalibration: calibration\n a calibration object.
\n", "signature": "(cls, html):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_to_html", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_to_html", "kind": "function", "doc": "This routine creates an html str that would be human-readable in a\nbrowser detailing the calibration. This can be written to a file to\nstore the calibration.
\n\ncalib_div: str\n string containing the html detailing the calibration.
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_apply", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_apply", "kind": "function", "doc": "\n", "signature": "(self, data, stdev):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_inv", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_inv", "kind": "function", "doc": "\n", "signature": "(self, data, stdev):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations", "kind": "class", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations.read_cal", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations.read_cal", "kind": "function", "doc": "This routine reads in a calibration file. If it is the standard\nhtml file it uses calibration.cal_from_html()
operation to convert\nit to a calibration.
name: str\n either the basename (current options: 'balance', 'barriers_open',\n 'barriers_close', 'speed_open', 'speed_close' or\n 'temperature') or a string representation of the path to the\n calibration file to be read. If one of the basenames is used\n this code will look for the most recent calibration of that type\n in the directory '~.Trough\\calibrations'.
\n\nCalibration
\n", "signature": "(self, name):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations.write_cal", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations.write_cal", "kind": "function", "doc": "Writes a calibration file with the base filename cal.name + int(\ncal.timestamp)
into the directory specified. Currently only produces\nan html file that is also human-readable. Other file formats may be\navailable in the future through the use of key word arguments.
dirpath:\n pathlike object or string
\n\ncal: Calibration\n a calibration object containing the information about the\n calibration to write to the file.
\n\nkwargs:\n optional key word arguments for future adaptability
\n", "signature": "(self, dirpath, cal, **kwargs):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations.poly_fit", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations.poly_fit", "kind": "function", "doc": "Does a polynomial fit of the specified order using the x and y\nvalues provided.
\n\ndata_x: list\n of numerical x values.
\n\ndata_y: list\n of numerical y values.
\n\norder: int\n the order of the polynomical used for fitting.
\n\nyerr: float or iterable of float\n absolute error(s) in the y-value. Used to weight the fit. If no\n values are provided the assumption is equal weighting.
\n\nparam: list\n of fitted parameters.
\n\nparam_stdev: list\n of estimated standard deviation in the parameters.
\n", "signature": "(self, data_x, data_y, order, yerr=None):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets", "modulename": "Trough.Trough_GUI.command_widgets", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_change_Barr_Units", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_change_Barr_Units", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_change_Barr_Direction", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_change_Barr_Direction", "kind": "function", "doc": "\n", "signature": "(changed):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_Barr_Target_change", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_Barr_Target_change", "kind": "function", "doc": "Updates the speed settings since open and close are different.
\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_click_Start", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_click_Start", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_click_Stop", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_click_Stop", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions", "modulename": "Trough.Trough_GUI.conversions", "kind": "module", "doc": "This file contains unit conversion utility functions for use in the GUI
\n\nvalue, err
part of the call with\n*func(...)
. For example sqcm_to_angpermolec(*cm_to_sqcm(9.2, 0.1, cals),\ncals)
convert barrier separation in cm to trough area in sqcm
\n", "signature": "(value, err, cals):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.sqcm_to_cm", "modulename": "Trough.Trough_GUI.conversions", "qualname": "sqcm_to_cm", "kind": "function", "doc": "convert trough area in sqcm to barrier separation in cm
\n", "signature": "(value, err, cals):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.sqcm_to_angpermolec", "modulename": "Trough.Trough_GUI.conversions", "qualname": "sqcm_to_angpermolec", "kind": "function", "doc": "convert trough area in sqcm to square angstroms per molecules
\n", "signature": "(value, err, moles):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.angpermolec_to_sqcm", "modulename": "Trough.Trough_GUI.conversions", "qualname": "angpermolec_to_sqcm", "kind": "function", "doc": "convert trough area in sqcm to square angstroms per molecules
\n", "signature": "(value, err, moles):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.mg_to_mNperm", "modulename": "Trough.Trough_GUI.conversions", "qualname": "mg_to_mNperm", "kind": "function", "doc": "convert balance measurement in mg to milliNewtons per meter
\n", "signature": "(value, err, pi_tare, plate_circ):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.nNperm_to_mg", "modulename": "Trough.Trough_GUI.conversions", "qualname": "nNperm_to_mg", "kind": "function", "doc": "convert surface pressure in milliNewtons per meter to mg
\n", "signature": "(value, err, pi_tare, plate_circ):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.status_widgets", "modulename": "Trough.Trough_GUI.status_widgets", "kind": "module", "doc": "This file contains widgets that display updating trough information and\ncan be used in multiple ipywidget panels within the same notebook.
\n"}, {"fullname": "Trough.Trough_GUI.status_widgets.set_zero_pressure", "modulename": "Trough.Trough_GUI.status_widgets", "qualname": "set_zero_pressure", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.status_widgets.update_status", "modulename": "Trough.Trough_GUI.status_widgets", "qualname": "update_status", "kind": "function", "doc": "Call this routine to update the contents of all the status widgets.
\n\nraw_data: dict\n dictionary of latest raw data values for each\n sensor and their standard deviation\n (e.g. {'bal_raw':3.20,'bal_dev':0.005,'barr_raw':0.5,'barr_dev':0.002,\n 'temp_raw':2.24, 'temp_dev':0.01, 'messages':''})
\n\ncalibrations: Calibrations\n Object containing the calibrations for the trough (currently\n .balance
, .barriers
and .temperature
). A call to\n .balance.cal_apply(raw_data['bal_raw'],raw_data['bal_dev'])
\n will return the balance reading in the calibration units (.balance.units
).
This is run in a separate thread and will update the status widgets\nevery 2 seconds or when it can get access to the pipes to talk to the\ntrough.
\n\ntrough_lock: threading.lock\n When acquired this routine will talk to the trough. Releases it for\n other processes after every update.
\n\ncmdsend: Pipe\n End of Pipe to send commands to the Trough.
\n\ndatarcv: Pipe\n End of Pipe to receive data from the Trough.
\n\ncals: Trough_GUI.calibrations\n Used to convert the data to user units.
\n\nlastdirection: multiprocessing.Value\n Of type 'i' to indicate last direction the barriers moved.
\n\nrun_updater: multiprocessing.Value\n Of type 'c_bool'. True if this updater should keep running.
\n\nupdater_running: multiprocessing.Value\n Of type 'c_bool'. Set to True by this process when it starts\n and set to False before exiting.
\n", "signature": "(\ttrough_lock,\tcmdsend,\tdatarcv,\tcals,\tlastdirection,\trun_updater,\tupdater_running):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.status_widgets.start_status_updater", "modulename": "Trough.Trough_GUI.status_widgets", "qualname": "start_status_updater", "kind": "function", "doc": "\n", "signature": "():", "funcdef": "def"}]; + /** pdoc search index */const docs = [{"fullname": "Trough", "modulename": "Trough", "kind": "module", "doc": "This software is a custom controller and GUI for the research Langmuir trough \nin the Gutow Lab at UW Oshkosh. It is written in Python and expects to run in a\nJupyter notebook environment. However, all of the parts that are not elements\nof the user interface should work in a vanilla Python environment.
\n\nHardware requirements:\nRaspberry Pi compatible system with a Pi-Plates \nDAQC2 data acquisition plate \nand a trough controlled by the DAQC2 plate. This software could be used with \na trough controlled some other way by rewriting the routines in trough_util.\npy
. The GUI front end would need no rewriting to use with a different \ntrough if a custom backend controlling the barriers, reading the temperature \nand Whilhelmy balance is written. The backend needs to continually monitor \nthe trough and respond to the following commands: Stop, Send, Start, \nDirection, Speed, MoveTo, MotorCal, ConstPi, DataLabels, ShutDown
.
If you do not have compatible hardware the GUI will run with a simulated \ntrough, allowing you to see how it works.
\n\nOnce installed:
\n\npipenv shell
.jupyter notebook
(jupyter lab
also works and is now \nmore stable).from \nTrough import Trough_GUI
. This will take a while to run the first time \nit is run each day because it needs to check the movement of the barriers.Trough_GUI.Controls(Trough_GUI.calibrations)
Trough_GUI.Collect_data.Run(\"name_for_run\")
, \nwhere you replace name_for_run with the text for the name of the run (no \nspaces).By default in Ubuntu 20.04 for Pis the gpio and spi groups do not exist.\nThe i2c group does (not always).
\n\nrpi.gpio-common \npython3-pigpio python3-gpiozero python3-rpi.gpio
./etc/udev/rules.d/50-spidev.rules
containing SUBSYSTEM==\"spidev\", \nGROUP=\"spi\", MODE=\"0660\"
. The file should have rw permission for root \nand read permission for everyone else.python3 -m pip --version
or pip3 --version
. If you do not, \ninstall using apt \ninstall python3-pip
.To avoid library conflicts the software should be installed into a virtual environment.\nInstructions for doing this using pipenv\nfollow.
\n\nLog into your chosen user account:
\n\npip3 install \n--user pipenv
. You may\nneed to add ~/.local/bin
to your PATH
to make pipenv
\navailable in your command shell. More discussion: \nThe Hitchhiker's Guide to\nPython.$ mkdir Trough
).$ cd Trough
.$ pipenv shell
. To get out of\nthe environment you can issue the $ exit
command on the command line.$ pip install -U langmuir_trough
.$ jupyter notebook
. Jupyter should launch in your \nbrowser.\nfrom Trough import Trough_GUI
.\n When run this cell sets things up and tries to talk to the trough.$ pipenv shell
\nin the directory for virtual environment will do that.$ python -m ipykernel install --user --name=<name-you-want-for-kernel>
.Trough_GUI.newPlot()
, Trough_GUI.newFit()
and \nTrough_GUI.newCalculatedColumn()
.Trough
.spidev
package in requirements. pipenv shell
.pip install -e .
.pip \ninstall -U pdoc
..md
files included in _init_.py
.\npdoc --logo-link\nhttps://gutow.github.io/Langmuir_Trough/ --footer-text \"Langmuir_Trough vX.X.X\" \n--math -html -o docs Trough
where X.X.X
is the version number.doc
folder) with a ^C
to \nterminate it.Proceed only if testing of the build is successful.
\n\npip install -U setuptools wheel twine
setup.py
.python -m setup sdist bdist_wheel
.python -m twine upload dist/*
pip \ninstall -U ...
. Copy the actual link from pypi.org.\n`. If it does not work, pull the release.try ...
so that it can \nexit more gracefully and give up barrier monitoring?Trough
directory of the user \nTrough
.pipenv shell
jupyter lab
.from Trough import Trough_GUI
. If the \ntrough has not been started in the last 12 hours this will take a while \nas it checks the motor calibration for moving the barriers.This need to be done before each experiment.
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)
in an empty cell of the \nnotebook.Trough_GUI.Collect_Data.Run(\"XXX\")
, where XXX is replaced with a \nname for the run (e.g. \"clean_test_MMM_DD_YYYYa\") in an empty cell.It is extremely easy to contaminate the solvents with surface active \ncompounds at a level that will ruin experiments
\n\nFor most molecules we want to spread about 3.00 X 10-8 moles of \nmolecules on our trough to get a range of roughly 60 to 15 square Angstroms per \nmolecule during a compression.
\n\nTrough_GUI.Collect_Data.Run(\"XXX\")
, where XXX is replaced with a \n name for the run (e.g. \"CompoundName_MMM_DD_YYYYa\")This should be done at the beginning of any day real data is collected
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)\n
in an empty notebook cell.This only needs to be done if a check of the measured barrier separation \nis off by more than \u00b10.03 mm
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)\n
in an empty notebook cell.This is very stable so should not need to be done often
\n\nTrough_GUI.Controls(Trough_GUI.calibrations)\n
in an empty notebook cell.The data is collected in Jupyter notebooks so that you can use the \nPandas_GUI \nanalysis tools or write python code \nto analyze the data sets. When a data set is loaded from file or collected \nusing the command Trough_GUI.Collect_Data.Run(\"Run_Name\")
a run is added \nto the list Trough_GUI.runs
. Data from a run is stored in its Pandas \nDataframe Trough_GUI.runs[i].df
, where i
is the zero based index of the run.\nThe Pandas_GUI \ntools which provide menu access to the data can be run using the commands:
Trough_GUI.newPlot()
.Trough_GUI.newCalculatedColumn()
.Trough_GUI.newFit()
.datapkg: list\nlist of lists containing trough data bundle, messages in the last list.
\n\nlist\nlist of strings consisting of the messages.
\n", "signature": "(datapkg):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.simulation", "modulename": "Trough.Trough_Control.simulation", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_Control.simulation.simulated_troughctl", "modulename": "Trough.Trough_Control.simulation", "qualname": "simulated_troughctl", "kind": "function", "doc": "Will run as separate process taking in commands through a pipe and\nreturning data on demand through a second pipe.
\n\nCTLPipe: Pipe\n commands come in on and messages go out on.
\n\nDATAPipe: Pipe\n data is sent out on
\n", "signature": "(CTLPipe, DATAPipe):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util", "modulename": "Trough.Trough_Control.trough_util", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_Control.trough_util.isnumber", "modulename": "Trough.Trough_Control.trough_util", "qualname": "isnumber", "kind": "function", "doc": "\n\n", "signature": "(obj):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.etol_call", "modulename": "Trough.Trough_Control.trough_util", "qualname": "etol_call", "kind": "function", "doc": "True is a number.
\n
Wrapping a callable object in this function will cause it to be called until\nit either returns without an error or the maximum recursion depth is reached.\nThis should only be used on calls that occasionally return errors because they\nare reading sensors or something like that.
\n\nobj: callable
\n\nparam: list\n a list containing the parameters in the function call
\n\nresult: any\n result of function call
\n", "signature": "(obj, param):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.pid_exists", "modulename": "Trough.Trough_Control.trough_util", "qualname": "pid_exists", "kind": "function", "doc": "Check whether pid exists in the current process table.\nUNIX only. From this stackoverflow suggestion:\nhttps://stackoverflow.com/a/6940314
\n", "signature": "(pid):", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.is_trough_initialized", "modulename": "Trough.Trough_Control.trough_util", "qualname": "is_trough_initialized", "kind": "function", "doc": "Checks for a running Trough process and good connections to it.
\n\nbool\nTRUE if initialized
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.init_trough", "modulename": "Trough.Trough_Control.trough_util", "qualname": "init_trough", "kind": "function", "doc": "This initializes the trough control subprocess and creates the pipes to communicate\nwith it.
\n\npipe\ncmdsend: the end of the pipe to sent commands to the trough.
\n\npipe\ndatarcv: the end of the pipe the trough uses to send back data and messages.
\n\nProcess\nTROUGH: the process handle for the trough.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_Control.trough_util.troughctl", "modulename": "Trough.Trough_Control.trough_util", "qualname": "troughctl", "kind": "function", "doc": "Will run as separate process taking in commands through a pipe and\nreturning data on demand through a second pipe.\nIteration 1, collects data into a fifo and watches barrier position.
\n\nUses jupyter-pandas-GUI.new_pandas_column_GUI to provide a GUI expression\ncomposer. This method finds the datasets and launches the GUI.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.newPlot", "modulename": "Trough.Trough_GUI", "qualname": "newPlot", "kind": "function", "doc": "Uses jupyter-pandas-GUI.plot_pandas_GUI to provide a GUI expression\ncomposer. This method finds the datasets and launches the GUI.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.newFit", "modulename": "Trough.Trough_GUI", "qualname": "newFit", "kind": "function", "doc": "Uses jupyter-pandas-GUI.fit_pandas_GUI to provide a GUI expression\ncomposer. This method finds the datasets and launches the GUI.
\n", "signature": "():", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data", "modulename": "Trough.Trough_GUI.Collect_data", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run", "kind": "class", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.__init__", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.__init__", "kind": "function", "doc": "Create a new run object
\n\nid: int\n 0 based index of run in current notebook\nfilename: str\n String representation of the filename used to store the data,\n with not type extension. This probably should not contain a path.\ntitle: str\n User friendly title (suggested default is same as filename).\nunits: str\n Units for the displayed barrier positions (cm, cm^2 or Ang^2/molec).\ntarget: float\n Numerical value in units for the targeted final trough area.\nspeed: float\n Numerical value in units for the speed to move the barriers.\nmoles: float\n moles of molecules initially spread in the trough.\nplate_circ: float\n circumference of the Whilhelmy plate in mm.\ndataframe: DataFrame or None\ntimestamp: float or None
\n", "signature": "(\tid,\tfilename,\ttitle,\tunits,\ttarget,\tspeed,\tmoles,\tplate_circ,\tdataframe=None,\ttimestamp=None)"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.from_html", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.from_html", "kind": "function", "doc": "Create a run from an html representation
\n\nhtml: str\n The html to be parsed to create the run object
\n\ntrough_run: trough_run\n A trough_run object
\n", "signature": "(self, html):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.run_caption", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.run_caption", "kind": "function", "doc": "Returns an html table with info about the run to use as a caption
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.init_collect_control", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.init_collect_control", "kind": "function", "doc": "This initializes the collection control widgets and VBox that\ncontains them. The VBox may be accessed as self.collect_control
This closes self.collect_control
which also minimizes\nthe objects maintained on the Python side.
Create an html string representing a run
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.trough_run.write_run", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "trough_run.write_run", "kind": "function", "doc": "Writes a run file with the base filename run.filename
into the\ndirectory specified. If a file with the current name exists\nattempts to make the name unique by appending self.timestamp\nto the filename. Currently only produces\nan html file that is also human-readable. Other file formats may be\navailable in the future through the use of key word arguments.
dirpath:\n pathlike object or string. Empty string means the current working\n directory.
\n\nkwargs:\n optional key word arguments for future adaptability
\n", "signature": "(self, dirpath, **kwargs):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.Run", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "Run", "kind": "function", "doc": "This routine creates a GUI for initializing, starting, collecting and\ncompleting a run. If the run has been completed it will simply reload it\nfrom the local datafile.
\n\nrun_name: str or Path\nThis should generally be the name for the file the data will be stored in\nwithout a file type extension. Recommend a naming scheme that produces\nUnique filenames, such as Trough_run_<username>_<timestamp>
. The file\nname will be run_name.trh.run.html
.
This is run in a separate thread and will update the figure and\nall status widgets at an interval of 2 seconds or a little longer. While\nthis is running nothing else will be able to talk to the trough.
\n\ntrough_lock: threading.lock\n When acquired this routine will talk to the trough. It is not\n released until the routine exits to avoid any data loss. It does\n call the status_widgets updater as often as it can while collecting\n the data.
\n\ncmdsend: Pipe\n End of Pipe to send commands to the Trough.
\n\ndatarcv: Pipe\n End of Pipe to receive data from the Trough.
\n\ncals: Trough_GUI.calibrations\n Used to convert the data to user units.
\n\nlastdirection: multiprocessing.Value\n Of type 'i' to indicate last direction the barriers moved.
\n\nrun_updater: multiprocessing.Value\n Of type 'c_bool'. True if this updater should keep running.
\n\nupdater_running: multiprocessing.Value\n Of type 'c_bool'. Set to True by this process when it starts\n and set to False before exiting.
\n\nrun: trough_run\n This object contains the live figure and the place to store the data.
\n", "signature": "(\ttrough_lock,\tcmdsend,\tdatarcv,\tcals,\tlastdirection,\trun_updater,\tupdater_running,\trun):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Collect_data.update_collection", "modulename": "Trough.Trough_GUI.Collect_data", "qualname": "update_collection", "kind": "function", "doc": "Updates the graph and the data storage
\n", "signature": "(datapkg, cals, lastdirection, run_updater, updater_running, run):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.Monitor_Calibrate", "modulename": "Trough.Trough_GUI.Monitor_Calibrate", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.Monitor_Calibrate.Monitor_Setup_Trough", "modulename": "Trough.Trough_GUI.Monitor_Calibrate", "qualname": "Monitor_Setup_Trough", "kind": "function", "doc": "This produces a user interface in jupyter notebooks using ipywidgets. The\ninterface allows monitoring of the trough barrier positions, balance\nsignal, and temperature signal. The barrier positions can be\nadjusted using this interface. Calibrations of all the signals are\nperformed using this interface.
\n\nCalibrations are stored in the calibration files in the .Trough/calibrations\ndirectory of the current user. The latest file is used. If none exists\none is created using default parameters. Users should calibrate all\nsignals before using the trough.
\n\nNOTE: some objects used here are global and created by importing from\nstatus_widgets.py and command_widgets.py.
\n\ncalibrations: Calibrations\n The object containing the calibrations be used and modified. See\n Trough_GUI.calibration_utils
.
Utilities for:
\n\n.Trough/calibrations
.Defines a calibration of type name
.
name: str\n calibration name.
\n\nunits: str\n string representation of the units the calibration yields.
\n\ntimestamp: float\n Unix floating point timestamp.
\n\nparam:list\n list of the numerical parameters for the fit yielding the\n calibration.
\n\nparam_stdev: list\n list of the numerical values for the estimated standard\n deviation of the parameters from the fit.\nparam_inv: list\n list of the numerical values for the fit (or equation) yielding the\n inverse of the calibration (return to the raw value).\nparam_inv_stdev: list\n list of the numerical values for the estimated standard deviation of\n the parameters for the inversion.\ncal_data_x: list\n x-data used for the calibration fit.
\n\ncal_data_y: list\n y-data used for the calibration fit.
\n\nfit_type: str\n string name for the fit type. Defaults to \"polynomial\"
\n\nfit_eqn_str: str\n string representation of the fit equation. Defaults to\n \"y = C0 + C1x + C2xx + C3xxx + ...\"
\n\nfit_ceof_lbls: list\n list of string labels for the coefficients, which should\n correlate to symbols in the fit_eqn_str. Defaults to [\"C0\", \"C1\",\n ...]. Automatically, truncated to the actual number of\n coefficients determined by the order of the polynomial.
\n\nadditional_data:dict\n a dictionary of key:value pairs where the keys are a short\n descriptive string. They can contain any additional data\n necessary for doing calculations on the data.
\n", "signature": "(\tname,\tunits,\ttimestamp,\tparam,\tparam_stdev,\tparam_inv,\tparam_inv_stdev,\tcal_data_x,\tcal_data_y,\tfit_type='polynomial',\tfit_eqn_str='y = C0 + C1*x + C2*x*x + C3*x*x*x + ...',\tfit_ceof_lbls=['C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7'],\tadditional_data={})"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_from_html", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_from_html", "kind": "function", "doc": "This takes in an html str, parses it and returns a new\ncalibration.
\n\nhtml: str\n The html to be parsed to create the calibration object
\n\ncalibration: calibration\n a calibration object.
\n", "signature": "(cls, html):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_to_html", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_to_html", "kind": "function", "doc": "This routine creates an html str that would be human-readable in a\nbrowser detailing the calibration. This can be written to a file to\nstore the calibration.
\n\ncalib_div: str\n string containing the html detailing the calibration.
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_apply", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_apply", "kind": "function", "doc": "\n", "signature": "(self, data, stdev):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibration.cal_inv", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibration.cal_inv", "kind": "function", "doc": "\n", "signature": "(self, data, stdev):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations", "kind": "class", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations.read_cal", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations.read_cal", "kind": "function", "doc": "This routine reads in a calibration file. If it is the standard\nhtml file it uses calibration.cal_from_html()
operation to convert\nit to a calibration.
name: str\n either the basename (current options: 'balance', 'barriers_open',\n 'barriers_close', 'speed_open', 'speed_close' or\n 'temperature') or a string representation of the path to the\n calibration file to be read. If one of the basenames is used\n this code will look for the most recent calibration of that type\n in the directory '~.Trough\\calibrations'.
\n\nCalibration
\n", "signature": "(self, name):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations.write_cal", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations.write_cal", "kind": "function", "doc": "Writes a calibration file with the base filename cal.name + int(\ncal.timestamp)
into the directory specified. Currently only produces\nan html file that is also human-readable. Other file formats may be\navailable in the future through the use of key word arguments.
dirpath:\n pathlike object or string
\n\ncal: Calibration\n a calibration object containing the information about the\n calibration to write to the file.
\n\nkwargs:\n optional key word arguments for future adaptability
\n", "signature": "(self, dirpath, cal, **kwargs):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.calibration_utils.Calibrations.poly_fit", "modulename": "Trough.Trough_GUI.calibration_utils", "qualname": "Calibrations.poly_fit", "kind": "function", "doc": "Does a polynomial fit of the specified order using the x and y\nvalues provided.
\n\ndata_x: list\n of numerical x values.
\n\ndata_y: list\n of numerical y values.
\n\norder: int\n the order of the polynomical used for fitting.
\n\nyerr: float or iterable of float\n absolute error(s) in the y-value. Used to weight the fit. If no\n values are provided the assumption is equal weighting.
\n\nparam: list\n of fitted parameters.
\n\nparam_stdev: list\n of estimated standard deviation in the parameters.
\n", "signature": "(self, data_x, data_y, order, yerr=None):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets", "modulename": "Trough.Trough_GUI.command_widgets", "kind": "module", "doc": "\n"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_change_Barr_Units", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_change_Barr_Units", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_change_Barr_Direction", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_change_Barr_Direction", "kind": "function", "doc": "\n", "signature": "(changed):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_Barr_Target_change", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_Barr_Target_change", "kind": "function", "doc": "Updates the speed settings since open and close are different.
\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_click_Start", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_click_Start", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.command_widgets.on_click_Stop", "modulename": "Trough.Trough_GUI.command_widgets", "qualname": "on_click_Stop", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions", "modulename": "Trough.Trough_GUI.conversions", "kind": "module", "doc": "This file contains unit conversion utility functions for use in the GUI
\n\nvalue, err
part of the call with\n*func(...)
. For example sqcm_to_angpermolec(*cm_to_sqcm(9.2, 0.1, cals),\ncals)
convert barrier separation in cm to trough area in sqcm
\n", "signature": "(value, err, cals):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.sqcm_to_cm", "modulename": "Trough.Trough_GUI.conversions", "qualname": "sqcm_to_cm", "kind": "function", "doc": "convert trough area in sqcm to barrier separation in cm
\n", "signature": "(value, err, cals):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.sqcm_to_angpermolec", "modulename": "Trough.Trough_GUI.conversions", "qualname": "sqcm_to_angpermolec", "kind": "function", "doc": "convert trough area in sqcm to square angstroms per molecules
\n", "signature": "(value, err, moles):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.angpermolec_to_sqcm", "modulename": "Trough.Trough_GUI.conversions", "qualname": "angpermolec_to_sqcm", "kind": "function", "doc": "convert trough area in sqcm to square angstroms per molecules
\n", "signature": "(value, err, moles):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.mg_to_mNperm", "modulename": "Trough.Trough_GUI.conversions", "qualname": "mg_to_mNperm", "kind": "function", "doc": "convert balance measurement in mg to milliNewtons per meter
\n", "signature": "(value, err, pi_tare, plate_circ):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.conversions.nNperm_to_mg", "modulename": "Trough.Trough_GUI.conversions", "qualname": "nNperm_to_mg", "kind": "function", "doc": "convert surface pressure in milliNewtons per meter to mg
\n", "signature": "(value, err, pi_tare, plate_circ):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.status_widgets", "modulename": "Trough.Trough_GUI.status_widgets", "kind": "module", "doc": "This file contains widgets that display updating trough information and\ncan be used in multiple ipywidget panels within the same notebook.
\n"}, {"fullname": "Trough.Trough_GUI.status_widgets.set_zero_pressure", "modulename": "Trough.Trough_GUI.status_widgets", "qualname": "set_zero_pressure", "kind": "function", "doc": "\n", "signature": "(change):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.status_widgets.update_status", "modulename": "Trough.Trough_GUI.status_widgets", "qualname": "update_status", "kind": "function", "doc": "Call this routine to update the contents of all the status widgets.
\n\nraw_data: dict\n dictionary of latest raw data values for each\n sensor and their standard deviation\n (e.g. {'bal_raw':3.20,'bal_dev':0.005,'barr_raw':0.5,'barr_dev':0.002,\n 'temp_raw':2.24, 'temp_dev':0.01, 'messages':''})
\n\ncalibrations: Calibrations\n Object containing the calibrations for the trough (currently\n .balance
, .barriers
and .temperature
). A call to\n .balance.cal_apply(raw_data['bal_raw'],raw_data['bal_dev'])
\n will return the balance reading in the calibration units (.balance.units
).
This is run in a separate thread and will update the status widgets\nevery 2 seconds or when it can get access to the pipes to talk to the\ntrough.
\n\ntrough_lock: threading.lock\n When acquired this routine will talk to the trough. Releases it for\n other processes after every update.
\n\ncmdsend: Pipe\n End of Pipe to send commands to the Trough.
\n\ndatarcv: Pipe\n End of Pipe to receive data from the Trough.
\n\ncals: Trough_GUI.calibrations\n Used to convert the data to user units.
\n\nlastdirection: multiprocessing.Value\n Of type 'i' to indicate last direction the barriers moved.
\n\nrun_updater: multiprocessing.Value\n Of type 'c_bool'. True if this updater should keep running.
\n\nupdater_running: multiprocessing.Value\n Of type 'c_bool'. Set to True by this process when it starts\n and set to False before exiting.
\n", "signature": "(\ttrough_lock,\tcmdsend,\tdatarcv,\tcals,\tlastdirection,\trun_updater,\tupdater_running):", "funcdef": "def"}, {"fullname": "Trough.Trough_GUI.status_widgets.start_status_updater", "modulename": "Trough.Trough_GUI.status_widgets", "qualname": "start_status_updater", "kind": "function", "doc": "\n", "signature": "():", "funcdef": "def"}]; // mirrored in build-search-index.js (part 1) // Also split on html tags. this is a cheap heuristic, but good enough. diff --git a/setup.py b/setup.py index 0626490..ec3a5bc 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="langmuir_trough", - version="0.8.0", + version="0.8.1", description="Controls and collects data from Gutow Lab Langmuir Trough.", long_description=long_description, long_description_content_type="text/markdown",