Debian Codegraph @

pymeasure/instruments/signalrecovery/dsp7225.py

raw
1 #
2 # This file is part of the PyMeasure package.
3 #
4 # Copyright (c) 2013-2024 PyMeasure Developers
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 # THE SOFTWARE.
23 #
24
25 # =============================================================================
26 # Libraries / modules
27 # =============================================================================
28
29 from .dsp_base import DSPBase
30 import logging
31
32 # =============================================================================
33 # Logging
34 # =============================================================================
35
36 log = logging.getLogger(__name__)
37 log.addHandler(logging.NullHandler())
38
39
40 # =============================================================================
41 # Instrument file
42 # =============================================================================
43
44
45 class DSP7225(DSPBase):
46 """Represents the Signal Recovery DSP 7225 lock-in amplifier.
47
48 Class inherits commands from the DSPBase parent class and utilizes dynamic
49 properties for various properties.
50
51 .. code-block:: python
52
53 lockin7225 = DSP7225("GPIB0::12::INSTR")
54 lockin7225.imode = "voltage mode" # Set to measure voltages
55 lockin7225.reference = "internal" # Use internal oscillator
56 lockin7225.fet = 1 # Use FET pre-amp
57 lockin7225.shield = 0 # Ground shields
58 lockin7225.coupling = 0 # AC input coupling
59 lockin7225.time_constant = 0.10 # Filter time set to 100 ms
60 lockin7225.sensitivity = 2E-3 # Sensitivity set to 2 mV
61 lockin7225.frequency = 100 # Set oscillator frequency to 100 Hz
62 lockin7225.voltage = 1 # Set oscillator amplitude to 1 V
63 lockin7225.gain = 20 # Set AC gain to 20 dB
64 print(lockin7225.x) # Measure X channel voltage
65 lockin7225.shutdown() # Instrument shutdown
66 """
67
68 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69 # Dynamic values - Override base class validator values
70 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
72 frequency_values = [0.001, 1.2e5]
73 harmonic_values = [1, 32]
74 curve_buffer_bit_values = [1, 65535]
75
76 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77 # Initializer
78 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79
80 def __init__(self, adapter, name="Signal Recovery DSP 7225", **kwargs):
81 super().__init__(
82 adapter,
83 name,
84 **kwargs
85 )