:py:mod:`autodeer.classes` ========================== .. py:module:: autodeer.classes Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: autodeer.classes.Interface autodeer.classes.Parameter .. py:class:: Interface(log=None) Represents the interface connection from autoEPR to the spectrometer. .. !! processed by numpydoc !! .. py:attribute:: pulses .. py:attribute:: savefolder .. py:attribute:: savename :value: "''" .. py:attribute:: resonator :value: 'None' .. py:method:: connect() .. py:method:: acquire_dataset(data) Acquires the dataset. .. !! processed by numpydoc !! .. py:method:: launch(sequence, savename) Launches the experiment and initialises autosaving. :Parameters: **sequence** : Sequence The sequence to be launched **savename** : str The savename for this measurement. A timestamp will be added to the value. .. !! processed by numpydoc !! .. py:method:: isrunning() .. py:method:: terminate() Terminates the experiment immediately. .. !! processed by numpydoc !! .. py:method:: terminate_at(criterion, test_interval=2, keep_running=True, verbosity=0, autosave=True) Terminates the experiment upon a specific condition being satisified. :Parameters: **criterion** : _type_ The criteria to be tested. **test_interval** : int, optional How often should the criteria be tested in minutes, by default 10. **keep_running** : bool, optional If True, an error will not be raised if the experiment finishes before the criteria is met, by default True. **verbosity** : int, optional The verbosity level, by default 0. **autosave** : bool, optional If True, the data will be autosaved, by default True. .. !! processed by numpydoc !! .. py:class:: Parameter(name, value, unit='', description='', virtual=False, **kwargs) Represents a sequence or pulse parameter. A general parameter. :Parameters: **name** : str The parameter name **value** : float or int The parameter value, eithe initial or static **unit** : str, optional The unit of parameter, by default None. Leave as None if unitless. **description** : str, optional A brief description of the parameter, by default None **axis** : np.ndarray, optional The difference from the intial value for each position in a dynamic axis. Can be n-dimensional, by default None. **ax_id** : list, optional .. **virtual: bool, optional** A virtual paramter is only used to vary other parameters, it is not varied itself and will not be directly passed to a spectrometer. This parameter is **never** inherited. By default, False :Attributes: **progressive** : bool Is the parameter used in any progression or is it constant **prog** : dict A dict containing progressive programs for this parameter. This list has two elements. 1) The axis_id"s and 2) the "axis" of values. .. rubric:: Examples Creating a static parameter ``` Par1 = Parameter( name="Par1", value=10, unit="us", description="The first parameter") ``` Creating a dynamic parameter ``` Par1 = Parameter( name="Par1", value=10, unit="us", description="The first parameter", axis=np.arange(0,10,1), axis_id=0) ``` Adding a parameter and a number: ``` Par1 = Parameter( name="Par1", value=10, unit="us", description="The first parameter") Par2 = Par1 + 2 .. !! processed by numpydoc !! .. py:property:: dim .. py:attribute:: name .. py:attribute:: unit .. py:attribute:: description .. py:attribute:: virtual .. py:attribute:: axis :value: '[]' .. py:attribute:: ax_id :value: '[]' .. py:method:: add_axis(axis_id, axis) .. py:method:: get_axis() .. py:method:: remove_dynamic() .. py:method:: is_static() .. py:method:: __eq__(__o) .. py:method:: __add__(__o) .. py:method:: __sub__(__o) .. py:method:: __mul__(__o) .. py:method:: __rmul__(__o) .. py:method:: copy() .. py:method:: _to_dict() .. py:method:: _to_json() .. py:method:: save(filename) Save the parameter to a JSON file. :Parameters: **filename** : str Path to the JSON file. :Returns: None .. :Raises: TypeError If the object cannot be serialized to JSON. .. !! processed by numpydoc !! .. py:method:: _from_dict(dict) :staticmethod: .. py:method:: _from_json(JSONstring) :classmethod: .. py:method:: load(filename) :classmethod: Load a Parameter object from a JSON file. :Parameters: **filename** : str Path to the JSON file. :Returns: **obj** : Parameter The Pulse loaded from the JSON file. :Raises: FileNotFoundError If the file does not exist. .. !! processed by numpydoc !!