Skip to content

Commit

Permalink
Doc Update for RSC
Browse files Browse the repository at this point in the history
  • Loading branch information
HKaras committed Apr 8, 2024
1 parent 256d20d commit 6ab1a88
Show file tree
Hide file tree
Showing 16 changed files with 18,014 additions and 59 deletions.
7 changes: 6 additions & 1 deletion autodeer/DEER_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,13 @@ def background_func(t, fit):
lam = getattr(fit, f"mod")
prod *= dl.bg_hom3d(t-reftime, conc, lam)
scale += -1 * lam

if hasattr(fit,'P_scale'):
scale *= fit.P_scale
elif hasattr(fit,'scale'):
scale *= fit.scale

return fit.P_scale * scale * prod
return scale * prod

def calc_correction_factor(fit_result,aim_MNR=25,aim_time=2):

Expand Down
2 changes: 1 addition & 1 deletion autodeer/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5_dev"
__version__ = "0.7"
8,975 changes: 8,975 additions & 0 deletions docsrc/_static/AbstractFigure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,435 changes: 4,435 additions & 0 deletions docsrc/_static/FlowDiagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,481 changes: 4,481 additions & 0 deletions docsrc/_static/StripFigure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
# -- Project information -----------------------------------------------------

project = 'autoDEER'
copyright = '2021-2023, Hugo Karas, Gunnar Jeschke, Stefan Stoll'
copyright = '2021-2024, Hugo Karas, Gunnar Jeschke, Stefan Stoll'
author = 'Hugo Karas'

# The full version, including alpha/beta/rc tags
release = '0.4-alpha'
release = '0.7'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -77,7 +77,6 @@
}
intersphinx_mapping = {
"deerlab": ("https://jeschkelab.github.io/DeerLab/", None),
"xarray": ("https://docs.xarray.dev/en/stable/index.html", None),
"numpy": ("https://numpy.org/doc/stable/", None),
}
intersphinx_disabled_reftypes = ["*"]
Expand All @@ -90,7 +89,7 @@
html_title = " "
html_static_path = ["_static"]
html_theme_options = {
"announcement": "Version 0.7 alpha out now!",
# "announcement": "Version 0.7 out now!",
"light_logo": "autoDEER_EPR_light.svg",
"dark_logo": "autoDEER_EPR_dark.svg",

Expand Down
38 changes: 26 additions & 12 deletions docsrc/index.rst
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@

Welcome to autoEPR & autoDEER!
Welcome to autoDEER!
====================================

.. caution::
This documentation is a work in progress and not yet complete.
Please be patient and if anything is unclear, please contact the developers.
Please be patient and if anything is unclear and please feel free to contact the developers.

**autoEPR** is a free software package for the running of automated pulsed EPR
experiments. It is designed to work with any arbitrary EPR sequence, including
shaped pulses, on any modern spectrometer.
autoDEER is a spectrometer independent Python package developed to enable push-button
fully automated DEER. The program is built around a well established and tested optimised algorithum.
It can be either interfaced using the user friendly GUI or via Python code. Additionally, the backend "autoEPR" can
be used to build new projects.

AutoEPR can be applied to many experiments in pulse EPR, currently, we are only
working on an implementation for DEER, autoDEER.
.. image:: _static/AbstractFigure.svg
:align: center

**autoDEER** is a specific implementation of autoEPR for the purpose of push-button
automatic Double Electron Electron Resonance (DEER) spectroscopy.
autoDEER's Key Features
-----------------------

.. image:: source/images/autoDEER&autoEPR.svg
- Fully Automated Push Button DEER
- Integrated Fitting
- Spectrometer Independence
- Intuitive Graphical User Interface
- High Quality PDF Report Generator
- and much more...

.. warning::
autoEPR and autoDEER are actively developed software package, that is still very much a work in process. At this moment in time, we only recommend it is used by people who understand how
the python code work and can debug when it goes wrong. Please consider this to be an alpha release, it is hoped that a more stable beta version can be released soon.
autoDEER is an actively developed software package, that is still very much a work in process. Please consider this to be a beta release.

.. toctree::
:maxdepth: 1
:hidden:
:caption: User Guide

./source/Install.rst
./source/tutorial.rst
./source/API_docs.rst
./source/autoEPR/index.rst

.. toctree::
:hidden:
:caption: About

./source/releasenotes.rst
./source/contributing.rst
Github <https://github.com/JeschkeLab/autoDEER>


70 changes: 70 additions & 0 deletions docsrc/source/Algorithum.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
The Automated Algorithum
========================

When using the Graphical User Interface it is possible to use the full power of
autoDEER by using the optimised automated algorithum. This has been developed
to require minimal user input, and with a press of a button can measure the distance
distribution of unknown sample.


.. image:: ../_static/FlowDiagram.svg
:alt: The Algorithum
:align: center


Steps Explained
---------------


1. User Inputs
**************
Before the algorithum can start the user must provide some details. The most important of these being the approximate resonator frequency. Additionally, the user should specify how much time they have and give a sample name. The user can also specify the labelling efficency if they know it is not 100%.

2. Fieldsweep
*************
The first experiment caried out is an Echo Detected Field Sweep (EDFS). This EDFS spectrum is then fitted and the fitter function will be used later in the optimisation of DEER pulses.

3. SRT Scan
***********
Now that an echo has been established, the next step is to optimise the shot repetition time (SRT). The SRT if optimised by running a Hahn Echo with increasing SRT, and a SRT is chose which allows for a 90% signal recovery.

4. Resonator Profile
********************
It is important to charecterise the frequency response of the resonator. This is need to clarify that the spectrum is located optimally. For rectangular pulsed experiments this can be used to identify the shortest possible pulse length, and for shaped and chirped pulses it can be used for resonator compensation.
The profile is generated from a series of refocused echo nutation experiments, where the initial hard pulse is varied in length. The nutation profiles are carried out across a frequency range, the magnetic field is adjusted such that the system is always on resonance.

5. Relaxation Studies
**********************
Relaxation studies are carried out by autoDEER primarily to identify the maximum inter-pulse delays for DEER experiments, but also to predict run times.
All samples measure both a Hahn Echo decay and a Carr-Purcell 2 pulse echo decay. For 4pDEER only measurments a 2D refoucsed echo decay sequence needs to be measured to optimise the inter pulse delays.

6. Optimising DEER Sequence Parameters
**************************************
Now all the sample characterisation and setup experiments have been completed, we can now generate the optimised parameters for running an initial DEER measurement

Parameter
+++++++++
- Pulse Sequence: Unless the maximum :math:`\tau_{evo}` is less than 1.5 :math:`\mu`s, the algorithum will use a 5pDEER sequence. This is because 5pDEER nearly always gives a higher sensitivity than 4pDEER.
- :math:`\tau_1` and :math:`\tau_2`: These are calculated from the CP-decay or 2D refocused echo decay for the initial DEER or including the region of interest (ROI) for the final DEER.
- dt: The step size for the time domain data is set to be either 16 ns or based from the region of interest (ROI) for the final DEER.
- Pulse Shapes: If an AWG is avaliable, a Hyperbolic Secant (HS) pump pulse is used otherwise fully rectangular pulses are used.


7. Initial DEER Experiment
**************************
An Initial 2-4 hour DEER measurement is carried out to determine the approximate distance distribution. This experiment is run until a SNR of 20 is reached.
The distance distribution is then calculated using a model free appraoch and DeerLab.
The distance distribution is then used to calculate the optimal :math:`\tau_{evo}` for the final DEER experiment.

8. Final DEER Experiment
************************
Finally, the final DEER experiment is carried out. The :math:`\tau_{evo}` comes from the ROI of the initial distance distribution unless it exceeds what can be achieved in the maximum time.
Again the distance distribution is calculated using a model free appraoch and DeerLab.

Limitations
-----------

At the moment the algorithum has only been designed to work on most common DEER experiments, so the following limitations apply:

- Nitroxide Labeled Samples
- Q Band
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jupyter_interface
Jupyter Interface
=================

Advanced users will likely want to have more control over their experiments,
Expand Down
30 changes: 0 additions & 30 deletions docsrc/source/autoDEER/algorithm.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docsrc/source/autoDEER/deer_intro.rst

This file was deleted.

6 changes: 6 additions & 0 deletions docsrc/source/autoEPR/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ autoEPR

AutoEPR is a Python-based spectrometer-independent automation toolbox. It was originally designed as the back end for automating DEER experiments (autoDEER) but it is also readily expandable to a large variety of other pulse EPR experiments. Currently, it is still fully integrated into autoDEER this will likely change at a later date.

.. image:: ../images/autoEPR.svg
:align: center



Features included in autoEPR:
-----------------------------

* Automated Control: Fully automated experiments from pulse tunning and set-up experiments (Field-Sweeps, Resonator profiles, etc…) to final measurement and analysis. This can all be done such that the user only needs to press a single button and walk away.
* Integrated Analysis: Whilst the experiment is running, the toolbox can actively process and analyse the data. This analysis can be used to either set future experimental parameters or to intelligently end the experiment once specific criteria have been satisfied. It is possible to expand to all Python-based data analysis packages.
Expand Down
5 changes: 2 additions & 3 deletions docsrc/source/gui_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ Either a single inter-pulse delay is given and the others are found or all can b

3. Viewing the analysis
----------------------------------
As the measurement progresses, the data will be analysed and the results will be displayed in the GUI. For DEER measurements, this is done live and the results are updated as the measurement progresses.

4. Printing a PDF lab-report
----------------------------------

Appendix
--------
Once the measurement is complete, a PDF lab-report can be generated by clicking the "Save PDF" button. This will save a PDF file in the working directory with the results of the experiment.
File renamed without changes
7 changes: 5 additions & 2 deletions docsrc/source/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ Release Notes
=============


Version 0.7.0 (2024-02-01):
Version 0.7.0 (2024-04-01):
+++++++++++++++++++++++++++

- Added Graphical User Interface (GUI)
- Added support for Bruker AWG
- Major improvements to the automated algorithm and reliability
- Improvements to the PDF reports
- Updated Documentation and shift to autoapi based API docs
- Added initial support for Bruker AWG
4 changes: 3 additions & 1 deletion docsrc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ There are two mains ways of using autoDEER:
:hidden:
:maxdepth: 2

./gui_guide.rst
./Algorithum.rst
./gui_guide.rst
./Jupyter_interface.rst

0 comments on commit 6ab1a88

Please sign in to comment.