Commit f26c28d2 authored by v.svintozelskyi's avatar v.svintozelskyi
Browse files

Added docs

parent 10e0cb67
docs/build
.vscode
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: ae4434aa08c681ca92badba252b9ae4e
tags: 645f666f9bcd5a90fca523b33c5a78b7
.. Python front-end for MDC PASTTRECs documentation master file, created by
sphinx-quickstart on Mon Jan 3 15:10:45 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Python front-end for MDC PASTTRECs documentation!
==============================================================
The source code can be found on my `GitLab <http://github.com/ericholscher/django-kong>`_.
The basic idea is to let the user manipulate both virtual configuration objects and real hardware via Jupyter Notebook.
The system uses the pasttrec_ctrl module as a port for physical interaction with real hardware using trbnet library.
The passtrec_conf module created for simpler handling of different configurations and control the PASTTREC chips.
.. toctree::
:maxdepth: 2
:caption: Contents:
pasttrec_ctrl
pasttrec_conf
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
MDCTDC_OEP
==========
\ No newline at end of file
MDCTDC_PT
=========
A class for handling the individual configurations for each PASTTREC.
Attributes:
gain : float
Value of gain for this PASTTREC. Acceptable values is only: 0.67, 1, 2, 4.
pt : float
Value of peaking time for this PASTTREC. Acceptable values is only: 10, 15, 20, 35.
thr : float
Value of threshold for this PASTTREC. Acceptable values is any one in range from 0 to 2^7.
baselines : array(float)
Values of baseline for each channel of this PASTTREC. Acceptable values is any one in range from 0 to 31.
gain_map : dict(float, int)
Bit mask for each value of gain. Not for end user.
pt_map : dict(float, int)
Bit mask for each value of peaking time. Not for end user.
``__init__``
------------
Parameters:
gain : float, optional (default is 4)
Pasttrec gain
peaktime : float, optional (default is 10)
Pasttrec peaking time
thr : float, optional (default is 8)
Pasttrec threshold
baselines : array(float), optional (default is [0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f])
Pasttrec baselines
``setBaselines``
----------------
Set a new values for baselines. Automatically checks validity.
Parameters:
new : array(float)
New baselines
``setBaseline``
---------------
Set a new value for one specific baseline. Automatically checks validity.
Parameters:
ch : float
Number of channel
value: float
New value of baseline for channel ch
\ No newline at end of file
PASTTREC configuration module (pasttrec_ctrl.py)
================================================
Contain the mechanisms for handling virtual PASTTREC configurations and effective flashing them.
.. toctree::
MDCTDC_PT - Virtual PASTTREC objects <mdctdc_pt>
MDCTDC_FPGA - Virtual PASTTREC objects <mdctdc_fpga>
MDCTDC_OEP - Virtual PASTTREC objects <mdctdc_oep>
PASTTREC configuration module (pasttrec_ctrl.py)
================================================
Contain the mechanisms for handling virtual PASTTREC configurations and effective flashing them.
.. toctree::
MDCTDC_PT - Virtual PASTTREC object <mdctdc_pt>
MDCTDC_FPGA - Virtual FPGA object <mdctdc_fpga>
MDCTDC_OEP - Virtual OEP object <mdctdc_oep>
Configuration - Python object for handling PASTTREC configurations <configuration>
ConfStorage - One place for storing default PASTTREC configurations.
PASTTREC control module (pasttrec_ctrl.py)
==========================================
Contain all methods for physical interaction with actual boards.
.. contents::
:local:
:depth: 1
``spi_mdc_mbo``
---------------
#TODO lorem impsum
``spi_set_pasttrec_register``
-----------------------------
Set a value to a specific PASTTREC register.
Parameters:
TDC_str : str
Address of associated TDC
pasttrec : int
Number of PASTTREC ASIC [0-3].
reg : int
Address of PASTTREC register [0x0 - 0xD]
data : int
Data to be written [0x00 - 0xFF].
See details in the PASTTREC docs.
``spi_set_pasttrecs_register``
------------------------------
Set a value to a specific PASTTREC register for all associated PASTTRECs with specified TDC.
Parameters:
TDC_str : str
Address of associated TDC
reg : int
Address of PASTTREC register [0x0 - 0xD]
data : int
Data to be written [0x00 - 0xFF].
See details in the PASTTREC docs.
``reset_board``
---------------
Performs a soft reset of PASTTREC FPGA module (without interruption of all other systems)
Parameters:
TDC_str : str
Address of associated TDC
CONN : int, optional (default is 0)
Not used. For back compatibility only.
``reset_boards``
----------------
Performs a soft reset of PASTTREC FPGA module (without interruption of all other systems)
Parameters:
TDC_strs : array(str)
An array of associated TDC's addresses.
CONN : int, optional (default is 0)
Not used. For back compatibility only.
``reset_board_by_name``
-----------------------
Performs a soft reset of PASTTREC FPGA module (without interruption of all other systems)
Parameters:
board_name : str
Board name
``set_threshold``
-----------------
Set threshold value of specific PASTTREC
Parameters:
TDC : str
Assosiated TDC
CONN : int
PASTTREC's number of connection.
CHIP : int
PASTTREC's chip number
THR : int
New threshold value
``set_threshold_for_board``
---------------------------
Set threshold value of specific PASTTRECs.
Parameters:
TDC : str
Assosiated TDC
CONN : int
PASTTREC's number of connection. Not used if new style is active.
thresh : int
New threshold value
new_style : boolean, optional (default is false)
If new_style is false, only PASTTRECs assosiated with specific connection are affected. (for back compability)
If new_style is true, all PASTTRECs assosiated with specific TDC are affected.
``set_threshold_for_board_by_name``
-----------------------------------
Set threshold value of all PASTTREC assosiated with specific board.
Parameters:
board_name : str
Name of assosiated board.
thresh : int
New threshold value
new_style : boolean, optional (default is false)
If new_style is false, only PASTTRECs assosiated with specific connection (specified by board_name) are affected. (for back compability)
If new_style is true, all PASTTRECs assosiated with specific TDC are affected.
``slow_control_test``
#TODO have no idea what is this for
``slow_control_test_boards``
----------------------------
#TODO have no idea what is this for
``set_baseline``
----------------
Set a baseline level for one of TDC channels.
Parameters:
TDC : str
A TDC's address.
channel : int
Number of channel [0 - 31].
value : int
New value of baseline level [-15,15].
``set_all_baselines``
---------------------
Set a baseline level for an array of TDC channels.
Parameters:
TDC : str
A TDC's address.
channels : array(int)
Array of channel's numbers.
values : array(int)
Array of new values of baseline levels.
``set_all_baselines_to_same_value``
-----------------------------------
Set a baseline level for all channels of specified TDC.
Parameters:
TDC : str
A TDC address.
value : int
New value of baseline levels.
``init_chip``
-------------
#TODO
``init_board``
--------------
#TODO
``init_active_boards``
----------------------
#TODO
``init_boards_by_name``
-----------------------
#TODO
``init_board_by_name``
----------------------
#TODO
``found_baselines_for_board``
-----------------------------
Found a baseline level for all channels of specific board with noize method.
Parameters:
board : str
A TDC address.
scaning_time : float, optional (default is 0.2)
Duration of each step during data aqusition
plot : boolean, optional (default is False)
if true, plots the noize level versus baseline for each channel.
apply_res : boolean, optional (default is False)
if true, after the baselines will be found, they will be applyed for each channel.
``found_baselines_for_boards``
------------------------------
The same as found_baselines_for_board but for a list of boards.
Parameters:
boards : array(str)
A list of TDC's addresses.
scaning_time : float, optional (default is 0.2)
Duration of each step during data aqusition
plot : boolean, optional (default is False)
if true, plots the noize level versus baseline for each channel.
apply_res : boolean, optional (default is False)
if true, after the baselines will be found, they will be applyed for each channel.
``read_PASTTREC_regs``
----------------------
Read the values of PASTTREC registers.
Parameters:
TDC_str : str
A TDC address.
pasttrec : int
Number of PASTTREC
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: Georgia, serif;
font-size: 17px;
background-color: #fff;
color: #000;
margin: 0;
padding: 0;
}
div.document {
width: 940px;
margin: 30px auto 0 auto;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 220px;
}
div.sphinxsidebar {
width: 220px;
font-size: 14px;
line-height: 1.5;
}
hr {
border: 1px solid #B1B4B6;
}
div.body {
background-color: #fff;
color: #3E4349;
padding: 0 30px 0 30px;
}
div.body > .section {
text-align: left;
}
div.footer {
width: 940px;
margin: 20px auto 30px auto;
font-size: 14px;
color: #888;
text-align: right;
}
div.footer a {
color: #888;
}
p.caption {
font-family: inherit;
font-size: inherit;
}
div.relations {
display: none;
}
div.sphinxsidebar a {
color: #444;
text-decoration: none;
border-bottom: 1px dotted #999;
}
div.sphinxsidebar a:hover {
border-bottom: 1px solid #999;
}
div.sphinxsidebarwrapper {
padding: 18px 10px;
}
div.sphinxsidebarwrapper p.logo {
padding: 0;
margin: -10px 0 0 0px;
text-align: center;
}
div.sphinxsidebarwrapper h1.logo {
margin-top: -10px;
text-align: center;
margin-bottom: 5px;
text-align: left;
}
div.sphinxsidebarwrapper h1.logo-name {
margin-top: 0px;
}
div.sphinxsidebarwrapper p.blurb {
margin-top: 0;
font-style: normal;
}
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
font-family: Georgia, serif;
color: #444;
font-size: 24px;
font-weight: normal;
margin: 0 0 5px 0;
padding: 0;
}
div.sphinxsidebar h4 {
font-size: 20px;
}
div.sphinxsidebar h3 a {
color: #444;
}
div.sphinxsidebar p.logo a,
div.sphinxsidebar h3 a,
div.sphinxsidebar p.logo a:hover,
div.sphinxsidebar h3 a:hover {
border: none;
}
div.sphinxsidebar p {
color: #555;
margin: 10px 0;
}
div.sphinxsidebar ul {
margin: 10px 0;
padding: 0;
color: #000;
}
div.sphinxsidebar ul li.toctree-l1 > a {
font-size: 120%;
}
div.sphinxsidebar ul li.toctree-l2 > a {
font-size: 110%;
}
div.sphinxsidebar input {
border: 1px solid #CCC;
font-family: Georgia, serif;
font-size: 1em;