1
This commit is contained in:
728
.gitignore
vendored
728
.gitignore
vendored
@@ -299,3 +299,731 @@ test.xml
|
||||
/docs/source/05_reference/_autosummary
|
||||
/docs/source/05_reference/_autosummary
|
||||
codex.md
|
||||
pylablib/.gitignore
|
||||
pylablib/.pylintdict
|
||||
pylablib/.pylintrc
|
||||
pylablib/.readthedocs.yaml
|
||||
pylablib/build_distrib.py
|
||||
pylablib/LICENSE
|
||||
pylablib/MANIFEST.in
|
||||
pylablib/README.md
|
||||
pylablib/setup.py
|
||||
pylablib/tox.ini
|
||||
pylablib/Andor/__init__.py
|
||||
pylablib/Andor/AndorSDK2.py
|
||||
pylablib/Andor/AndorSDK3.py
|
||||
pylablib/Andor/atcore_defs.py
|
||||
pylablib/Andor/atcore_features.py
|
||||
pylablib/Andor/atcore_lib.py
|
||||
pylablib/Andor/atmcd32d_defs.py
|
||||
pylablib/Andor/atmcd32d_lib.py
|
||||
pylablib/Andor/base.py
|
||||
pylablib/Andor/Shamrock.py
|
||||
pylablib/Andor/ShamrockCIF_defs.py
|
||||
pylablib/Andor/ShamrockCIF_lib.py
|
||||
pylablib/Andor/utils.c
|
||||
pylablib/Andor/utils.pyx
|
||||
pylablib/docs/.autodoc_ignore
|
||||
pylablib/docs/.skipped_apidoc
|
||||
pylablib/docs/.sphinxdict
|
||||
pylablib/docs/apidoc_noautogen.py
|
||||
pylablib/docs/changelog.rst
|
||||
pylablib/docs/conf.py
|
||||
pylablib/docs/dataproc.rst
|
||||
pylablib/docs/index.rst
|
||||
pylablib/docs/install.rst
|
||||
pylablib/docs/make-sphinx.py
|
||||
pylablib/docs/misc_utils.rst
|
||||
pylablib/docs/requirements-rtd.txt
|
||||
pylablib/docs/storage.rst
|
||||
pylablib/docs/.apidoc/modules.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.dataproc.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.devio.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.fileio.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.gui.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.gui.widgets.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.thread.rst
|
||||
pylablib/docs/.apidoc/pylablib.core.utils.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Agilent.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.AlliedVision.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Andor.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Arcus.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Arduino.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Attocube.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.AWG.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Basler.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.BitFlow.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Conrad.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Cryocon.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Cryomagnetics.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.DCAM.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.ElektroAutomatik.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.HighFinesse.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Hubner.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.IMAQ.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.IMAQdx.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.interface.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Keithley.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.KJL.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Lakeshore.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.LaserQuantum.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Leybold.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.LighthousePhotonics.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Lumel.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.M2.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Mightex.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Modbus.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Newport.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.NI.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.NKT.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Omron.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Ophir.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.OZOptics.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.PCO.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Pfeiffer.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Photometrics.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.PhotonFocus.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.PhysikInstrumente.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.PrincetonInstruments.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Rigol.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.SiliconSoftware.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Sirah.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.SmarAct.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Standa.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Tektronix.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Thorlabs.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Toptica.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Trinamic.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.uc480.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.utils.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Voltcraft.rst
|
||||
pylablib/docs/.apidoc/pylablib.devices.Windows.rst
|
||||
pylablib/docs/.apidoc/pylablib.rst
|
||||
pylablib/docs/devices/Agilent.rst
|
||||
pylablib/docs/devices/all_devices_list.txt
|
||||
pylablib/docs/devices/AlliedVision.rst
|
||||
pylablib/docs/devices/Andor.rst
|
||||
pylablib/docs/devices/AndorShamrock.rst
|
||||
pylablib/docs/devices/Arcus_performax.rst
|
||||
pylablib/docs/devices/Attocube.rst
|
||||
pylablib/docs/devices/basic_lasers.rst
|
||||
pylablib/docs/devices/basic_sensors_basics.rst
|
||||
pylablib/docs/devices/basic_sensors_list.txt
|
||||
pylablib/docs/devices/basic_sensors_root.rst
|
||||
pylablib/docs/devices/Basler.rst
|
||||
pylablib/docs/devices/BitFlow.rst
|
||||
pylablib/docs/devices/cameras_basics.rst
|
||||
pylablib/docs/devices/cameras_list.txt
|
||||
pylablib/docs/devices/cameras_root.rst
|
||||
pylablib/docs/devices/Cryocon.rst
|
||||
pylablib/docs/devices/Cryomagnetics.rst
|
||||
pylablib/docs/devices/DCAM.rst
|
||||
pylablib/docs/devices/devices_basics.rst
|
||||
pylablib/docs/devices/devices_root.rst
|
||||
pylablib/docs/devices/ElektroAutomatik.rst
|
||||
pylablib/docs/devices/generic_awgs.rst
|
||||
pylablib/docs/devices/HighFinesse.rst
|
||||
pylablib/docs/devices/Hubner.rst
|
||||
pylablib/docs/devices/IMAQ.rst
|
||||
pylablib/docs/devices/IMAQdx.rst
|
||||
pylablib/docs/devices/Keithley.rst
|
||||
pylablib/docs/devices/KJL.rst
|
||||
pylablib/docs/devices/Lakeshore.rst
|
||||
pylablib/docs/devices/Leybold.rst
|
||||
pylablib/docs/devices/Lumel.rst
|
||||
pylablib/docs/devices/M2.rst
|
||||
pylablib/docs/devices/Mightex.rst
|
||||
pylablib/docs/devices/misc_devices.rst
|
||||
pylablib/docs/devices/Newport_picomotor.rst
|
||||
pylablib/docs/devices/nidaq.rst
|
||||
pylablib/docs/devices/NKT.rst
|
||||
pylablib/docs/devices/Omron.rst
|
||||
pylablib/docs/devices/Ophir.rst
|
||||
pylablib/docs/devices/OZOptics.rst
|
||||
pylablib/docs/devices/PCO_SC2.rst
|
||||
pylablib/docs/devices/Pfeiffer.rst
|
||||
pylablib/docs/devices/PhotonFocus.rst
|
||||
pylablib/docs/devices/PhysikInstrumente.rst
|
||||
pylablib/docs/devices/Picam.rst
|
||||
pylablib/docs/devices/protocols.rst
|
||||
pylablib/docs/devices/Pvcam.rst
|
||||
pylablib/docs/devices/Rigol.rst
|
||||
pylablib/docs/devices/SiliconSoftware.rst
|
||||
pylablib/docs/devices/Sirah.rst
|
||||
pylablib/docs/devices/SmarAct.rst
|
||||
pylablib/docs/devices/stages_basics.rst
|
||||
pylablib/docs/devices/stages_list.txt
|
||||
pylablib/docs/devices/stages_root.rst
|
||||
pylablib/docs/devices/Standa.rst
|
||||
pylablib/docs/devices/Tektronix.rst
|
||||
pylablib/docs/devices/Thorlabs_elliptec.rst
|
||||
pylablib/docs/devices/Thorlabs_kinesis.rst
|
||||
pylablib/docs/devices/Thorlabs_misc.rst
|
||||
pylablib/docs/devices/Thorlabs_pm.rst
|
||||
pylablib/docs/devices/Thorlabs_TLCamera.rst
|
||||
pylablib/docs/devices/Toptica.rst
|
||||
pylablib/docs/devices/Trinamic.rst
|
||||
pylablib/docs/devices/uc480.rst
|
||||
pylablib/docs/devices/Voltcraft.rst
|
||||
pylablib/docs/devices/Windows.rst
|
||||
pylablib/pylablib/__init__.py
|
||||
pylablib/pylablib/__main__.py
|
||||
pylablib/pylablib/aux_libs.py
|
||||
pylablib/pylablib/widgets.py
|
||||
pylablib/pylablib/core/__init__.py
|
||||
pylablib/pylablib/core/dataproc/__export__.py
|
||||
pylablib/pylablib/core/dataproc/__init__.py
|
||||
pylablib/pylablib/core/dataproc/callable.py
|
||||
pylablib/pylablib/core/dataproc/ctransform_fallback.py
|
||||
pylablib/pylablib/core/dataproc/ctransform.c
|
||||
pylablib/pylablib/core/dataproc/ctransform.pyx
|
||||
pylablib/pylablib/core/dataproc/feature.py
|
||||
pylablib/pylablib/core/dataproc/filters.py
|
||||
pylablib/pylablib/core/dataproc/fitting.py
|
||||
pylablib/pylablib/core/dataproc/fourier.py
|
||||
pylablib/pylablib/core/dataproc/iir_transform.py
|
||||
pylablib/pylablib/core/dataproc/image.py
|
||||
pylablib/pylablib/core/dataproc/interpolate.py
|
||||
pylablib/pylablib/core/dataproc/specfunc.py
|
||||
pylablib/pylablib/core/dataproc/table_wrap.py
|
||||
pylablib/pylablib/core/dataproc/transform.py
|
||||
pylablib/pylablib/core/dataproc/utils.py
|
||||
pylablib/pylablib/core/devio/__export__.py
|
||||
pylablib/pylablib/core/devio/__init__.py
|
||||
pylablib/pylablib/core/devio/backend_logger.py
|
||||
pylablib/pylablib/core/devio/base.py
|
||||
pylablib/pylablib/core/devio/comm_backend.py
|
||||
pylablib/pylablib/core/devio/data_format.py
|
||||
pylablib/pylablib/core/devio/hid_base.py
|
||||
pylablib/pylablib/core/devio/hid_lib.py
|
||||
pylablib/pylablib/core/devio/hid.py
|
||||
pylablib/pylablib/core/devio/interface.py
|
||||
pylablib/pylablib/core/devio/SCPI.py
|
||||
pylablib/pylablib/core/fileio/__export__.py
|
||||
pylablib/pylablib/core/fileio/__init__.py
|
||||
pylablib/pylablib/core/fileio/bin_transform.py
|
||||
pylablib/pylablib/core/fileio/datafile.py
|
||||
pylablib/pylablib/core/fileio/dict_entry.py
|
||||
pylablib/pylablib/core/fileio/loadfile_utils.py
|
||||
pylablib/pylablib/core/fileio/loadfile.py
|
||||
pylablib/pylablib/core/fileio/location.py
|
||||
pylablib/pylablib/core/fileio/parse_csv.py
|
||||
pylablib/pylablib/core/fileio/savefile.py
|
||||
pylablib/pylablib/core/fileio/table_stream.py
|
||||
pylablib/pylablib/core/gui/__export__.py
|
||||
pylablib/pylablib/core/gui/__init__.py
|
||||
pylablib/pylablib/core/gui/formatter.py
|
||||
pylablib/pylablib/core/gui/limiter.py
|
||||
pylablib/pylablib/core/gui/utils.py
|
||||
pylablib/pylablib/core/gui/value_handling.py
|
||||
pylablib/pylablib/core/gui/widgets/__export__.py
|
||||
pylablib/pylablib/core/gui/widgets/__init__.py
|
||||
pylablib/pylablib/core/gui/widgets/button_selector.py
|
||||
pylablib/pylablib/core/gui/widgets/button.py
|
||||
pylablib/pylablib/core/gui/widgets/combo_box.py
|
||||
pylablib/pylablib/core/gui/widgets/container.py
|
||||
pylablib/pylablib/core/gui/widgets/edit.py
|
||||
pylablib/pylablib/core/gui/widgets/label.py
|
||||
pylablib/pylablib/core/gui/widgets/layout_manager.py
|
||||
pylablib/pylablib/core/gui/widgets/param_table.py
|
||||
pylablib/pylablib/core/thread/__export__.py
|
||||
pylablib/pylablib/core/thread/__init__.py
|
||||
pylablib/pylablib/core/thread/callsync.py
|
||||
pylablib/pylablib/core/thread/controller.py
|
||||
pylablib/pylablib/core/thread/multicast_pool.py
|
||||
pylablib/pylablib/core/thread/notifier.py
|
||||
pylablib/pylablib/core/thread/profile.py
|
||||
pylablib/pylablib/core/thread/synchronizing.py
|
||||
pylablib/pylablib/core/thread/threadprop.py
|
||||
pylablib/pylablib/core/thread/utils.py
|
||||
pylablib/pylablib/core/utils/__export__.py
|
||||
pylablib/pylablib/core/utils/__init__.py
|
||||
pylablib/pylablib/core/utils/array_utils.py
|
||||
pylablib/pylablib/core/utils/cext_tools.py
|
||||
pylablib/pylablib/core/utils/crc.py
|
||||
pylablib/pylablib/core/utils/ctypes_tools.py
|
||||
pylablib/pylablib/core/utils/ctypes_wrap.py
|
||||
pylablib/pylablib/core/utils/dictionary.py
|
||||
pylablib/pylablib/core/utils/files.py
|
||||
pylablib/pylablib/core/utils/funcargparse.py
|
||||
pylablib/pylablib/core/utils/functions.py
|
||||
pylablib/pylablib/core/utils/general.py
|
||||
pylablib/pylablib/core/utils/indexing.py
|
||||
pylablib/pylablib/core/utils/ipc.py
|
||||
pylablib/pylablib/core/utils/library_parameters.py
|
||||
pylablib/pylablib/core/utils/module.py
|
||||
pylablib/pylablib/core/utils/nbtools.py
|
||||
pylablib/pylablib/core/utils/net.py
|
||||
pylablib/pylablib/core/utils/numerical.py
|
||||
pylablib/pylablib/core/utils/observer_pool.py
|
||||
pylablib/pylablib/core/utils/py3.py
|
||||
pylablib/pylablib/core/utils/rpyc_utils.py
|
||||
pylablib/pylablib/core/utils/strdump.py
|
||||
pylablib/pylablib/core/utils/string.py
|
||||
pylablib/pylablib/core/utils/strpack.py
|
||||
pylablib/pylablib/core/utils/units.py
|
||||
pylablib/pylablib/devices/__init__.py
|
||||
pylablib/pylablib/devices/AWG/__init__.py
|
||||
pylablib/pylablib/devices/AWG/generic.py
|
||||
pylablib/pylablib/devices/AWG/specific.py
|
||||
pylablib/pylablib/devices/Agilent/__init__.py
|
||||
pylablib/pylablib/devices/Agilent/base.py
|
||||
pylablib/pylablib/devices/Agilent/pressure.py
|
||||
pylablib/pylablib/devices/Agilent/vna.py
|
||||
pylablib/pylablib/devices/AlliedVision/__init__.py
|
||||
pylablib/pylablib/devices/AlliedVision/Bonito.py
|
||||
pylablib/pylablib/devices/Andor/__init__.py
|
||||
pylablib/pylablib/devices/Andor/AndorSDK2.py
|
||||
pylablib/pylablib/devices/Andor/AndorSDK3.py
|
||||
pylablib/pylablib/devices/Andor/atcore_defs.py
|
||||
pylablib/pylablib/devices/Andor/atcore_features.py
|
||||
pylablib/pylablib/devices/Andor/atcore_lib.py
|
||||
pylablib/pylablib/devices/Andor/atmcd32d_defs.py
|
||||
pylablib/pylablib/devices/Andor/atmcd32d_lib.py
|
||||
pylablib/pylablib/devices/Andor/base.py
|
||||
pylablib/pylablib/devices/Andor/Shamrock.py
|
||||
pylablib/pylablib/devices/Andor/ShamrockCIF_defs.py
|
||||
pylablib/pylablib/devices/Andor/ShamrockCIF_lib.py
|
||||
pylablib/pylablib/devices/Andor/utils.c
|
||||
pylablib/pylablib/devices/Andor/utils.pyx
|
||||
pylablib/pylablib/devices/Arcus/__init__.py
|
||||
pylablib/pylablib/devices/Arcus/ArcusPerformaxDriver_defs.py
|
||||
pylablib/pylablib/devices/Arcus/ArcusPerformaxDriver_lib.py
|
||||
pylablib/pylablib/devices/Arcus/base.py
|
||||
pylablib/pylablib/devices/Arcus/performax.py
|
||||
pylablib/pylablib/devices/Arduino/__init__.py
|
||||
pylablib/pylablib/devices/Arduino/base.py
|
||||
pylablib/pylablib/devices/Attocube/__init__.py
|
||||
pylablib/pylablib/devices/Attocube/anc300.py
|
||||
pylablib/pylablib/devices/Attocube/anc350.py
|
||||
pylablib/pylablib/devices/Attocube/base.py
|
||||
pylablib/pylablib/devices/Basler/__init__.py
|
||||
pylablib/pylablib/devices/Basler/pylon.py
|
||||
pylablib/pylablib/devices/Basler/pylonC_defs.py
|
||||
pylablib/pylablib/devices/Basler/pylonC_lib.py
|
||||
pylablib/pylablib/devices/Basler/utils.c
|
||||
pylablib/pylablib/devices/Basler/utils.pyx
|
||||
pylablib/pylablib/devices/BitFlow/__init__.py
|
||||
pylablib/pylablib/devices/BitFlow/BitFlow.py
|
||||
pylablib/pylablib/devices/Conrad/__init__.py
|
||||
pylablib/pylablib/devices/Conrad/base.py
|
||||
pylablib/pylablib/devices/Cryocon/__init__.py
|
||||
pylablib/pylablib/devices/Cryocon/base.py
|
||||
pylablib/pylablib/devices/Cryomagnetics/__init__.py
|
||||
pylablib/pylablib/devices/Cryomagnetics/base.py
|
||||
pylablib/pylablib/devices/DCAM/__init__.py
|
||||
pylablib/pylablib/devices/DCAM/DCAM.py
|
||||
pylablib/pylablib/devices/DCAM/dcamapi4_defs.py
|
||||
pylablib/pylablib/devices/DCAM/dcamapi4_lib.py
|
||||
pylablib/pylablib/devices/DCAM/dcamprop_defs.py
|
||||
pylablib/pylablib/devices/ElektroAutomatik/__init__.py
|
||||
pylablib/pylablib/devices/ElektroAutomatik/base.py
|
||||
pylablib/pylablib/devices/HighFinesse/__init__.py
|
||||
pylablib/pylablib/devices/HighFinesse/wlm.py
|
||||
pylablib/pylablib/devices/HighFinesse/wlmData_defs.py
|
||||
pylablib/pylablib/devices/HighFinesse/wlmData_lib.py
|
||||
pylablib/pylablib/devices/Hubner/__init__.py
|
||||
pylablib/pylablib/devices/Hubner/base.py
|
||||
pylablib/pylablib/devices/Hubner/Cobolt.py
|
||||
pylablib/pylablib/devices/IMAQ/__init__.py
|
||||
pylablib/pylablib/devices/IMAQ/IMAQ.py
|
||||
pylablib/pylablib/devices/IMAQ/niimaq_attrtypes.py
|
||||
pylablib/pylablib/devices/IMAQ/niimaq_defs.py
|
||||
pylablib/pylablib/devices/IMAQ/niimaq_lib.py
|
||||
pylablib/pylablib/devices/IMAQdx/__init__.py
|
||||
pylablib/pylablib/devices/IMAQdx/IMAQdx.py
|
||||
pylablib/pylablib/devices/IMAQdx/NIIMAQdx_defs.py
|
||||
pylablib/pylablib/devices/IMAQdx/NIIMAQdx_lib.py
|
||||
pylablib/pylablib/devices/IMAQdx/nivision_defs.py
|
||||
pylablib/pylablib/devices/IMAQdx/utils.c
|
||||
pylablib/pylablib/devices/IMAQdx/utils.pyx
|
||||
pylablib/pylablib/devices/KJL/__init__.py
|
||||
pylablib/pylablib/devices/KJL/base.py
|
||||
pylablib/pylablib/devices/Keithley/__init__.py
|
||||
pylablib/pylablib/devices/Keithley/base.py
|
||||
pylablib/pylablib/devices/Keithley/multimeter.py
|
||||
pylablib/pylablib/devices/Lakeshore/__init__.py
|
||||
pylablib/pylablib/devices/Lakeshore/base.py
|
||||
pylablib/pylablib/devices/LaserQuantum/__init__.py
|
||||
pylablib/pylablib/devices/LaserQuantum/base.py
|
||||
pylablib/pylablib/devices/Leybold/__init__.py
|
||||
pylablib/pylablib/devices/Leybold/base.py
|
||||
pylablib/pylablib/devices/LighthousePhotonics/__init__.py
|
||||
pylablib/pylablib/devices/LighthousePhotonics/base.py
|
||||
pylablib/pylablib/devices/Lumel/__init__.py
|
||||
pylablib/pylablib/devices/Lumel/base.py
|
||||
pylablib/pylablib/devices/M2/__init__.py
|
||||
pylablib/pylablib/devices/M2/base.py
|
||||
pylablib/pylablib/devices/M2/emm.py
|
||||
pylablib/pylablib/devices/M2/solstis.py
|
||||
pylablib/pylablib/devices/Mightex/__init__.py
|
||||
pylablib/pylablib/devices/Mightex/base.py
|
||||
pylablib/pylablib/devices/Mightex/MightexSSeries.py
|
||||
pylablib/pylablib/devices/Mightex/NewClassic_USBCamera_SDK_defs.py
|
||||
pylablib/pylablib/devices/Mightex/NewClassic_USBCamera_SDK_lib.py
|
||||
pylablib/pylablib/devices/Modbus/__init__.py
|
||||
pylablib/pylablib/devices/Modbus/modbus.py
|
||||
pylablib/pylablib/devices/NI/__init__.py
|
||||
pylablib/pylablib/devices/NI/daq.py
|
||||
pylablib/pylablib/devices/NKT/__init__.py
|
||||
pylablib/pylablib/devices/NKT/interbus.py
|
||||
pylablib/pylablib/devices/Newport/__init__.py
|
||||
pylablib/pylablib/devices/Newport/base.py
|
||||
pylablib/pylablib/devices/Newport/picomotor.py
|
||||
pylablib/pylablib/devices/OZOptics/__init__.py
|
||||
pylablib/pylablib/devices/OZOptics/base.py
|
||||
pylablib/pylablib/devices/Omron/__init__.py
|
||||
pylablib/pylablib/devices/Omron/base.py
|
||||
pylablib/pylablib/devices/Ophir/__init__.py
|
||||
pylablib/pylablib/devices/Ophir/base.py
|
||||
pylablib/pylablib/devices/PCO/__init__.py
|
||||
pylablib/pylablib/devices/PCO/PCO_err_defs.py
|
||||
pylablib/pylablib/devices/PCO/sc2_camexport_defs.py
|
||||
pylablib/pylablib/devices/PCO/sc2_camexport_lib.py
|
||||
pylablib/pylablib/devices/PCO/sc2_defs_defs.py
|
||||
pylablib/pylablib/devices/PCO/sc2_sdkstructures_defs.py
|
||||
pylablib/pylablib/devices/PCO/SC2.py
|
||||
pylablib/pylablib/devices/PCO/utils.c
|
||||
pylablib/pylablib/devices/PCO/utils.pyx
|
||||
pylablib/pylablib/devices/Pfeiffer/__init__.py
|
||||
pylablib/pylablib/devices/Pfeiffer/base.py
|
||||
pylablib/pylablib/devices/Photometrics/__init__.py
|
||||
pylablib/pylablib/devices/Photometrics/pvcam_defs.py
|
||||
pylablib/pylablib/devices/Photometrics/pvcam_lib.py
|
||||
pylablib/pylablib/devices/Photometrics/pvcam.py
|
||||
pylablib/pylablib/devices/PhotonFocus/__init__.py
|
||||
pylablib/pylablib/devices/PhotonFocus/pfcam_defs.py
|
||||
pylablib/pylablib/devices/PhotonFocus/pfcam_lib.py
|
||||
pylablib/pylablib/devices/PhotonFocus/PhotonFocus.py
|
||||
pylablib/pylablib/devices/PhysikInstrumente/__init__.py
|
||||
pylablib/pylablib/devices/PhysikInstrumente/base.py
|
||||
pylablib/pylablib/devices/PrincetonInstruments/__init__.py
|
||||
pylablib/pylablib/devices/PrincetonInstruments/picam_defs.py
|
||||
pylablib/pylablib/devices/PrincetonInstruments/picam_lib.py
|
||||
pylablib/pylablib/devices/PrincetonInstruments/picam.py
|
||||
pylablib/pylablib/devices/Rigol/__init__.py
|
||||
pylablib/pylablib/devices/Rigol/base.py
|
||||
pylablib/pylablib/devices/Rigol/power_supply.py
|
||||
pylablib/pylablib/devices/SiliconSoftware/__init__.py
|
||||
pylablib/pylablib/devices/SiliconSoftware/fgrab_define_defs.py
|
||||
pylablib/pylablib/devices/SiliconSoftware/fgrab_prototyp_defs.py
|
||||
pylablib/pylablib/devices/SiliconSoftware/fgrab_prototyp_lib.py
|
||||
pylablib/pylablib/devices/SiliconSoftware/fgrab.py
|
||||
pylablib/pylablib/devices/SiliconSoftware/utils.c
|
||||
pylablib/pylablib/devices/SiliconSoftware/utils.pyx
|
||||
pylablib/pylablib/devices/Sirah/__init__.py
|
||||
pylablib/pylablib/devices/Sirah/base.py
|
||||
pylablib/pylablib/devices/Sirah/Matisse.py
|
||||
pylablib/pylablib/devices/Sirah/tuner.py
|
||||
pylablib/pylablib/devices/SmarAct/__init__.py
|
||||
pylablib/pylablib/devices/SmarAct/base.py
|
||||
pylablib/pylablib/devices/SmarAct/MCS2.py
|
||||
pylablib/pylablib/devices/SmarAct/scu3d.py
|
||||
pylablib/pylablib/devices/SmarAct/SCU3DControl_defs.py
|
||||
pylablib/pylablib/devices/SmarAct/SCU3DControl_lib.py
|
||||
pylablib/pylablib/devices/SmarAct/SmarActControl_defs.py
|
||||
pylablib/pylablib/devices/SmarAct/SmarActControl_lib.py
|
||||
pylablib/pylablib/devices/Standa/__init__.py
|
||||
pylablib/pylablib/devices/Standa/base.py
|
||||
pylablib/pylablib/devices/Tektronix/__init__.py
|
||||
pylablib/pylablib/devices/Tektronix/base.py
|
||||
pylablib/pylablib/devices/Thorlabs/__init__.py
|
||||
pylablib/pylablib/devices/Thorlabs/base.py
|
||||
pylablib/pylablib/devices/Thorlabs/elliptec.py
|
||||
pylablib/pylablib/devices/Thorlabs/kinesis.py
|
||||
pylablib/pylablib/devices/Thorlabs/misc.py
|
||||
pylablib/pylablib/devices/Thorlabs/serial.py
|
||||
pylablib/pylablib/devices/Thorlabs/tl_camera_sdk_defs.py
|
||||
pylablib/pylablib/devices/Thorlabs/tl_camera_sdk_lib.py
|
||||
pylablib/pylablib/devices/Thorlabs/TLCamera.py
|
||||
pylablib/pylablib/devices/Toptica/__init__.py
|
||||
pylablib/pylablib/devices/Toptica/base.py
|
||||
pylablib/pylablib/devices/Toptica/ibeam.py
|
||||
pylablib/pylablib/devices/Trinamic/__init__.py
|
||||
pylablib/pylablib/devices/Trinamic/base.py
|
||||
pylablib/pylablib/devices/Voltcraft/__init__.py
|
||||
pylablib/pylablib/devices/Voltcraft/base.py
|
||||
pylablib/pylablib/devices/Voltcraft/multimeter.py
|
||||
pylablib/pylablib/devices/Windows/__init__.py
|
||||
pylablib/pylablib/devices/Windows/joystick.py
|
||||
pylablib/pylablib/devices/Windows/winmm_lib.py
|
||||
pylablib/pylablib/devices/interface/__init__.py
|
||||
pylablib/pylablib/devices/interface/camera.py
|
||||
pylablib/pylablib/devices/interface/stage.py
|
||||
pylablib/pylablib/devices/uc480/__init__.py
|
||||
pylablib/pylablib/devices/uc480/uc480_defs.py
|
||||
pylablib/pylablib/devices/uc480/uc480_lib.py
|
||||
pylablib/pylablib/devices/uc480/uc480.py
|
||||
pylablib/pylablib/devices/utils/__init__.py
|
||||
pylablib/pylablib/devices/utils/color.py
|
||||
pylablib/pylablib/devices/utils/load_lib.py
|
||||
pylablib/pylablib/gui/__init__.py
|
||||
pylablib/pylablib/gui/widgets/__export__.py
|
||||
pylablib/pylablib/gui/widgets/__init__.py
|
||||
pylablib/pylablib/gui/widgets/highlighter.py
|
||||
pylablib/pylablib/gui/widgets/range_controls.py
|
||||
pylablib/pylablib/gui/widgets/plotters/__init__.py
|
||||
pylablib/pylablib/gui/widgets/plotters/image_plotter.py
|
||||
pylablib/pylablib/gui/widgets/plotters/line_plotter.py
|
||||
pylablib/pylablib/gui/widgets/plotters/mpl_plotter.py
|
||||
pylablib/pylablib/gui/widgets/plotters/trace_plotter.py
|
||||
pylablib/pylablib/legacy/__init__.py
|
||||
pylablib/pylablib/legacy/deploy.py
|
||||
pylablib/pylablib/legacy/aux_libs/__init__.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/__init__.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/AgilentElectronics.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/AgilentLasers.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Andor_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Andor.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/AndorSDK3_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/AndorShamrock_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/AndorShamrock.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Arcus.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Arduino.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Attocube.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Cryomagnetics.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/DCAM_lib_const.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/DCAM_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/DCAM.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/device_manager.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/HighFinesse.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/IMAQ_lib_const.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/IMAQ_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/IMAQ.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/IMAQdx_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/IMAQdx.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/interfaces.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Lakeshore.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/LaserQuantum.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/LighthousePhotonics.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/M2.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/misc.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/MKS.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/NI.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/NuPhoton.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Ophir.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/OZOptics.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/PCO_SC2_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/PCO_SC2.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/pfcam_lib.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Pfeiffer.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/PhotonFocus.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/PurePhotonics.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Rigol.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Sirah.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/SmarAct.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Tektronix.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Thorlabs.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Trinamic.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/Vaunix.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/ZurichInstruments.py
|
||||
pylablib/pylablib/legacy/aux_libs/devices/libs/x32/place-32-bit-dlls-here.txt
|
||||
pylablib/pylablib/legacy/aux_libs/devices/libs/x64/place-64-bit-dlls-here.txt
|
||||
pylablib/pylablib/legacy/aux_libs/file_formats/__init__.py
|
||||
pylablib/pylablib/legacy/aux_libs/file_formats/cam.py
|
||||
pylablib/pylablib/legacy/aux_libs/file_formats/ecam.py
|
||||
pylablib/pylablib/legacy/aux_libs/file_formats/waveguide.py
|
||||
pylablib/pylablib/legacy/aux_libs/file_formats/zi.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/__init__.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/device_thread.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/gui_contoller.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/helpers.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/script_thread.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/widgets/__init__.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/widgets/custom_controls.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/widgets/image_plotter.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/widgets/line_plotter.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/widgets/param_table.py
|
||||
pylablib/pylablib/legacy/aux_libs/gui/widgets/trace_plotter.py
|
||||
pylablib/pylablib/legacy/core/__init__.py
|
||||
pylablib/pylablib/legacy/core/version.py
|
||||
pylablib/pylablib/legacy/core/dataproc/__init__.py
|
||||
pylablib/pylablib/legacy/core/dataproc/callable.py
|
||||
pylablib/pylablib/legacy/core/dataproc/feature.py
|
||||
pylablib/pylablib/legacy/core/dataproc/filters.py
|
||||
pylablib/pylablib/legacy/core/dataproc/fitting.py
|
||||
pylablib/pylablib/legacy/core/dataproc/fourier.py
|
||||
pylablib/pylablib/legacy/core/dataproc/iir_transform.py
|
||||
pylablib/pylablib/legacy/core/dataproc/image.py
|
||||
pylablib/pylablib/legacy/core/dataproc/interpolate.py
|
||||
pylablib/pylablib/legacy/core/dataproc/specfunc.py
|
||||
pylablib/pylablib/legacy/core/dataproc/waveforms.py
|
||||
pylablib/pylablib/legacy/core/datatable/__init__.py
|
||||
pylablib/pylablib/legacy/core/datatable/column.py
|
||||
pylablib/pylablib/legacy/core/datatable/datatable_utils.py
|
||||
pylablib/pylablib/legacy/core/datatable/indexing.py
|
||||
pylablib/pylablib/legacy/core/datatable/table_storage.py
|
||||
pylablib/pylablib/legacy/core/datatable/table.py
|
||||
pylablib/pylablib/legacy/core/datatable/wrapping.py
|
||||
pylablib/pylablib/legacy/core/devio/__init__.py
|
||||
pylablib/pylablib/legacy/core/devio/backend.py
|
||||
pylablib/pylablib/legacy/core/devio/data_format.py
|
||||
pylablib/pylablib/legacy/core/devio/interface.py
|
||||
pylablib/pylablib/legacy/core/devio/SCPI.py
|
||||
pylablib/pylablib/legacy/core/devio/units.py
|
||||
pylablib/pylablib/legacy/core/fileio/__init__.py
|
||||
pylablib/pylablib/legacy/core/fileio/binio.py
|
||||
pylablib/pylablib/legacy/core/fileio/datafile.py
|
||||
pylablib/pylablib/legacy/core/fileio/dict_entry.py
|
||||
pylablib/pylablib/legacy/core/fileio/loadfile.py
|
||||
pylablib/pylablib/legacy/core/fileio/location.py
|
||||
pylablib/pylablib/legacy/core/fileio/logfile.py
|
||||
pylablib/pylablib/legacy/core/fileio/parse_csv.py
|
||||
pylablib/pylablib/legacy/core/fileio/savefile.py
|
||||
pylablib/pylablib/legacy/core/gui/__init__.py
|
||||
pylablib/pylablib/legacy/core/gui/format.py
|
||||
pylablib/pylablib/legacy/core/gui/limit.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/__init__.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/utils.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/values.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/thread/__init__.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/thread/callsync.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/thread/controller.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/thread/mthread.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/thread/signal_pool.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/thread/synchronizing.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/thread/threadprop.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/widgets/__init__.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/widgets/edit.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/widgets/label.py
|
||||
pylablib/pylablib/legacy/core/gui/qt/widgets/plot.py
|
||||
pylablib/pylablib/legacy/core/mthread/__init__.py
|
||||
pylablib/pylablib/legacy/core/mthread/controller.py
|
||||
pylablib/pylablib/legacy/core/mthread/message_queue.py
|
||||
pylablib/pylablib/legacy/core/mthread/message.py
|
||||
pylablib/pylablib/legacy/core/mthread/notifier.py
|
||||
pylablib/pylablib/legacy/core/mthread/sync_primitives.py
|
||||
pylablib/pylablib/legacy/core/mthread/tag_queue.py
|
||||
pylablib/pylablib/legacy/core/mthread/threadprop.py
|
||||
pylablib/pylablib/legacy/core/utils/__init__.py
|
||||
pylablib/pylablib/legacy/core/utils/ctypes_wrap.py
|
||||
pylablib/pylablib/legacy/core/utils/dictionary.py
|
||||
pylablib/pylablib/legacy/core/utils/files.py
|
||||
pylablib/pylablib/legacy/core/utils/funcargparse.py
|
||||
pylablib/pylablib/legacy/core/utils/functions.py
|
||||
pylablib/pylablib/legacy/core/utils/general.py
|
||||
pylablib/pylablib/legacy/core/utils/ipc.py
|
||||
pylablib/pylablib/legacy/core/utils/iterator.py
|
||||
pylablib/pylablib/legacy/core/utils/library_parameters.py
|
||||
pylablib/pylablib/legacy/core/utils/log.py
|
||||
pylablib/pylablib/legacy/core/utils/module.py
|
||||
pylablib/pylablib/legacy/core/utils/net.py
|
||||
pylablib/pylablib/legacy/core/utils/numclass.py
|
||||
pylablib/pylablib/legacy/core/utils/numerical.py
|
||||
pylablib/pylablib/legacy/core/utils/observer_pool.py
|
||||
pylablib/pylablib/legacy/core/utils/plotting.py
|
||||
pylablib/pylablib/legacy/core/utils/pstorage.py
|
||||
pylablib/pylablib/legacy/core/utils/py3.py
|
||||
pylablib/pylablib/legacy/core/utils/rpyc.py
|
||||
pylablib/pylablib/legacy/core/utils/serializable.py
|
||||
pylablib/pylablib/legacy/core/utils/strdump.py
|
||||
pylablib/pylablib/legacy/core/utils/string.py
|
||||
pylablib/pylablib/legacy/core/utils/strpack.py
|
||||
pylablib/pylablib/legacy/core/utils/thread.py
|
||||
pylablib/pylablib/legacy/core/utils/versioning.py
|
||||
pylablib/pylablib/misc/__init__.py
|
||||
pylablib/pylablib/misc/file_formats/__init__.py
|
||||
pylablib/pylablib/misc/file_formats/cam.py
|
||||
pylablib/pylablib/thread/__init__.py
|
||||
pylablib/pylablib/thread/device_thread.py
|
||||
pylablib/pylablib/thread/script_thread.py
|
||||
pylablib/pylablib/thread/settings_manager.py
|
||||
pylablib/pylablib/thread/devices/__init__.py
|
||||
pylablib/pylablib/thread/devices/Agilent/__init__.py
|
||||
pylablib/pylablib/thread/devices/Agilent/pressure.py
|
||||
pylablib/pylablib/thread/devices/AlliedVision/__init__.py
|
||||
pylablib/pylablib/thread/devices/AlliedVision/Bonito.py
|
||||
pylablib/pylablib/thread/devices/Andor/__init__.py
|
||||
pylablib/pylablib/thread/devices/Andor/AndorSDK3.py
|
||||
pylablib/pylablib/thread/devices/Andor/AndorSKD2.py
|
||||
pylablib/pylablib/thread/devices/Andor/Shamrock.py
|
||||
pylablib/pylablib/thread/devices/Arcus/__init__.py
|
||||
pylablib/pylablib/thread/devices/Arcus/performax.py
|
||||
pylablib/pylablib/thread/devices/Attocube/__init__.py
|
||||
pylablib/pylablib/thread/devices/Attocube/anc300.py
|
||||
pylablib/pylablib/thread/devices/Attocube/anc350.py
|
||||
pylablib/pylablib/thread/devices/Basler/__init__.py
|
||||
pylablib/pylablib/thread/devices/Basler/pylon.py
|
||||
pylablib/pylablib/thread/devices/Cryocon/__init__.py
|
||||
pylablib/pylablib/thread/devices/Cryocon/base.py
|
||||
pylablib/pylablib/thread/devices/DCAM/__init__.py
|
||||
pylablib/pylablib/thread/devices/DCAM/DCAM.py
|
||||
pylablib/pylablib/thread/devices/ElektroAutomatik/__init__.py
|
||||
pylablib/pylablib/thread/devices/ElektroAutomatik/base.py
|
||||
pylablib/pylablib/thread/devices/HighFinesse/__init__.py
|
||||
pylablib/pylablib/thread/devices/HighFinesse/wlm.py
|
||||
pylablib/pylablib/thread/devices/Hubner/__init__.py
|
||||
pylablib/pylablib/thread/devices/Hubner/Cobolt.py
|
||||
pylablib/pylablib/thread/devices/IMAQdx/__init__.py
|
||||
pylablib/pylablib/thread/devices/IMAQdx/IMAQdx.py
|
||||
pylablib/pylablib/thread/devices/KJL/__init__.py
|
||||
pylablib/pylablib/thread/devices/KJL/base.py
|
||||
pylablib/pylablib/thread/devices/Keithley/__init__.py
|
||||
pylablib/pylablib/thread/devices/Keithley/multimeter.py
|
||||
pylablib/pylablib/thread/devices/Lakeshore/__init__.py
|
||||
pylablib/pylablib/thread/devices/Lakeshore/base.py
|
||||
pylablib/pylablib/thread/devices/LaserQuantum/__init__.py
|
||||
pylablib/pylablib/thread/devices/LaserQuantum/base.py
|
||||
pylablib/pylablib/thread/devices/Leybold/__init__.py
|
||||
pylablib/pylablib/thread/devices/Leybold/base.py
|
||||
pylablib/pylablib/thread/devices/LighthousePhotonics/__init__.py
|
||||
pylablib/pylablib/thread/devices/LighthousePhotonics/base.py
|
||||
pylablib/pylablib/thread/devices/Lumel/__init__.py
|
||||
pylablib/pylablib/thread/devices/Lumel/base.py
|
||||
pylablib/pylablib/thread/devices/M2/__init__.py
|
||||
pylablib/pylablib/thread/devices/M2/emm.py
|
||||
pylablib/pylablib/thread/devices/M2/solstis.py
|
||||
pylablib/pylablib/thread/devices/Mightex/__init__.py
|
||||
pylablib/pylablib/thread/devices/Mightex/MightexSSeries.py
|
||||
pylablib/pylablib/thread/devices/Newport/__init__.py
|
||||
pylablib/pylablib/thread/devices/Newport/picomotor.py
|
||||
pylablib/pylablib/thread/devices/Omron/__init__.py
|
||||
pylablib/pylablib/thread/devices/Omron/base.py
|
||||
pylablib/pylablib/thread/devices/Ophir/__init__.py
|
||||
pylablib/pylablib/thread/devices/Ophir/base.py
|
||||
pylablib/pylablib/thread/devices/PCO/__init__.py
|
||||
pylablib/pylablib/thread/devices/PCO/SC2.py
|
||||
pylablib/pylablib/thread/devices/Pfeiffer/__init__.py
|
||||
pylablib/pylablib/thread/devices/Pfeiffer/base.py
|
||||
pylablib/pylablib/thread/devices/Photometrics/__init__.py
|
||||
pylablib/pylablib/thread/devices/Photometrics/pvcam.py
|
||||
pylablib/pylablib/thread/devices/PhotonFocus/__init__.py
|
||||
pylablib/pylablib/thread/devices/PhotonFocus/PhotonFocus.py
|
||||
pylablib/pylablib/thread/devices/PhysikInstrumente/__init__.py
|
||||
pylablib/pylablib/thread/devices/PhysikInstrumente/base.py
|
||||
pylablib/pylablib/thread/devices/PrincetonInstruments/__init__.py
|
||||
pylablib/pylablib/thread/devices/PrincetonInstruments/picam.py
|
||||
pylablib/pylablib/thread/devices/Rigol/__init__.py
|
||||
pylablib/pylablib/thread/devices/Rigol/power_supply.py
|
||||
pylablib/pylablib/thread/devices/Sirah/__init__.py
|
||||
pylablib/pylablib/thread/devices/Sirah/Matisse.py
|
||||
pylablib/pylablib/thread/devices/SmarAct/__init__.py
|
||||
pylablib/pylablib/thread/devices/SmarAct/MCS2.py
|
||||
pylablib/pylablib/thread/devices/SmarAct/scu3d.py
|
||||
pylablib/pylablib/thread/devices/Standa/__init__.py
|
||||
pylablib/pylablib/thread/devices/Standa/base.py
|
||||
pylablib/pylablib/thread/devices/Thorlabs/__init__.py
|
||||
pylablib/pylablib/thread/devices/Thorlabs/elliptec.py
|
||||
pylablib/pylablib/thread/devices/Thorlabs/kinesis.py
|
||||
pylablib/pylablib/thread/devices/Thorlabs/misc.py
|
||||
pylablib/pylablib/thread/devices/Thorlabs/serial.py
|
||||
pylablib/pylablib/thread/devices/Thorlabs/TLCamera.py
|
||||
pylablib/pylablib/thread/devices/Toptica/__init__.py
|
||||
pylablib/pylablib/thread/devices/Toptica/ibeam.py
|
||||
pylablib/pylablib/thread/devices/Trinamic/__init__.py
|
||||
pylablib/pylablib/thread/devices/Trinamic/base.py
|
||||
pylablib/pylablib/thread/devices/Voltcraft/__init__.py
|
||||
pylablib/pylablib/thread/devices/Voltcraft/multimeter.py
|
||||
pylablib/pylablib/thread/devices/generic/__init__.py
|
||||
pylablib/pylablib/thread/devices/generic/camera.py
|
||||
pylablib/pylablib/thread/devices/generic/lasers.py
|
||||
pylablib/pylablib/thread/devices/uc480/__init__.py
|
||||
pylablib/pylablib/thread/devices/uc480/uc480.py
|
||||
pylablib/pylablib/thread/stream/__init__.py
|
||||
pylablib/pylablib/thread/stream/blockstream.py
|
||||
pylablib/pylablib/thread/stream/frameproc.py
|
||||
pylablib/pylablib/thread/stream/stream_manager.py
|
||||
pylablib/pylablib/thread/stream/stream_message.py
|
||||
pylablib/pylablib/thread/stream/table_accum.py
|
||||
|
||||
@@ -1,58 +1,168 @@
|
||||
"""
|
||||
Andor SDK3 Camera Discovery and Connection Test
|
||||
Direct SDK usage without pylablib dependency
|
||||
"""
|
||||
|
||||
import ctypes
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Type definitions
|
||||
AT_H = ctypes.c_int
|
||||
AT_64 = ctypes.c_longlong
|
||||
AT_BOOL = ctypes.c_int
|
||||
|
||||
# Constants
|
||||
AT_SUCCESS = 0
|
||||
AT_HANDLE_SYSTEM = 1
|
||||
|
||||
# Load DLL
|
||||
dll_dir = os.path.join(os.path.dirname(__file__), "libs")
|
||||
old_path = os.environ.get("PATH", "")
|
||||
os.environ["PATH"] = dll_dir + os.pathsep + old_path
|
||||
|
||||
# Load the Andor SDK3 library
|
||||
try:
|
||||
if hasattr(os, "add_dll_directory"):
|
||||
with os.add_dll_directory(dll_dir):
|
||||
lib = ctypes.windll.LoadLibrary("atcore.dll")
|
||||
else:
|
||||
lib = ctypes.windll.LoadLibrary(os.path.join(dll_dir, "atcore.dll"))
|
||||
finally:
|
||||
os.environ["PATH"] = old_path
|
||||
# Try common installation paths
|
||||
sdk_paths = [
|
||||
r"C:\Program Files\Andor SOLIS\atcore.dll",
|
||||
r"C:\Program Files\Andor SDK3\atcore.dll",
|
||||
"atcore.dll" # Try system PATH
|
||||
]
|
||||
|
||||
# Define functions
|
||||
lib.AT_InitialiseLibrary.argtypes = []
|
||||
lib = None
|
||||
for path in sdk_paths:
|
||||
if os.path.exists(path) or path == "atcore.dll":
|
||||
try:
|
||||
lib = ctypes.WinDLL(path)
|
||||
print(f" Loaded SDK from: {path}")
|
||||
break
|
||||
except OSError:
|
||||
continue
|
||||
|
||||
if lib is None:
|
||||
raise OSError("Could not find atcore.dll. Please install Andor SDK3 or Andor SOLIS.")
|
||||
|
||||
except Exception as e:
|
||||
print(f" Failed to load Andor SDK3 library: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
# Define function signatures
|
||||
lib.AT_InitialiseLibrary.restype = ctypes.c_int
|
||||
lib.AT_InitialiseLibrary.argtypes = []
|
||||
|
||||
lib.AT_GetInt.argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_64)]
|
||||
lib.AT_GetInt.restype = ctypes.c_int
|
||||
|
||||
lib.AT_FinaliseLibrary.argtypes = []
|
||||
lib.AT_FinaliseLibrary.restype = ctypes.c_int
|
||||
lib.AT_FinaliseLibrary.argtypes = []
|
||||
|
||||
lib.AT_Open.restype = ctypes.c_int
|
||||
lib.AT_Open.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)]
|
||||
|
||||
lib.AT_Close.restype = ctypes.c_int
|
||||
lib.AT_Close.argtypes = [ctypes.c_int]
|
||||
|
||||
lib.AT_GetInt.restype = ctypes.c_int
|
||||
lib.AT_GetInt.argtypes = [ctypes.c_int, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_longlong)]
|
||||
|
||||
lib.AT_GetString.restype = ctypes.c_int
|
||||
lib.AT_GetString.argtypes = [ctypes.c_int, ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_int]
|
||||
|
||||
lib.AT_GetStringMaxLength.restype = ctypes.c_int
|
||||
lib.AT_GetStringMaxLength.argtypes = [ctypes.c_int, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_int)]
|
||||
|
||||
# Error checking
|
||||
def check_error(code, func_name):
|
||||
error_names = {
|
||||
0: "SUCCESS",
|
||||
1: "NOT_INITIALISED",
|
||||
2: "NOT_IMPLEMENTED",
|
||||
12: "INVALID_HANDLE",
|
||||
39: "DEVICE_NOT_FOUND"
|
||||
}
|
||||
if code != 0:
|
||||
error = error_names.get(code, f"UNKNOWN({code})")
|
||||
raise RuntimeError(f"{func_name} failed with error: {error}")
|
||||
|
||||
# Helper functions
|
||||
def get_int_feature(handle, feature):
|
||||
value = ctypes.c_longlong()
|
||||
code = lib.AT_GetInt(handle, feature, ctypes.byref(value))
|
||||
check_error(code, f"AT_GetInt({feature})")
|
||||
return value.value
|
||||
|
||||
def get_string_feature(handle, feature):
|
||||
max_len = ctypes.c_int()
|
||||
code = lib.AT_GetStringMaxLength(handle, feature, ctypes.byref(max_len))
|
||||
check_error(code, f"AT_GetStringMaxLength({feature})")
|
||||
|
||||
buffer = ctypes.create_unicode_buffer(max_len.value)
|
||||
code = lib.AT_GetString(handle, feature, buffer, max_len.value)
|
||||
check_error(code, f"AT_GetString({feature})")
|
||||
return buffer.value
|
||||
|
||||
# Main test code
|
||||
print("=" * 60)
|
||||
print("Andor SDK3 Camera Discovery Test")
|
||||
print("=" * 60)
|
||||
|
||||
# Initialize library
|
||||
print("Initializing library...")
|
||||
ret = lib.AT_InitialiseLibrary()
|
||||
if ret != AT_SUCCESS:
|
||||
print(f"ERROR: Initialize failed, code: {ret}")
|
||||
exit(1)
|
||||
print("Initialize OK")
|
||||
print("\n[1] Initializing Andor SDK3 library...")
|
||||
code = lib.AT_InitialiseLibrary()
|
||||
check_error(code, "AT_InitialiseLibrary")
|
||||
print(" Library initialized successfully")
|
||||
|
||||
# Get device count
|
||||
device_count = AT_64(0)
|
||||
ret = lib.AT_GetInt(AT_HANDLE_SYSTEM, "DeviceCount", ctypes.byref(device_count))
|
||||
if ret != AT_SUCCESS:
|
||||
print(f"ERROR: Get device count failed, code: {ret}")
|
||||
try:
|
||||
# Get number of cameras (using system handle = 1)
|
||||
print("\n[2] Detecting cameras...")
|
||||
num_cameras = get_int_feature(1, "DeviceCount")
|
||||
print(f" Found {num_cameras} camera(s)")
|
||||
|
||||
if num_cameras == 0:
|
||||
print("\n<EFBFBD> No cameras detected. Please check:")
|
||||
print(" - Camera is powered on")
|
||||
print(" - USB/PCIe connection is secure")
|
||||
print(" - Drivers are installed correctly")
|
||||
else:
|
||||
print(f"Device count: {device_count.value}")
|
||||
# Open first camera
|
||||
print(f"\n[3] Opening camera index 0...")
|
||||
handle = ctypes.c_int()
|
||||
code = lib.AT_Open(0, ctypes.byref(handle))
|
||||
check_error(code, "AT_Open")
|
||||
print(f" Camera opened (handle: {handle.value})")
|
||||
|
||||
try:
|
||||
# Get camera information
|
||||
print("\n[4] Reading camera information...")
|
||||
print("-" * 60)
|
||||
|
||||
camera_name = get_string_feature(handle.value, "CameraName")
|
||||
print(f" Camera Name : {camera_name}")
|
||||
|
||||
camera_model = get_string_feature(handle.value, "CameraModel")
|
||||
print(f" Camera Model : {camera_model}")
|
||||
|
||||
serial_number = get_string_feature(handle.value, "SerialNumber")
|
||||
print(f" Serial Number : {serial_number}")
|
||||
|
||||
firmware_ver = get_string_feature(handle.value, "FirmwareVersion")
|
||||
print(f" Firmware Ver : {firmware_ver}")
|
||||
|
||||
# Additional info
|
||||
try:
|
||||
sensor_width = get_int_feature(handle.value, "SensorWidth")
|
||||
sensor_height = get_int_feature(handle.value, "SensorHeight")
|
||||
print(f" Sensor Size : {sensor_width} x {sensor_height} pixels")
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
sensor_temp = lib.AT_GetFloat(handle.value, "SensorTemperature")
|
||||
# Note: would need to define AT_GetFloat properly for this
|
||||
except:
|
||||
pass
|
||||
|
||||
print("-" * 60)
|
||||
print(" Camera information retrieved successfully")
|
||||
|
||||
finally:
|
||||
# Close camera
|
||||
print("\n[5] Closing camera...")
|
||||
code = lib.AT_Close(handle.value)
|
||||
check_error(code, "AT_Close")
|
||||
print(" Camera closed")
|
||||
|
||||
finally:
|
||||
# Finalize library
|
||||
ret = lib.AT_FinaliseLibrary()
|
||||
if ret != AT_SUCCESS:
|
||||
print(f"ERROR: Finalize failed, code: {ret}")
|
||||
else:
|
||||
print("Finalize OK")
|
||||
print("\n[6] Shutting down SDK library...")
|
||||
code = lib.AT_FinaliseLibrary()
|
||||
check_error(code, "AT_FinaliseLibrary")
|
||||
print(" Library shutdown complete")
|
||||
|
||||
print("\n" + "=" * 60)
|
||||
print("Test completed successfully!")
|
||||
print("=" * 60)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,832 +0,0 @@
|
||||
from .base import AndorError, AndorTimeoutError, AndorFrameTransferError, AndorNotSupportedError
|
||||
from .atcore_lib import wlib as lib, AndorSDK3LibError, feature_types, read_uint12
|
||||
|
||||
from ...core.utils import py3, dictionary, general, funcargparse
|
||||
from ...core.devio import interface
|
||||
from ...core.utils.ctypes_tools import funcaddressof, as_ctypes_array
|
||||
from ..interface import camera
|
||||
from ..utils import load_lib
|
||||
from ...core.utils.cext_tools import try_import_cext
|
||||
with try_import_cext():
|
||||
from .utils import looper, copyframes # pylint: disable=no-name-in-module
|
||||
|
||||
import numpy as np
|
||||
import collections
|
||||
import ctypes
|
||||
import threading
|
||||
|
||||
|
||||
|
||||
class LibraryController(load_lib.LibraryController):
|
||||
def _do_uninit(self):
|
||||
self.lib.AT_FinaliseLibrary()
|
||||
libctl=LibraryController(lib)
|
||||
def restart_lib():
|
||||
libctl.shutdown()
|
||||
|
||||
|
||||
def get_cameras_number():
|
||||
"""Get number of connected Andor cameras"""
|
||||
libctl.preinit()
|
||||
lib.AT_InitialiseLibrary()
|
||||
return lib.AT_GetInt(1,"DeviceCount")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class AndorSDK3Attribute:
|
||||
"""
|
||||
Andor SDK3 camera attribute.
|
||||
|
||||
Allows to query and set values and get additional information.
|
||||
Usually created automatically by a Andor SDK3 camera instance, but could also be created manually.
|
||||
|
||||
Args:
|
||||
handle: Andor SDK3 camera handle
|
||||
pid: attribute id
|
||||
kind: attribute kind; can be ``"float"``, ``"int"``, ``"str"``, ``"bool"``, ``"enum"``, or ``"comm"`` (command);
|
||||
can also be ``"auto"`` (default), in which case it is obtained from the stored feature table;
|
||||
newer features might be missing, in which case kind needs to be supplied explicitly, or it raises an error
|
||||
|
||||
Attributes:
|
||||
name: attribute name
|
||||
kind: attribute kind; can be ``"float"``, ``"int"``, ``"str"``, ``"bool"``, ``"enum"``, or ``"comm"`` (command)
|
||||
implemented (bool): whether attribute is implemented
|
||||
readable (bool): whether attribute is readable
|
||||
writable (bool): whether attribute is writable
|
||||
min (float or int): minimal attribute value (if applicable)
|
||||
max (float or int): maximal attribute value (if applicable)
|
||||
ivalues: list of possible integer values for enum attributes
|
||||
values: list of possible text values for enum attributes
|
||||
labels: dict ``{label: index}`` which shows all possible values of an enumerated attribute and their corresponding numerical values
|
||||
ilabels: dict ``{index: label}`` which shows labels corresponding to numerical values of an enumerated attribute
|
||||
is_command (bool): whether attribute is a command (same as ``kind=="comm"``)
|
||||
"""
|
||||
def __init__(self, handle, name, kind="auto"):
|
||||
self.handle=handle
|
||||
self.name=py3.as_str(name)
|
||||
self.implemented=bool(lib.AT_IsImplemented(self.handle,self.name))
|
||||
if kind=="auto":
|
||||
if self.name not in feature_types:
|
||||
raise AndorError("can't determine feature kind: {}".format(self.name))
|
||||
kind=feature_types[self.name]
|
||||
funcargparse.check_parameter_range(kind,"kind",{"float","int","str","bool","enum","comm"})
|
||||
self.kind=kind
|
||||
self.is_command=self.kind=="comm"
|
||||
self.readable=self.implemented and not self.is_command and bool(lib.AT_IsReadable(self.handle,self.name))
|
||||
self.writable=self.implemented and not self.is_command and bool(lib.AT_IsWritable(self.handle,self.name))
|
||||
self.min=None
|
||||
self.max=None
|
||||
self.values=[]
|
||||
self.ivalues=[]
|
||||
self.labels={}
|
||||
self.ilabels={}
|
||||
if self.kind in {"int","float"}:
|
||||
try:
|
||||
self.min,self.max=self.get_range()
|
||||
except AndorError:
|
||||
pass
|
||||
elif self.kind=="enum":
|
||||
try:
|
||||
self._update_enum_limits()
|
||||
except AndorError:
|
||||
pass
|
||||
def __repr__(self):
|
||||
return "{}(name='{}', kind='{}')".format(self.__class__.__name__,self.name,self.kind)
|
||||
|
||||
def update_properties(self):
|
||||
"""Update all attribute properties: implemented, readable, writable, limits"""
|
||||
self.implemented=bool(lib.AT_IsImplemented(self.handle,self.name))
|
||||
self.readable=self.implemented and not self.is_command and bool(lib.AT_IsReadable(self.handle,self.name))
|
||||
self.writable=self.implemented and not self.is_command and bool(lib.AT_IsWritable(self.handle,self.name))
|
||||
try:
|
||||
self.update_limits()
|
||||
except AndorError:
|
||||
pass
|
||||
def get_value(self, enum_as_str=True, not_implemented_error=True, default=None):
|
||||
"""
|
||||
Get current value.
|
||||
|
||||
If ``enum_as_str==True``, return enum values as strings; otherwise, return as indices.
|
||||
If ``not_implemented_error==True`` and the feature is not implemented, raise :exc:`.AndorError`;
|
||||
otherwise, return `default` if it is not implemented.
|
||||
"""
|
||||
if not self.implemented:
|
||||
if not_implemented_error:
|
||||
raise AndorError("feature is not implemented: {}".format(self.name))
|
||||
else:
|
||||
return default
|
||||
if not self.readable:
|
||||
raise AndorError("feature is not readable: {}".format(self.name))
|
||||
if self.kind=="int":
|
||||
return lib.AT_GetInt(self.handle,self.name)
|
||||
if self.kind=="float":
|
||||
return lib.AT_GetFloat(self.handle,self.name)
|
||||
if self.kind=="str":
|
||||
strlen=lib.AT_GetStringMaxLength(self.handle,self.name)
|
||||
return lib.AT_GetString(self.handle,self.name,strlen)
|
||||
if self.kind=="bool":
|
||||
return bool(lib.AT_GetBool(self.handle,self.name))
|
||||
if self.kind=="enum":
|
||||
val=lib.AT_GetEnumIndex(self.handle,self.name)
|
||||
if enum_as_str:
|
||||
val=lib.AT_GetEnumStringByIndex(self.handle,self.name,val,512)
|
||||
return val
|
||||
raise AndorError("can't read feature '{}' with kind '{}'".format(self.name,self.kind))
|
||||
def set_value(self, value, not_implemented_error=True):
|
||||
"""
|
||||
Set current value.
|
||||
|
||||
If ``not_implemented_error==True`` and the feature is not implemented, raise :exc:`.AndorError`; otherwise, do nothing.
|
||||
"""
|
||||
if not self.implemented:
|
||||
if not_implemented_error:
|
||||
raise AndorError("feature is not implemented: {}".format(self.name))
|
||||
else:
|
||||
return
|
||||
if not self.writable:
|
||||
raise AndorError("feature is not writable: {}".format(self.name))
|
||||
if self.kind=="int":
|
||||
lib.AT_SetInt(self.handle,self.name,int(value))
|
||||
elif self.kind=="float":
|
||||
lib.AT_SetFloat(self.handle,self.name,float(value))
|
||||
elif self.kind=="str":
|
||||
lib.AT_SetString(self.handle,self.name,value)
|
||||
elif self.kind=="bool":
|
||||
lib.AT_SetBool(self.handle,self.name,bool(value))
|
||||
elif self.kind=="enum":
|
||||
if isinstance(value,py3.anystring):
|
||||
lib.AT_SetEnumString(self.handle,self.name,value)
|
||||
else:
|
||||
lib.AT_SetEnumIndex(self.handle,self.name,int(value))
|
||||
else:
|
||||
raise AndorError("can't set feature '{}' with kind '{}'".format(self.name,self.kind))
|
||||
def call_command(self):
|
||||
"""Execute the given command"""
|
||||
if not self.implemented:
|
||||
raise AndorError("command is not implemented: {}".format(self.name))
|
||||
lib.AT_Command(self.handle,self.name)
|
||||
def get_range(self, enum_as_str=True):
|
||||
"""
|
||||
Get allowed range of the given value.
|
||||
|
||||
For ``"int"`` or ``"float"`` values return tuple ``(min, max)`` (inclusive); for ``"enum"`` return list of possible values
|
||||
(if ``enum_as_str==True``, return list of string values, otherwise return list of indices).
|
||||
For all other value kinds return ``None``.
|
||||
"""
|
||||
if not self.implemented:
|
||||
raise AndorError("feature is not implemented: {}".format(self.name))
|
||||
if self.kind=="int":
|
||||
return (lib.AT_GetIntMin(self.handle,self.name),lib.AT_GetIntMax(self.handle,self.name))
|
||||
if self.kind=="float":
|
||||
return (lib.AT_GetFloatMin(self.handle,self.name),lib.AT_GetFloatMax(self.handle,self.name))
|
||||
if self.kind=="enum":
|
||||
count=lib.AT_GetEnumCount(self.handle,self.name)
|
||||
available=[i for i in range(count) if lib.AT_IsEnumIndexAvailable(self.handle,self.name,i)]
|
||||
if enum_as_str:
|
||||
available=[lib.AT_GetEnumStringByIndex(self.handle,self.name,i,512) for i in available]
|
||||
return available
|
||||
def _update_enum_limits(self):
|
||||
self.values=self.get_range()
|
||||
self.ivalues=self.get_range(enum_as_str=False)
|
||||
self.labels=dict(zip(self.values,self.ivalues))
|
||||
self.ilabels=dict(zip(self.ivalues,self.values))
|
||||
def update_limits(self):
|
||||
"""Update minimal and maximal attribute limits and return tuple ``(min, max)``"""
|
||||
if self.kind in {"int","float"}:
|
||||
self.min,self.max=self.get_range()
|
||||
return (self.min,self.max)
|
||||
elif self.kind=="enum":
|
||||
self._update_enum_limits()
|
||||
def truncate_value(self, value):
|
||||
"""Limit value to lie within the allowed range"""
|
||||
if self.kind in {"int","float"}:
|
||||
vmin,vmax=self.update_limits()
|
||||
value=min(max(value,vmin),vmax)
|
||||
return value
|
||||
|
||||
|
||||
TDeviceInfo=collections.namedtuple("TDeviceInfo",["camera_name","camera_model","serial_number","firmware_version","software_version"])
|
||||
TMissedFramesStatus=collections.namedtuple("TMissedFramesStatus",["skipped","overflows"])
|
||||
TFrameInfo=collections.namedtuple("TFrameInfo",["frame_index","timestamp_dev","size","pixeltype","stride"])
|
||||
class AndorSDK3Camera(camera.IBinROICamera, camera.IExposureCamera, camera.IAttributeCamera):
|
||||
"""
|
||||
Andor SDK3 camera.
|
||||
|
||||
Args:
|
||||
idx(int): camera index (use :func:`get_cameras_number` to get the total number of connected cameras)
|
||||
"""
|
||||
Error=AndorError
|
||||
TimeoutError=AndorTimeoutError
|
||||
FrameTransferError=AndorFrameTransferError
|
||||
_TFrameInfo=TFrameInfo
|
||||
_frameinfo_fields=general.make_flat_namedtuple(TFrameInfo,fields={"size":camera.TFrameSize})._fields
|
||||
def __init__(self, idx=0):
|
||||
super().__init__()
|
||||
lib.initlib()
|
||||
self.idx=idx
|
||||
self.handle=None
|
||||
self._opid=None
|
||||
self._buffer_padding=10
|
||||
self._buffer_mgr=self.BufferManager(self)
|
||||
self._reg_cb=None
|
||||
self.open()
|
||||
self._overflow_behavior="error"
|
||||
self._overflows_counter=0
|
||||
|
||||
self._device_var_ignore_error={"get":(AndorNotSupportedError,),"set":(AndorNotSupportedError,)}
|
||||
self._add_info_variable("device_info",self.get_device_info)
|
||||
self._add_settings_variable("trigger_mode",self.get_trigger_mode,self.set_trigger_mode)
|
||||
self._add_settings_variable("shutter",self.get_shutter,self.set_shutter)
|
||||
self._add_settings_variable("temperature",self.get_temperature_setpoint,self.set_temperature)
|
||||
self._add_status_variable("temperature_monitor",self.get_temperature)
|
||||
self._add_settings_variable("cooler",self.is_cooler_on,self.set_cooler)
|
||||
self._add_settings_variable("metadata_enabled",self.is_metadata_enabled,self.enable_metadata)
|
||||
self._add_settings_variable("frame_period",self.get_frame_period,self.set_frame_period)
|
||||
self._add_status_variable("missed_frames",self.get_missed_frames_status)
|
||||
|
||||
|
||||
|
||||
def _get_connection_parameters(self):
|
||||
return self.idx
|
||||
def open(self):
|
||||
"""Open connection to the camera"""
|
||||
self.close()
|
||||
ncams=get_cameras_number()
|
||||
if self.idx>=ncams:
|
||||
raise AndorError("camera index {} is not available ({} cameras exist)".format(self.idx,ncams))
|
||||
self.handle=lib.AT_Open(self.idx)
|
||||
self._opid=libctl.open().opid
|
||||
self._update_attributes()
|
||||
self._register_events()
|
||||
self.clear_acquisition()
|
||||
def close(self):
|
||||
"""Close connection to the camera"""
|
||||
if self.handle is not None:
|
||||
self.clear_acquisition()
|
||||
self._unregister_events()
|
||||
lib.AT_Close(self.handle)
|
||||
libctl.close(self._opid)
|
||||
self.handle=None
|
||||
self._opid=None
|
||||
def is_opened(self):
|
||||
"""Check if the device is connected"""
|
||||
return self.handle is not None
|
||||
|
||||
def _list_attributes(self):
|
||||
return [AndorSDK3Attribute(self.handle,v) for v in feature_types]
|
||||
def add_attribute(self, name, kind):
|
||||
"""
|
||||
Add a new attribute which is not currently present in the dictionary.
|
||||
|
||||
`kind` can be ``"float"``, ``"int"``, ``"str"``, ``"bool"``, ``"enum"``, or ``"comm"`` (command).
|
||||
"""
|
||||
self.attributes[name]=AndorSDK3Attribute(self.handle,name,kind=kind)
|
||||
def get_attribute(self, name, update_properties=False, error_on_missing=True): # pylint: disable=arguments-differ, arguments-renamed
|
||||
"""
|
||||
Get the camera attribute with the given name.
|
||||
|
||||
If ``update_properties==True``, automatically update all attribute properties.
|
||||
"""
|
||||
att=super().get_attribute(name,error_on_missing=error_on_missing)
|
||||
if att is not None and update_properties:
|
||||
att.update_properties()
|
||||
return att
|
||||
def get_attribute_value(self, name, enum_as_str=True, update_properties=False, error_on_missing=True, default=None): # pylint: disable=arguments-differ, arguments-renamed
|
||||
"""
|
||||
Get value of an attribute with the given name.
|
||||
|
||||
If ``update_properties==True``, automatically update all attribute properties before settings.
|
||||
If the value doesn't exist or can not be read and ``error_on_missing==True``, raise error; otherwise, return `default`.
|
||||
If `default` is not ``None``, assume that ``error_on_missing==False``.
|
||||
"""
|
||||
error_on_missing=error_on_missing and (default is None)
|
||||
attr=self.get_attribute(name,update_properties=update_properties,error_on_missing=error_on_missing)
|
||||
return default if attr is None else attr.get_value(not_implemented_error=error_on_missing,enum_as_str=enum_as_str,default=default)
|
||||
def set_attribute_value(self, name, value, update_properties=True, error_on_missing=True): # pylint: disable=arguments-differ, arguments-renamed
|
||||
"""
|
||||
Set value of an attribute with the given name.
|
||||
|
||||
If the value doesn't exist or can not be written and ``error_on_missing==True``, raise error; otherwise, do nothing.
|
||||
If ``update_properties==True``, automatically update all attribute properties before settings.
|
||||
"""
|
||||
attr=self.get_attribute(name,update_properties=update_properties,error_on_missing=error_on_missing)
|
||||
if attr is not None:
|
||||
attr.set_value(value,not_implemented_error=error_on_missing)
|
||||
def get_all_attribute_values(self, root="", enum_as_str=True, update_properties=False): # pylint: disable=arguments-differ, arguments-renamed, unused-argument
|
||||
"""
|
||||
Get values of all attributes.
|
||||
|
||||
If ``update_properties==True``, automatically update all attribute properties before settings.
|
||||
"""
|
||||
values=dictionary.Dictionary()
|
||||
for n,att in self.attributes.as_dict("flat").items():
|
||||
if update_properties:
|
||||
att.update_properties()
|
||||
if att.readable:
|
||||
try:
|
||||
values[n]=att.get_value(enum_as_str=enum_as_str)
|
||||
except AndorSDK3LibError: # sometimes nominally implemented features still raise errors
|
||||
pass
|
||||
return values
|
||||
def set_all_attribute_values(self, settings, update_properties=True): # pylint: disable=arguments-differ, arguments-renamed
|
||||
"""
|
||||
Set values of all attribute in the given dictionary.
|
||||
|
||||
If ``update_properties==True``, automatically update all attribute properties before settings.
|
||||
"""
|
||||
settings=dictionary.as_dict(settings,style="flat",copy=False)
|
||||
for k,v in settings.items():
|
||||
k=self._normalize_attribute_name(k)
|
||||
attr=self.get_attribute(k,update_properties=update_properties,error_on_missing=False)
|
||||
if attr is not None and attr.writable:
|
||||
attr.set_value(v)
|
||||
|
||||
def _get_feature(self, name, writable=False):
|
||||
"""
|
||||
Check if the feature is available and return the corresponding attribute.
|
||||
|
||||
If ``writable==True``, also check if it's writable.
|
||||
"""
|
||||
if name in self.attributes:
|
||||
attr=self.attributes[name]
|
||||
attr.update_properties()
|
||||
if attr.implemented and (attr.writable or not writable):
|
||||
return attr
|
||||
raise AndorNotSupportedError("feature {} is not supported by camera {}".format(name,self.get_device_info().camera_model))
|
||||
|
||||
def call_command(self, name):
|
||||
"""Execute the given command"""
|
||||
self._get_feature(name).call_command()
|
||||
|
||||
|
||||
def get_device_info(self):
|
||||
"""
|
||||
Get camera info.
|
||||
|
||||
Return tuple ``(camera_name, camera_model, serial_number, firmware_version, software_version)``.
|
||||
"""
|
||||
camera_name=self.cav["CameraName"]
|
||||
camera_model=self.cav["CameraModel"]
|
||||
serial_number=self.cav["SerialNumber"]
|
||||
firmware_version=self.cav["FirmwareVersion"]
|
||||
strlen=lib.AT_GetStringMaxLength(1,"SoftwareVersion")
|
||||
software_version=lib.AT_GetString(1,"SoftwareVersion",strlen)
|
||||
return TDeviceInfo(camera_name,camera_model,serial_number,firmware_version,software_version)
|
||||
|
||||
|
||||
_p_trigger_mode=interface.EnumParameterClass("trigger_mode",
|
||||
{"int":"Internal","ext":"External","software":"Software","ext_start":"External Start","ext_exp":"External Exposure"})
|
||||
@interface.use_parameters(_returns="trigger_mode")
|
||||
def get_trigger_mode(self):
|
||||
"""
|
||||
Get trigger mode.
|
||||
|
||||
Can be ``"int"`` (internal), ``"ext"`` (external), ``"software"`` (software trigger),
|
||||
``"ext_start"`` (external start), or ``"ext_exp"`` (external exposure).
|
||||
"""
|
||||
return self.cav["TriggerMode"]
|
||||
@camera.acqstopped
|
||||
@interface.use_parameters(mode="trigger_mode")
|
||||
def set_trigger_mode(self, mode):
|
||||
"""
|
||||
Set trigger mode.
|
||||
|
||||
Can be ``"int"`` (internal), ``"ext"`` (external), or ``"software"`` (software trigger).
|
||||
"""
|
||||
self.cav["TriggerMode"]=mode
|
||||
return self.get_trigger_mode()
|
||||
|
||||
_p_shutter_mode=interface.EnumParameterClass("shutter_mode",{"open":"Open","closed":"Closed","auto":"Auto"})
|
||||
@interface.use_parameters(_returns="shutter_mode")
|
||||
def get_shutter(self):
|
||||
"""Get current shutter mode"""
|
||||
return self._get_feature("ShutterMode").get_value()
|
||||
@interface.use_parameters(mode="shutter_mode")
|
||||
def set_shutter(self, mode):
|
||||
"""
|
||||
Set trigger mode.
|
||||
|
||||
Can be ``"open"``, ``"closed"``, or ``"auto"``.
|
||||
"""
|
||||
self._get_feature("ShutterMode").set_value(mode)
|
||||
return self.get_shutter()
|
||||
|
||||
def is_cooler_on(self):
|
||||
"""Check if the cooler is on"""
|
||||
return self._get_feature("SensorCooling").get_value()
|
||||
@camera.acqstopped
|
||||
def set_cooler(self, on=True):
|
||||
"""Set the cooler on or off"""
|
||||
self._get_feature("SensorCooling").set_value(on)
|
||||
return self.is_cooler_on()
|
||||
|
||||
def get_temperature(self):
|
||||
"""Get the current camera temperature"""
|
||||
return self._get_feature("SensorTemperature").get_value()
|
||||
def get_temperature_setpoint(self):
|
||||
"""Get current temperature setpoint"""
|
||||
return self._get_feature("TargetSensorTemperature").get_value()
|
||||
@camera.acqstopped
|
||||
def set_temperature(self, temperature, enable_cooler=True):
|
||||
"""
|
||||
Change the temperature setpoint.
|
||||
|
||||
If ``enable_cooler==True``, turn the cooler on automatically.
|
||||
"""
|
||||
p_target=self._get_feature("TargetSensorTemperature")
|
||||
if p_target.get_value()!=temperature:
|
||||
p_target.set_value(temperature)
|
||||
if enable_cooler:
|
||||
self.set_cooler(True)
|
||||
return p_target.get_value()
|
||||
|
||||
|
||||
def get_exposure(self):
|
||||
"""Get current exposure"""
|
||||
return self._get_feature("ExposureTime").get_value()
|
||||
def set_exposure(self, exposure):
|
||||
"""Set camera exposure"""
|
||||
self.set_frame_period(0)
|
||||
p_exposure=self._get_feature("ExposureTime")
|
||||
exposure=p_exposure.truncate_value(exposure)
|
||||
p_exposure.set_value(exposure)
|
||||
return self.get_exposure()
|
||||
def get_frame_period(self):
|
||||
return 1./self.cav["FrameRate"]
|
||||
def set_frame_period(self, frame_period):
|
||||
"""Set frame period (time between two consecutive frames in the internal trigger mode)"""
|
||||
p_frame_rate=self.get_attribute("FrameRate",update_properties=True,error_on_missing=False)
|
||||
if p_frame_rate is None or not p_frame_rate.writable:
|
||||
return
|
||||
ro_rng=1./p_frame_rate.max,1./p_frame_rate.min
|
||||
frame_period=max(min(frame_period,ro_rng[1]),ro_rng[0])
|
||||
self.cav["FrameRate"]=1./frame_period
|
||||
return self.get_frame_period()
|
||||
def get_frame_timings(self):
|
||||
return self._TAcqTimings(self.get_exposure(),self.get_frame_period())
|
||||
|
||||
def is_metadata_enabled(self):
|
||||
"""Check if the metadata enabled"""
|
||||
return self.get_attribute_value("MetadataEnable",error_on_missing=False,default=False)
|
||||
def enable_metadata(self, enable=True):
|
||||
"""Enable or disable metadata streaming"""
|
||||
updated=self.get_attribute_value("MetadataEnable",error_on_missing=False,default=enable)!=enable
|
||||
if updated:
|
||||
with self.pausing_acquisition(clear=True):
|
||||
self.set_attribute_value("MetadataEnable",enable,error_on_missing=False)
|
||||
return self.is_metadata_enabled()
|
||||
|
||||
### Frame management ###
|
||||
class BufferManager:
|
||||
"""
|
||||
Cython-based schedule loop manager.
|
||||
|
||||
Runs the loop function and provides callback storage.
|
||||
"""
|
||||
def __init__(self, cam):
|
||||
self.buffers=None
|
||||
self.hbuffers=None
|
||||
self.queued_buffers=0
|
||||
self.size=0
|
||||
self.overflow_detected=False
|
||||
self.cam=cam
|
||||
self._cnt_lock=threading.RLock()
|
||||
self._buffer_loop_thread=None
|
||||
self.evt=threading.Event()
|
||||
self.looping=ctypes.c_ulong(0)
|
||||
self.nread=ctypes.c_ulong(0)
|
||||
def allocate_buffers(self, nbuff, size, queued_buffers=None):
|
||||
"""
|
||||
Allocate and queue buffers.
|
||||
|
||||
`queued_buffers`` specifies number of allocated buffers to keep queued at a given time (by default, all of them)
|
||||
"""
|
||||
with self._cnt_lock:
|
||||
self.deallocate_buffers()
|
||||
self.buffers=[ctypes.create_string_buffer(size) for _ in range(nbuff)]
|
||||
self.hbuffers=as_ctypes_array([ctypes.addressof(b) for b in self.buffers],ctypes.c_void_p)
|
||||
self.queued_buffers=queued_buffers if queued_buffers is not None else len(self.buffers)
|
||||
self.size=size
|
||||
for b in self.buffers[:self.queued_buffers]:
|
||||
lib.AT_QueueBuffer(self.cam.handle,ctypes.cast(b,ctypes.POINTER(ctypes.c_uint8)),self.size)
|
||||
def deallocate_buffers(self):
|
||||
"""Deallocated buffers (flushing should be done manually)"""
|
||||
with self._cnt_lock:
|
||||
if self.buffers:
|
||||
self.stop_loop()
|
||||
self.buffers=None
|
||||
self.hbuffers=None
|
||||
self.size=0
|
||||
def readn(self, idx, n, size=None, off=0):
|
||||
"""Return `n` buffers starting from `idx`, taking `size` bytes from each"""
|
||||
if size is None:
|
||||
size=self.size
|
||||
data=np.empty((n,size),dtype="u1")
|
||||
copyframes(len(self.hbuffers),ctypes.addressof(self.hbuffers),int(size),idx%len(self.hbuffers),n,off,data.ctypes.data)
|
||||
return data
|
||||
def reset(self):
|
||||
"""Reset counter (on frame acquisition)"""
|
||||
self.nread.value=0
|
||||
self.overflow_detected=False
|
||||
def start_loop(self):
|
||||
"""Start loop serving the given buffer manager"""
|
||||
self.stop_loop()
|
||||
self.evt.clear()
|
||||
self.looping.value=1
|
||||
self.nread.value=0
|
||||
self._buffer_loop_thread=threading.Thread(target=self._loop,daemon=True)
|
||||
self._buffer_loop_thread.start()
|
||||
self.evt.wait()
|
||||
def stop_loop(self):
|
||||
"""Stop the loop thread"""
|
||||
if self._buffer_loop_thread is not None:
|
||||
self.looping.value=0
|
||||
self._buffer_loop_thread.join()
|
||||
self._buffer_loop_thread=None
|
||||
def _loop(self):
|
||||
self.evt.set()
|
||||
looper(self.cam.handle,len(self.hbuffers),ctypes.addressof(self.hbuffers),self.size,self.queued_buffers,
|
||||
ctypes.addressof(self.looping),ctypes.addressof(self.nread),
|
||||
funcaddressof(lib.lib.AT_WaitBuffer),funcaddressof(lib.lib.AT_QueueBuffer))
|
||||
def get_status(self):
|
||||
"""Get the current loop status, which is the tuple ``(acquired,)``"""
|
||||
return (self.nread.value,)
|
||||
def on_overflow(self):
|
||||
"""Process buffer overflow event"""
|
||||
with self._cnt_lock:
|
||||
self.overflow_detected=True
|
||||
def new_overflow(self):
|
||||
with self._cnt_lock:
|
||||
return self.overflow_detected
|
||||
def _register_events(self):
|
||||
self._unregister_events()
|
||||
if self.get_attribute_value("EventEnable",error_on_missing=False) is not None:
|
||||
self.cav["EventSelector"]="BufferOverflowEvent"
|
||||
self.cav["EventEnable"]=True
|
||||
buff_cb=lib.AT_RegisterFeatureCallback(self.handle,"BufferOverflowEvent",lambda *args: self._buffer_mgr.on_overflow())
|
||||
self._reg_cb=buff_cb
|
||||
self._buffer_mgr.reset()
|
||||
def _unregister_events(self):
|
||||
if self._reg_cb is not None:
|
||||
lib.AT_UnregisterFeatureCallback(self.handle,"BufferOverflowEvent",self._reg_cb)
|
||||
self.cav["EventSelector"]="BufferOverflowEvent"
|
||||
self.cav["EventEnable"]=False
|
||||
self._reg_cb=None
|
||||
self._buffer_mgr.reset()
|
||||
def _allocate_buffers(self, nframes):
|
||||
"""
|
||||
Create and set up a new ring buffer.
|
||||
|
||||
If a ring buffer is already allocated, remove it and create a new one.
|
||||
"""
|
||||
self._deallocate_buffers()
|
||||
frame_size=self.cav["ImageSizeBytes"]
|
||||
self._buffer_mgr.allocate_buffers(nframes+self._buffer_padding,frame_size,queued_buffers=nframes)
|
||||
def _deallocate_buffers(self):
|
||||
"""Remove the ring buffer and clean up the memory"""
|
||||
lib.flush_buffers(self.handle)
|
||||
self._buffer_mgr.deallocate_buffers()
|
||||
|
||||
|
||||
@interface.use_parameters(mode="acq_mode")
|
||||
def setup_acquisition(self, mode="sequence", nframes=100): # pylint: disable=arguments-differ
|
||||
"""
|
||||
Setup acquisition.
|
||||
|
||||
`mode` can be either ``"snap"`` (single frame or a fixed number of frames) or ``"sequence"`` (continuous acquisition).
|
||||
`nframes` determines number of frames to acquire in the single mode, or size of the ring buffer in the ``"sequence"`` mode (by default, 100).
|
||||
"""
|
||||
super().setup_acquisition(mode=mode,nframes=nframes)
|
||||
def clear_acquisition(self):
|
||||
self.stop_acquisition()
|
||||
self._deallocate_buffers()
|
||||
self.reset_overflows_counter()
|
||||
super().clear_acquisition()
|
||||
|
||||
def start_acquisition(self, *args, **kwargs):
|
||||
self.stop_acquisition()
|
||||
super().start_acquisition(*args,**kwargs)
|
||||
nframes=self._acq_params["nframes"]
|
||||
if self._acq_params["mode"]=="snap":
|
||||
self.cav["CycleMode"]="Fixed"
|
||||
self.cav["FrameCount"]=nframes
|
||||
else:
|
||||
# self.cav["CycleMode"]="Continuous" # Zyla bug doesn't allow continuous mode with >1000 FPS
|
||||
self.cav["CycleMode"]="Fixed"
|
||||
p_frame_count=self.get_attribute("FrameCount",update_properties=True)
|
||||
p_frame_count.set_value(p_frame_count.max)
|
||||
self._allocate_buffers(nframes)
|
||||
self._frame_counter.reset(nframes)
|
||||
self._buffer_mgr.reset()
|
||||
self._buffer_mgr.start_loop()
|
||||
self.call_command("AcquisitionStart")
|
||||
def stop_acquisition(self):
|
||||
if self.cav["CameraAcquiring"]:
|
||||
self._frame_counter.update_acquired_frames(self._get_acquired_frames())
|
||||
self.call_command("AcquisitionStop")
|
||||
self._buffer_mgr.stop_loop()
|
||||
def acquisition_in_progress(self):
|
||||
return self.cav["CameraAcquiring"]
|
||||
|
||||
|
||||
|
||||
def _get_acquired_frames(self):
|
||||
return self._buffer_mgr.get_status()[0]
|
||||
def get_missed_frames_status(self):
|
||||
"""
|
||||
Get missed frames status.
|
||||
|
||||
Return tuple ``(skipped, overflows)`` with the number skipped frames (sent from camera to the PC, but not read and overwritten)
|
||||
and number of buffer overflows (events when the frame rate is too for the data transfer, so some unknown number of frames is skipped).
|
||||
"""
|
||||
skipped_frames=self.get_frames_status().skipped
|
||||
return TMissedFramesStatus(skipped_frames,self._overflows_counter)
|
||||
def reset_overflows_counter(self):
|
||||
"""Reset buffer overflows counter"""
|
||||
self._overflows_counter=0
|
||||
_p_overflow_behavior=interface.EnumParameterClass("overflow_behavior",["error","restart","ignore"])
|
||||
@interface.use_parameters(behavior="overflow_behavior")
|
||||
def set_overflow_behavior(self, behavior):
|
||||
"""
|
||||
Choose the camera behavior if buffer overflow is encountered when waiting for a new frame.
|
||||
|
||||
Can be ``"error"`` (raise ``AndorFrameTransferError``), ``"restart"`` (restart the acquisition), or ``"ignore"`` (ignore the overflow, which will cause the wait to time out).
|
||||
"""
|
||||
self._overflow_behavior=behavior
|
||||
|
||||
def _get_data_dimensions_rc(self):
|
||||
return self.cav["AOIHeight"],self.cav["AOIWidth"]
|
||||
def get_detector_size(self):
|
||||
"""Get camera detector size (in pixels) as a tuple ``(width, height)``"""
|
||||
return int(self.cav["SensorWidth"]),int(self.cav["SensorHeight"])
|
||||
def get_roi(self):
|
||||
"""
|
||||
Get current ROI.
|
||||
|
||||
Return tuple ``(hstart, hend, vstart, vend, hbin, vbin)``.
|
||||
"""
|
||||
hbin=int(self.get_attribute_value("AOIHBin",default=1))
|
||||
vbin=int(self.get_attribute_value("AOIVBin",default=1))
|
||||
hstart=int(self.cav["AOILeft"])-1
|
||||
hend=hstart+int(self.cav["AOIWidth"])*hbin
|
||||
vstart=int(self.cav["AOITop"])-1
|
||||
vend=vstart+int(self.cav["AOIHeight"])*vbin
|
||||
return (hstart,hend,vstart,vend,hbin,vbin)
|
||||
@camera.acqcleared
|
||||
def set_roi(self, hstart=0, hend=None, vstart=0, vend=None, hbin=1, vbin=1):
|
||||
"""
|
||||
Set current ROI.
|
||||
|
||||
By default, all non-supplied parameters take extreme values. Binning is the same for both axes.
|
||||
"""
|
||||
hlim,vlim=self.get_roi_limits()
|
||||
hbin=min(max(hbin,1),hlim.maxbin)
|
||||
vbin=min(max(vbin,1),vlim.maxbin)
|
||||
self.cav["AOILeft"]=1
|
||||
self.cav["AOITop"]=1
|
||||
self.cav["AOIWidth"]=hlim.min
|
||||
self.cav["AOIHeight"]=vlim.min
|
||||
self.set_attribute_value("AOIHBin",hbin,error_on_missing=False)
|
||||
self.set_attribute_value("AOIVBin",vbin,error_on_missing=False)
|
||||
hbin=int(self.get_attribute_value("AOIHBin",default=1))
|
||||
vbin=int(self.get_attribute_value("AOIVBin",default=1))
|
||||
hlim,vlim=self.get_roi_limits(hbin=hbin,vbin=vbin)
|
||||
hstart,hend,_=self._truncate_roi_axis((hstart,hend,hbin),hlim)
|
||||
vstart,vend,_=self._truncate_roi_axis((vstart,vend,vbin),vlim)
|
||||
self.cav["AOIWidth"]=(hend-hstart)//hbin
|
||||
self.cav["AOIHeight"]=(vend-vstart)//vbin
|
||||
self.cav["AOILeft"]=hstart+1
|
||||
self.cav["AOITop"]=vstart+1
|
||||
return self.get_roi()
|
||||
def get_roi_limits(self, hbin=1, vbin=1):
|
||||
"""
|
||||
Get the minimal and maximal ROI parameters.
|
||||
|
||||
Return tuple ``(hlim, vlim)``, where each element is in turn a limit 5-tuple
|
||||
``(min, max, pstep, sstep, maxbin)`` with, correspondingly, minimal and maximal size,
|
||||
position and size step, and the maximal binning.
|
||||
|
||||
Note that the minimal ROI size depends on the current (not just supplied) binning settings.
|
||||
For more accurate results, is it only after setting up the binning.
|
||||
"""
|
||||
wdet,hdet=self.get_detector_size()
|
||||
try:
|
||||
wmin=self._get_feature("AOIWidth").min or wdet
|
||||
except AndorNotSupportedError:
|
||||
wmin=wdet
|
||||
try:
|
||||
hmin=self._get_feature("AOIHeight").min or hdet
|
||||
except AndorNotSupportedError:
|
||||
hmin=hdet,hdet
|
||||
try:
|
||||
hbinmax=self._get_feature("AOIHBin").max or 1
|
||||
except AndorNotSupportedError:
|
||||
hbinmax=1
|
||||
try:
|
||||
vbinmax=self._get_feature("AOIVBin").max or 1
|
||||
except AndorNotSupportedError:
|
||||
vbinmax=1
|
||||
hlim=camera.TAxisROILimit(wmin*hbin,wdet,1,hbin,hbinmax)
|
||||
vlim=camera.TAxisROILimit(hmin*vbin,hdet,1,vbin,vbinmax)
|
||||
return hlim,vlim
|
||||
|
||||
def _check_buffer_overflow(self):
|
||||
if self._buffer_mgr.new_overflow():
|
||||
self._overflows_counter+=1
|
||||
if self._overflow_behavior=="ignore":
|
||||
return False
|
||||
if self._overflow_behavior=="error":
|
||||
self.stop_acquisition()
|
||||
raise self.FrameTransferError("buffer overflow while waiting for a new frame")
|
||||
self.start_acquisition()
|
||||
return True
|
||||
return False
|
||||
def _wait_for_next_frame(self, timeout=20., idx=None):
|
||||
if self._check_buffer_overflow():
|
||||
raise AndorTimeoutError("buffer overflow while waiting for a new frame")
|
||||
super()._wait_for_next_frame(timeout=timeout,idx=idx)
|
||||
def _frame_info_to_namedtuple(self, info):
|
||||
return self._TFrameInfo(info[0],info[1],camera.TFrameSize(*info[2:4]),*info[4:])
|
||||
|
||||
_support_chunks=True
|
||||
def _arrange_metadata(self, chunks, nframes):
|
||||
metadata=np.zeros((nframes,6),dtype="i8")-1
|
||||
if 1 in chunks:
|
||||
metadata[:,1]=chunks[1].view("i8")[:,0]
|
||||
if 7 in chunks:
|
||||
metadata[:,2]=chunks[7].view("<u2")[:,2]
|
||||
metadata[:,3]=chunks[7].view("<u2")[:,3]
|
||||
metadata[:,4]=chunks[7][:,2]
|
||||
metadata[:,5]=chunks[7].view("<u2")[:,0]
|
||||
return metadata
|
||||
def _read_frames_metadata(self, start, nframes):
|
||||
size=self._buffer_mgr.size
|
||||
chunks={}
|
||||
read_len=0
|
||||
cid=None
|
||||
while read_len<size:
|
||||
if size<read_len+8:
|
||||
raise AndorError("unexpected size of the last section: {}, larger than the required 8 header bytes".format(size-read_len))
|
||||
cid,clen=self._buffer_mgr.readn(start,1,8,off=size-read_len-8).view("<u4")[0]
|
||||
if read_len+clen+4>size:
|
||||
raise AndorError("unexpected section {} size: {}, larger than the remaining block size {}".format(cid,clen+4,size-read_len))
|
||||
chunks[cid]=self._buffer_mgr.readn(start,nframes,clen-4,off=size-read_len-4-clen).reshape((nframes,clen-4))
|
||||
read_len+=clen+4
|
||||
if 0 not in chunks:
|
||||
raise AndorError("missing image data")
|
||||
img=chunks.pop(0)
|
||||
return img,self._arrange_metadata(chunks,nframes)
|
||||
def _read_frames(self, rng, return_info=False):
|
||||
height,width=self._get_data_dimensions_rc()
|
||||
bpp=self.cav["BytesPerPixel"]
|
||||
stride=self.cav["AOIStride"]
|
||||
if bpp not in [1,1.5,2,4]:
|
||||
raise ValueError("unexpected pixel byte size: {}".format(bpp))
|
||||
if stride<int(np.ceil(bpp*width)):
|
||||
raise AndorError("unexpected stride: expected at least {}x{}={}, got {}".format(width,bpp,int(np.ceil(width*bpp)),stride))
|
||||
nframes=rng[1]-rng[0]
|
||||
if self.is_metadata_enabled() and return_info:
|
||||
img,metadata=self._read_frames_metadata(rng[0],nframes)
|
||||
exp_len=height*stride
|
||||
if img.shape[1]!=exp_len:
|
||||
if img.shaoe[1]<exp_len or img.shaoe[1]>exp_len+8+stride: # sometimes image size gets rounded to nearest 4/8/stride (CL) bytes
|
||||
raise AndorError("unexpected image byte size: expected {}x{}={}, got {}".format(stride,height,exp_len,img.shaoe[1]))
|
||||
img=img[:,:exp_len]
|
||||
metadata[:,0]=np.arange(rng[0],rng[0]+nframes)
|
||||
else:
|
||||
img=self._buffer_mgr.readn(rng[0],nframes,size=height*stride)
|
||||
metadata=None
|
||||
if bpp==1.5:
|
||||
img=read_uint12(img.reshape(-1,stride),width=width).reshape((nframes,height,width))
|
||||
else:
|
||||
bpp=int(bpp)
|
||||
dtype="<u{}".format(bpp)
|
||||
if stride%bpp==0:
|
||||
img=img.view(dtype).reshape(nframes,height,-1)[:,:width]
|
||||
else: # only possible with bpp==2 or 4 and non-divisible stride
|
||||
img=img.reshape((nframes,height,stride))[:,:,:width*bpp].view(dtype)
|
||||
img=self._convert_indexing(img,"rct",axes=(-2,-1))
|
||||
return [img],([metadata] if metadata is not None else None)
|
||||
def _zero_frame(self, n):
|
||||
dim=self.get_data_dimensions()
|
||||
bpp=self.cav["BytesPerPixel"]
|
||||
dt="<u{}".format(int(np.ceil(bpp))) # can be fractional (e.g., 1.5)
|
||||
return np.zeros((n,)+dim,dtype=dt)
|
||||
def read_multiple_images(self, rng=None, peek=False, missing_frame="skip", return_info=False, return_rng=False):
|
||||
"""
|
||||
Read multiple images specified by `rng` (by default, all un-read images).
|
||||
|
||||
If `rng` is specified, it is a tuple ``(first, last)`` with images range (first inclusive).
|
||||
If no new frames are available, return an empty list; if no acquisition is running, return ``None``.
|
||||
If ``peek==True``, return images but not mark them as read.
|
||||
`missing_frame` determines what to do with frames which are out of range (missing or lost):
|
||||
can be ``"none"`` (replacing them with ``None``), ``"zero"`` (replacing them with zero-filled frame), or ``"skip"`` (skipping them).
|
||||
If ``return_info==True``, return tuple ``(frames, infos)``, where ``infos`` is a list of :class:`TFrameInfo` instances
|
||||
describing frame index and frame metadata, which contains timestamp, image size, pixel format, and row stride;
|
||||
if some frames are missing and ``missing_frame!="skip"``, the corresponding frame info is ``None``.
|
||||
if ``return_rng==True``, return the range covered resulting frames; if ``missing_frame=="skip"``, the range can be smaller
|
||||
than the supplied `rng` if some frames are skipped.
|
||||
"""
|
||||
return super().read_multiple_images(rng=rng,peek=peek,missing_frame=missing_frame,return_info=return_info,return_rng=return_rng)
|
||||
@@ -1,560 +0,0 @@
|
||||
from .base import AndorError, AndorNotSupportedError
|
||||
from .ShamrockCIF_lib import wlib as lib, ShamrockLibError, SHAMROCK_ERR, SHAMROCK_CONST
|
||||
from .AndorSDK2 import _camsel_lock
|
||||
|
||||
from ...core.devio import interface
|
||||
from ...core.utils import py3
|
||||
from ..utils import load_lib
|
||||
|
||||
import numpy as np
|
||||
import collections
|
||||
import functools
|
||||
|
||||
|
||||
_detector_ini_path=""
|
||||
class LibraryController(load_lib.LibraryController):
|
||||
def _do_init(self):
|
||||
self.lib.ShamrockInitialize(_detector_ini_path)
|
||||
def _do_uninit(self):
|
||||
try:
|
||||
self.lib.ShamrockClose()
|
||||
except ShamrockLibError as e:
|
||||
if e.code!=SHAMROCK_ERR.SHAMROCK_NOT_INITIALIZED:
|
||||
raise
|
||||
libctl=LibraryController(lib)
|
||||
def restart_lib():
|
||||
libctl.shutdown()
|
||||
|
||||
def list_spectrographs():
|
||||
"""Return list of serial numbers of all connected Shamrock spectrographs"""
|
||||
with libctl.temp_open():
|
||||
spec_num=lib.ShamrockGetNumberDevices()
|
||||
return [py3.as_str(lib.ShamrockGetSerialNumber(i)) for i in range(spec_num)]
|
||||
def get_spectrographs_number():
|
||||
"""Get number of connected Shamrock spectrographs"""
|
||||
return len(list_spectrographs())
|
||||
|
||||
|
||||
TDeviceInfo=collections.namedtuple("TDeviceInfo",["serial_number"])
|
||||
TOpticalParameters=collections.namedtuple("TOpticalParameters",["focal_length","angular_deviation","focal_tilt"])
|
||||
TGratingInfo=collections.namedtuple("TGratingInfo",["lines","blaze_wavelength","home","offset"])
|
||||
|
||||
def _specfunc(func):
|
||||
@functools.wraps(func)
|
||||
def wrapped(self, *args, **kwargs):
|
||||
if getattr(self,"_sync_with_SDK2",False):
|
||||
with _camsel_lock:
|
||||
return func(self,*args,**kwargs)
|
||||
return func(self,*args,**kwargs)
|
||||
return wrapped
|
||||
class ShamrockSpectrograph(interface.IDevice):
|
||||
"""
|
||||
Shamrock spectrograph.
|
||||
|
||||
Args:
|
||||
idx(int): spectrograph index (starting from 0; use :func:`list_spectrographs` to get the list of all connected spectrographs)
|
||||
"""
|
||||
Error=AndorError
|
||||
def __init__(self, idx=0):
|
||||
super().__init__()
|
||||
self.idx=idx
|
||||
self._opid=None
|
||||
self.open()
|
||||
|
||||
self._sync_with_SDK2=False
|
||||
self._add_info_variable("device_info",self.get_device_info)
|
||||
self._add_info_variable("optical_parameters",self.get_optical_parameters)
|
||||
self._add_info_variable("gratings_number",self.get_gratings_number)
|
||||
self._add_status_variable("grating_infos",lambda: [self.get_grating_info(g) for g in range(1,self.get_gratings_number()+1)])
|
||||
self._add_settings_variable("grating",self.get_grating,self.set_grating)
|
||||
self._add_settings_variable("grating_offsets",self._get_all_grating_offsets,self._set_all_grating_offsets)
|
||||
self._add_settings_variable("detector_offset",self.get_detector_offset,self.set_detector_offset)
|
||||
self._add_info_variable("wavelength_present",self.is_wavelength_control_present)
|
||||
self._add_info_variable("wavelength_limits",lambda: [self.get_wavelength_limits(g) for g in range(1,self.get_gratings_number()+1)],ignore_error=(AndorError,))
|
||||
self._add_settings_variable("wavelength",self.get_wavelength,self.set_wavelength,ignore_error=(AndorError,))
|
||||
self._add_status_variable("zero_order",self.is_at_zero_order,ignore_error=(AndorError,))
|
||||
self._add_info_variable("slits_present",lambda: [self.is_slit_present(s) for s in range(1,5)])
|
||||
self._add_settings_variable("slit_widths",self._get_all_slit_widths,self._set_all_slit_widths)
|
||||
self._add_info_variable("irises_present",lambda: [self.is_iris_present(s) for s in range(2)])
|
||||
self._add_settings_variable("iris_widths",self._get_all_iris_widths,self._set_all_iris_widths)
|
||||
self._add_settings_variable("focus_mirror_present",self.is_focus_mirror_present)
|
||||
self._add_settings_variable("focus_mirror",self.get_focus_mirror_position,self.set_focus_mirror_position,ignore_error=(AndorError,))
|
||||
self._add_info_variable("focus_mirror_max",self.get_focus_mirror_position_max,ignore_error=(AndorError,))
|
||||
self._add_info_variable("shutter_present",self.is_shutter_present)
|
||||
self._add_settings_variable("shutter_mode",self.get_shutter,self.set_shutter,ignore_error=(AndorError,))
|
||||
self._add_info_variable("filter_present",self.is_filter_present)
|
||||
self._add_settings_variable("filter",self.get_filter,self.set_filter,ignore_error=(AndorError,))
|
||||
self._add_info_variable("flippers_present",lambda: [self.is_flipper_present(s) for s in range(1,3)])
|
||||
self._add_settings_variable("flipper_ports",self._get_all_flipper_ports,self._set_all_flipper_ports)
|
||||
self._add_info_variable("accessory_present",self.is_accessory_present)
|
||||
self._add_settings_variable("accessory_states",self._get_all_accessory_states,self._set_all_accessory_states)
|
||||
self._add_settings_variable("pixel_width",self.get_pixel_width,self.set_pixel_width)
|
||||
self._add_settings_variable("number_pixels",self.get_number_pixels,self.set_number_pixels)
|
||||
self._add_status_variable("calibration",self.get_calibration)
|
||||
|
||||
def open(self):
|
||||
if self._opid:
|
||||
return
|
||||
with libctl.temp_open():
|
||||
ncams=get_spectrographs_number()
|
||||
if self.idx>=ncams:
|
||||
raise AndorError("spectrograph index {} is not available ({} spectrograph exist)".format(self.idx,ncams))
|
||||
self._opid=libctl.open().opid
|
||||
def close(self):
|
||||
if self._opid is None:
|
||||
return
|
||||
libctl.close(self._opid)
|
||||
self._opid=None
|
||||
def is_opened(self):
|
||||
return self._opid is not None
|
||||
def _get_connection_parameters(self):
|
||||
return (self.idx,)
|
||||
|
||||
@_specfunc
|
||||
def get_device_info(self):
|
||||
"""
|
||||
Get spectrograph device info.
|
||||
|
||||
Return tuple ``(serial_number)``.
|
||||
"""
|
||||
serial_number=py3.as_str(lib.ShamrockGetSerialNumber(self.idx))
|
||||
return TDeviceInfo(serial_number)
|
||||
@_specfunc
|
||||
def get_optical_parameters(self):
|
||||
"""
|
||||
Get device optical parameters.
|
||||
|
||||
Return tuple ``(focal_length, angular_deviation, focal_tilt)``.
|
||||
"""
|
||||
params=lib.ShamrockEepromGetOpticalParams(self.idx)
|
||||
return TOpticalParameters(*params)
|
||||
|
||||
|
||||
### Grating control ###
|
||||
@_specfunc
|
||||
def get_gratings_number(self):
|
||||
"""Get number of gratings"""
|
||||
return lib.ShamrockGetNumberGratings(self.idx)
|
||||
def _check_grating(self, grating):
|
||||
if grating is None:
|
||||
return self.get_grating()
|
||||
if grating<1 or grating>self.get_gratings_number():
|
||||
raise ValueError("incorrect grating index: {}; should be between 1 and {}".format(grating,self.get_gratings_number()))
|
||||
return grating
|
||||
@_specfunc
|
||||
def get_grating(self):
|
||||
"""Get current grating index (counting from 1)"""
|
||||
return lib.ShamrockGetGrating(self.idx)
|
||||
@_specfunc
|
||||
def set_grating(self, grating, force=False):
|
||||
"""
|
||||
Set current grating (counting from 1)
|
||||
|
||||
Call blocks until the grating is exchanged (up to 10-20 seconds).
|
||||
If ``force==False`` and the current grating index is the same as requested, skip the call;
|
||||
otherwise, call the grating set command regardless (takes about a second in the grating is unchanged).
|
||||
"""
|
||||
grating=self._check_grating(grating)
|
||||
if force or self.get_grating()!=grating:
|
||||
lib.ShamrockSetGrating(self.idx,grating)
|
||||
return self.get_grating()
|
||||
@_specfunc
|
||||
def get_grating_info(self, grating=None):
|
||||
"""
|
||||
Get info of a given grating (by default, current grating).
|
||||
|
||||
Return tuple ``(lines, blaze_wavelength, home, offset)`` (blazing wavelength is in nm).
|
||||
"""
|
||||
grating=self._check_grating(grating)
|
||||
lines,blaze_wavelength,home,offset=lib.ShamrockGetGratingInfo(self.idx,grating)
|
||||
return TGratingInfo(lines,py3.as_str(blaze_wavelength),home,offset)
|
||||
@_specfunc
|
||||
def get_grating_offset(self, grating=None):
|
||||
"""Get grating offset (in steps) for a given grating (by default, current grating)"""
|
||||
grating=self._check_grating(grating)
|
||||
return lib.ShamrockGetGratingOffset(self.idx,grating)
|
||||
@_specfunc
|
||||
def set_grating_offset(self, offset, grating=None):
|
||||
"""Set grating offset (in steps) for a given grating (by default, current grating)"""
|
||||
grating=self._check_grating(grating)
|
||||
lib.ShamrockSetGratingOffset(self.idx,grating,offset)
|
||||
return self.get_grating_offset(grating)
|
||||
def _get_all_grating_offsets(self):
|
||||
return [self.get_grating_offset(g) for g in range(1,self.get_gratings_number()+1)]
|
||||
def _set_all_grating_offsets(self, offsets):
|
||||
for g,o in enumerate(offsets,start=1):
|
||||
if o is not None:
|
||||
self.set_grating_offset(g,o)
|
||||
@_specfunc
|
||||
def get_detector_offset(self):
|
||||
"""Get detector offset (in steps)"""
|
||||
return lib.ShamrockGetDetectorOffset(self.idx)
|
||||
@_specfunc
|
||||
def set_detector_offset(self, offset):
|
||||
"""Set detector offset (in steps)"""
|
||||
lib.ShamrockSetDetectorOffset(self.idx,offset)
|
||||
return self.get_detector_offset()
|
||||
@_specfunc
|
||||
def get_turret(self):
|
||||
"""Get turret"""
|
||||
return lib.ShamrockGetTurret(self.idx)
|
||||
@_specfunc
|
||||
def set_turret(self, turret):
|
||||
"""Set turret"""
|
||||
lib.ShamrockSetTurret(self.idx,turret)
|
||||
return self.get_turret()
|
||||
|
||||
|
||||
### Wavelength control ###
|
||||
@_specfunc
|
||||
def is_wavelength_control_present(self):
|
||||
"""Check if wavelength control is present"""
|
||||
return bool(lib.ShamrockWavelengthIsPresent(self.idx))
|
||||
def _check_wavelength(self):
|
||||
if not self.is_wavelength_control_present():
|
||||
raise AndorNotSupportedError("wavelength control is not present")
|
||||
@_specfunc
|
||||
def get_wavelength(self):
|
||||
"""Get current central wavelength (in m)"""
|
||||
self._check_wavelength()
|
||||
return lib.ShamrockGetWavelength(self.idx)*1E-9
|
||||
@_specfunc
|
||||
def set_wavelength(self, wavelength):
|
||||
"""Get current central wavelength (in m)"""
|
||||
self._check_wavelength()
|
||||
lib.ShamrockSetWavelength(self.idx,wavelength/1E-9)
|
||||
return self.get_wavelength()
|
||||
@_specfunc
|
||||
def get_wavelength_limits(self, grating=None):
|
||||
"""Get wavelength limits (in m) for a given grating (by default, current grating)"""
|
||||
self._check_wavelength()
|
||||
grating=self._check_grating(grating)
|
||||
lim=lib.ShamrockGetWavelengthLimits(self.idx,grating)
|
||||
return lim[0]*1E-9,lim[1]*1E-9
|
||||
@_specfunc
|
||||
def reset_wavelength(self):
|
||||
"""Reset current wavelength to 0 nm"""
|
||||
self._check_wavelength()
|
||||
lib.ShamrockWavelengthReset(self.idx)
|
||||
return self.get_wavelength()
|
||||
@_specfunc
|
||||
def is_at_zero_order(self):
|
||||
"""Check if current grating is at zero order"""
|
||||
self._check_wavelength()
|
||||
return bool(lib.ShamrockAtZeroOrder(self.idx))
|
||||
@_specfunc
|
||||
def goto_zero_order(self):
|
||||
"""Set current grating to zero order"""
|
||||
self._check_wavelength()
|
||||
lib.ShamrockGotoZeroOrder(self.idx)
|
||||
return self.is_at_zero_order()
|
||||
|
||||
|
||||
### Slit control ###
|
||||
_p_slit_index=interface.EnumParameterClass("slit_index",
|
||||
{"input_side":SHAMROCK_CONST.SHAMROCK_INPUT_SLIT_SIDE,"input_direct":SHAMROCK_CONST.SHAMROCK_INPUT_SLIT_DIRECT,
|
||||
"output_side":SHAMROCK_CONST.SHAMROCK_OUTPUT_SLIT_SIDE,"output_direct":SHAMROCK_CONST.SHAMROCK_OUTPUT_SLIT_DIRECT})
|
||||
@interface.use_parameters(slit="slit_index")
|
||||
@_specfunc
|
||||
def is_slit_present(self, slit):
|
||||
"""
|
||||
Check if the slit is present.
|
||||
|
||||
`slit` cen be either a slit index (starting from 1), or one of the following: ``"input_side"``, ``"input_direct"``, ``"output_side"``, or ``"output_direct"``.
|
||||
"""
|
||||
return bool(lib.ShamrockAutoSlitIsPresent(self.idx,slit))
|
||||
def _check_slit(self, slit):
|
||||
if not self.is_slit_present(slit):
|
||||
raise AndorNotSupportedError("slit '{}' is not present".format(self._p_slit_index.i(slit)))
|
||||
@interface.use_parameters(slit="slit_index")
|
||||
@_specfunc
|
||||
def get_slit_width(self, slit):
|
||||
"""
|
||||
Get slit width (in m).
|
||||
|
||||
`slit` cen be either a slit index (starting from 1), or one of the following: ``"input_side"``, ``"input_direct"``, ``"output_side"``, or ``"output_direct"``.
|
||||
"""
|
||||
self._check_slit(slit)
|
||||
return lib.ShamrockGetAutoSlitWidth(self.idx,slit)*1E-6
|
||||
@interface.use_parameters(slit="slit_index")
|
||||
@_specfunc
|
||||
def set_slit_width(self, slit, width):
|
||||
"""
|
||||
Set slit width (in m).
|
||||
|
||||
`slit` cen be either a slit index (starting from 1), or one of the following: ``"input_side"``, ``"input_direct"``, ``"output_side"``, or ``"output_direct"``.
|
||||
"""
|
||||
self._check_slit(slit)
|
||||
lib.ShamrockSetAutoSlitWidth(self.idx,slit,width/1E-6)
|
||||
return self._wip.get_slit_width(slit)
|
||||
def _get_all_slit_widths(self):
|
||||
return [self.get_slit_width(s) if self.is_slit_present(s) else None for s in range(1,5)]
|
||||
def _set_all_slit_widths(self, widths):
|
||||
for s,w in enumerate(widths,start=1):
|
||||
if w is not None:
|
||||
self.set_slit_width(s,w)
|
||||
@interface.use_parameters(slit="slit_index")
|
||||
@_specfunc
|
||||
def reset_slit(self, slit):
|
||||
"""
|
||||
Reset slit to the default width (10 um).
|
||||
|
||||
`slit` cen be either a slit index (starting from 1), or one of the following: ``"input_side"``, ``"input_direct"``, ``"output_side"``, or ``"output_direct"``.
|
||||
"""
|
||||
self._check_slit(slit)
|
||||
lib.ShamrockAutoSlitReset(self.idx,slit)
|
||||
return self._wip.get_slit_width(slit)
|
||||
|
||||
|
||||
### Shutter control ###
|
||||
@_specfunc
|
||||
def is_shutter_present(self):
|
||||
"""Check if the shutter is present"""
|
||||
return bool(lib.ShamrockShutterIsPresent(self.idx))
|
||||
def _check_shutter(self):
|
||||
if not self.is_shutter_present():
|
||||
raise AndorNotSupportedError("shutter is not present")
|
||||
_p_shutter_mode=interface.EnumParameterClass("shutter_mode",{"closed":0,"opened":1,"bnc":2,"not_set":-1})
|
||||
@interface.use_parameters(_returns="shutter_mode")
|
||||
@_specfunc
|
||||
def get_shutter(self):
|
||||
"""
|
||||
Get shutter mode.
|
||||
|
||||
Can return ``"closed"``, ``"opened"``, ``"bnc"``, or ``"not_set"``.
|
||||
"""
|
||||
self._check_shutter()
|
||||
return lib.ShamrockGetShutter(self.idx)
|
||||
@interface.use_parameters(mode="shutter_mode")
|
||||
@_specfunc
|
||||
def is_shutter_mode_possible(self, mode):
|
||||
"""Check if the shutter mode (``"closed"``, ``"opened"``, or ``"bnc"``) is supported"""
|
||||
self._check_shutter()
|
||||
return mode>=0 and lib.ShamrockIsModePossible(self.idx,mode)
|
||||
@interface.use_parameters(mode="shutter_mode")
|
||||
@_specfunc
|
||||
def set_shutter(self, mode):
|
||||
"""Set shutter mode (``"closed"`` or ``"opened"``)"""
|
||||
self._check_shutter()
|
||||
if not self._wip.is_shutter_mode_possible(mode):
|
||||
raise AndorNotSupportedError("shutter mode '{}' is not supported".format(self._p_shutter_mode.i(mode)))
|
||||
if mode!=-1:
|
||||
lib.ShamrockSetShutter(self.idx,mode)
|
||||
return self.get_shutter()
|
||||
|
||||
|
||||
### Filter control ###
|
||||
@_specfunc
|
||||
def is_filter_present(self):
|
||||
"""Check if the filter is present"""
|
||||
return bool(lib.ShamrockFilterIsPresent(self.idx))
|
||||
def _check_filter(self):
|
||||
if not self.is_filter_present():
|
||||
raise AndorNotSupportedError("filter is not present")
|
||||
@_specfunc
|
||||
def get_filter(self):
|
||||
"""Get current filter"""
|
||||
self._check_filter()
|
||||
return lib.ShamrockGetFilter(self.idx)
|
||||
@_specfunc
|
||||
def set_filter(self, flt):
|
||||
"""Set current filter"""
|
||||
self._check_filter()
|
||||
lib.ShamrockSetFilter(self.idx,flt)
|
||||
return self.get_filter()
|
||||
@_specfunc
|
||||
def get_filter_info(self, flt):
|
||||
"""Get info of the given filter"""
|
||||
self._check_filter()
|
||||
return lib.ShamrockGetFilterInfo(self.idx,flt)
|
||||
@_specfunc
|
||||
def reset_filter(self):
|
||||
"""Reset filter to default position"""
|
||||
self._check_filter()
|
||||
lib.ShamrockFilterReset(self.idx)
|
||||
return self.get_filter()
|
||||
|
||||
|
||||
### Flipper control ###
|
||||
_p_flipper_index=interface.EnumParameterClass("flipper_index",{"input":1,"output":2})
|
||||
@interface.use_parameters(flipper="flipper_index")
|
||||
@_specfunc
|
||||
def is_flipper_present(self, flipper):
|
||||
"""
|
||||
Check if the flipper is present.
|
||||
|
||||
`flipper` can be a flipper index (starting from 1), ``"input"``, or `"output"``.
|
||||
"""
|
||||
return bool(lib.ShamrockFlipperMirrorIsPresent(self.idx,flipper))
|
||||
def _check_flipper(self, flipper):
|
||||
if not self.is_flipper_present(flipper):
|
||||
raise AndorNotSupportedError("flipper {} is not present".format(flipper))
|
||||
_p_flipper_port=interface.EnumParameterClass("flipper_port",{"direct":0,"side":1})
|
||||
@interface.use_parameters(flipper="flipper_index",_returns="flipper_port")
|
||||
@_specfunc
|
||||
def get_flipper_port(self, flipper):
|
||||
"""
|
||||
Get flipper port.
|
||||
|
||||
`flipper` can be a flipper index (starting from 1), ``"input"``, or `"output"``.
|
||||
Return either ``"direct"`` or ``"side"``.
|
||||
"""
|
||||
self._check_flipper(flipper)
|
||||
return lib.ShamrockGetFlipperMirror(self.idx,flipper)
|
||||
@interface.use_parameters(flipper="flipper_index",port="flipper_port")
|
||||
@_specfunc
|
||||
def set_flipper_port(self, flipper, port):
|
||||
"""
|
||||
Set flipper port.
|
||||
|
||||
`flipper` can be a flipper index (starting from 1), ``"input"``, or `"output"``.
|
||||
Port can be ``"direct"`` or ``"side"``.
|
||||
"""
|
||||
self._check_flipper(flipper)
|
||||
lib.ShamrockSetFlipperMirror(self.idx,flipper,port)
|
||||
return self._wip.get_flipper_port(flipper)
|
||||
def _get_all_flipper_ports(self):
|
||||
return [self.get_flipper_port(f) if self.is_flipper_present(f) else None for f in range(1,3)]
|
||||
def _set_all_flipper_ports(self, ports):
|
||||
for f,p in enumerate(ports,start=1):
|
||||
if p is not None:
|
||||
self.set_flipper_port(f,p)
|
||||
@interface.use_parameters(flipper="flipper_index")
|
||||
@_specfunc
|
||||
def reset_flipper(self, flipper):
|
||||
"""
|
||||
Reset flipper to the default state.
|
||||
|
||||
`flipper` can be a flipper index (starting from 1), ``"input"``, or `"output"``.
|
||||
"""
|
||||
self._check_flipper(flipper)
|
||||
lib.ShamrockFlipperMirrorReset(self.idx,flipper)
|
||||
return self._wip.get_flipper_port(flipper)
|
||||
|
||||
|
||||
### Iris control ###
|
||||
_p_iris_port=interface.EnumParameterClass("iris_port",{"direct":0,"side":1})
|
||||
@interface.use_parameters(iris="iris_port")
|
||||
@_specfunc
|
||||
def is_iris_present(self, iris):
|
||||
"""Check if the iris is present"""
|
||||
return bool(lib.ShamrockIrisIsPresent is not None and lib.ShamrockIrisIsPresent(self.idx,iris))
|
||||
def _check_iris(self, iris):
|
||||
if lib.ShamrockIrisIsPresent is None or not lib.ShamrockIrisIsPresent(self.idx,iris):
|
||||
raise AndorNotSupportedError("iris is not present")
|
||||
@interface.use_parameters(iris="iris_port")
|
||||
@_specfunc
|
||||
def get_iris_width(self, iris):
|
||||
"""Get current iris width (0 to 100)"""
|
||||
self._check_iris(iris)
|
||||
return lib.ShamrockGetIris(self.idx,iris)
|
||||
@interface.use_parameters(iris="iris_port")
|
||||
@_specfunc
|
||||
def set_iris_width(self, iris, width):
|
||||
"""Set current iris width (0 to 100)"""
|
||||
self._check_iris(iris)
|
||||
lib.ShamrockSetIris(self.idx,iris,int(width))
|
||||
return lib.ShamrockGetIris(self.idx,iris)
|
||||
def _get_all_iris_widths(self):
|
||||
return [self.get_iris_width(s) if self.is_iris_present(s) else None for s in range(2)]
|
||||
def _set_all_iris_widths(self, widths):
|
||||
for s,w in enumerate(widths):
|
||||
if w is not None:
|
||||
self.set_iris_width(s,w)
|
||||
|
||||
|
||||
### Focus mirror control ###
|
||||
@_specfunc
|
||||
def is_focus_mirror_present(self):
|
||||
"""Check if the focus mirror is present"""
|
||||
return bool(lib.ShamrockFocusMirrorIsPresent is not None and lib.ShamrockFocusMirrorIsPresent(self.idx))
|
||||
def _check_focus_mirror(self):
|
||||
if lib.ShamrockFocusMirrorIsPresent is None or not lib.ShamrockFocusMirrorIsPresent(self.idx):
|
||||
raise AndorNotSupportedError("focus mirror is not present")
|
||||
@_specfunc
|
||||
def get_focus_mirror_position(self):
|
||||
"""Get current focus mirror position"""
|
||||
self._check_focus_mirror()
|
||||
return lib.ShamrockGetFocusMirror(self.idx)
|
||||
@_specfunc
|
||||
def set_focus_mirror_position(self, position):
|
||||
"""Set current focus mirror position"""
|
||||
self._check_focus_mirror()
|
||||
lib.ShamrockSetFocusMirror(self.idx,int(position))
|
||||
return lib.ShamrockGetFocusMirror(self.idx)
|
||||
@_specfunc
|
||||
def get_focus_mirror_position_max(self):
|
||||
"""Get maximal focus mirror position"""
|
||||
self._check_focus_mirror()
|
||||
return lib.ShamrockGetFocusMirrorMaxSteps(self.idx)
|
||||
@_specfunc
|
||||
def reset_focus_mirror(self):
|
||||
"""Reset focus mirror position"""
|
||||
self._check_focus_mirror()
|
||||
return lib.ShamrockFocusMirrorReset(self.idx)
|
||||
|
||||
|
||||
### Accessory control ###
|
||||
@_specfunc
|
||||
def is_accessory_present(self):
|
||||
"""Check if the accessory is present"""
|
||||
return bool(lib.ShamrockAccessoryIsPresent(self.idx))
|
||||
def _check_accessory(self):
|
||||
if not self.is_accessory_present():
|
||||
raise AndorNotSupportedError("accessory is not present")
|
||||
@_specfunc
|
||||
def get_accessory_state(self, line):
|
||||
"""Get current accessory state on a given line (1 or 2)"""
|
||||
self._check_accessory()
|
||||
return lib.ShamrockGetAccessoryState(self.idx,line)
|
||||
@_specfunc
|
||||
def set_accessory_state(self, line, state):
|
||||
"""Set current accessory state (0 or 1) on a given line (1 or 2)"""
|
||||
self._check_accessory()
|
||||
lib.ShamrockSetAccessory(self.idx,line,state)
|
||||
return self.get_accessory_state(line)
|
||||
def _get_all_accessory_states(self):
|
||||
return [self.get_accessory_state(l) if self.is_accessory_present() else None for l in range(1,3)]
|
||||
def _set_all_accessory_states(self, states):
|
||||
for l,s in enumerate(states,start=1):
|
||||
if s is not None:
|
||||
self.set_accessory_state(l,s)
|
||||
|
||||
|
||||
### Calibration ###
|
||||
@_specfunc
|
||||
def get_pixel_width(self):
|
||||
"""Get current set detector pixel width (in m)"""
|
||||
return lib.ShamrockGetPixelWidth(self.idx)*1E-6
|
||||
@_specfunc
|
||||
def set_pixel_width(self, width):
|
||||
"""Set current detector pixel width (in m)"""
|
||||
lib.ShamrockSetPixelWidth(self.idx,width/1E-6)
|
||||
return self.get_pixel_width()
|
||||
@_specfunc
|
||||
def get_number_pixels(self):
|
||||
"""Get current set detector number of pixels"""
|
||||
return lib.ShamrockGetNumberPixels(self.idx)
|
||||
@_specfunc
|
||||
def set_number_pixels(self, number):
|
||||
"""Set current detector number of pixels"""
|
||||
lib.ShamrockSetNumberPixels(self.idx,number)
|
||||
return self.get_number_pixels()
|
||||
def setup_pixels_from_camera(self, cam):
|
||||
"""Setup detector parameters (number of pixels, pixel width) from the camera"""
|
||||
pixel_size=cam.get_pixel_size()
|
||||
det_size=cam.get_detector_size()
|
||||
self.set_pixel_width(pixel_size[0])
|
||||
self.set_number_pixels(det_size[0])
|
||||
return self.get_pixel_width(),self.get_number_pixels()
|
||||
@_specfunc
|
||||
def get_calibration(self):
|
||||
"""
|
||||
Get wavelength calibration.
|
||||
|
||||
Return numpy array which specifies wavelength (in m) corresponding to each pixel.
|
||||
Prior to calling this method, the total number of pixels and the pixel width of the sensor should be set up using the corresponding methods
|
||||
(:meth:`set_number_pixels` and :meth:`set_pixel_width`, or :meth:`setup_pixels_from_camera` to set both parameters using and AndorSDK2 camera instance)
|
||||
"""
|
||||
npx=self.get_number_pixels()
|
||||
return np.array(lib.ShamrockGetCalibration(self.idx,self.get_number_pixels()))*1E-9 if npx else np.zeros(0)
|
||||
@@ -1,518 +0,0 @@
|
||||
########## This file is generated automatically based on ShamrockCIF.h ##########
|
||||
|
||||
# pylint: disable=unused-import, unused-argument, wrong-spelling-in-comment
|
||||
|
||||
|
||||
import ctypes
|
||||
import enum
|
||||
from ...core.utils import ctypes_wrap
|
||||
|
||||
|
||||
|
||||
|
||||
def _int32(v): return (v+0x80000000)%0x100000000-0x80000000
|
||||
|
||||
|
||||
|
||||
|
||||
##### DEFINE GROUPS #####
|
||||
|
||||
|
||||
class SHAMROCK_ERR(enum.IntEnum):
|
||||
SHAMROCK_COMMUNICATION_ERROR = _int32(20201)
|
||||
SHAMROCK_SUCCESS = _int32(20202)
|
||||
SHAMROCK_P1INVALID = _int32(20266)
|
||||
SHAMROCK_P2INVALID = _int32(20267)
|
||||
SHAMROCK_P3INVALID = _int32(20268)
|
||||
SHAMROCK_P4INVALID = _int32(20269)
|
||||
SHAMROCK_P5INVALID = _int32(20270)
|
||||
SHAMROCK_NOT_INITIALIZED = _int32(20275)
|
||||
SHAMROCK_NOT_AVAILABLE = _int32(20292)
|
||||
dSHAMROCK_ERR={a.name:a.value for a in SHAMROCK_ERR}
|
||||
drSHAMROCK_ERR={a.value:a.name for a in SHAMROCK_ERR}
|
||||
|
||||
|
||||
class SHAMROCK_CONST(enum.IntEnum):
|
||||
SHAMROCK_ACCESSORYMIN = _int32(0)
|
||||
SHAMROCK_ACCESSORYMAX = _int32(1)
|
||||
SHAMROCK_FILTERMIN = _int32(1)
|
||||
SHAMROCK_FILTERMAX = _int32(6)
|
||||
SHAMROCK_TURRETMIN = _int32(1)
|
||||
SHAMROCK_TURRETMAX = _int32(3)
|
||||
SHAMROCK_GRATINGMIN = _int32(1)
|
||||
SHAMROCK_SLITWIDTHMIN = _int32(10)
|
||||
SHAMROCK_SLITWIDTHMAX = _int32(2500)
|
||||
SHAMROCK_I24SLITWIDTHMAX = _int32(24000)
|
||||
SHAMROCK_SHUTTERMODEMIN = _int32(0)
|
||||
SHAMROCK_SHUTTERMODEMAX = _int32(2)
|
||||
SHAMROCK_DET_OFFSET_MIN = _int32(-240000)
|
||||
SHAMROCK_DET_OFFSET_MAX = _int32(240000)
|
||||
SHAMROCK_GRAT_OFFSET_MIN = _int32(-20000)
|
||||
SHAMROCK_GRAT_OFFSET_MAX = _int32(20000)
|
||||
SHAMROCK_SLIT_INDEX_MIN = _int32(1)
|
||||
SHAMROCK_SLIT_INDEX_MAX = _int32(4)
|
||||
SHAMROCK_INPUT_SLIT_SIDE = _int32(1)
|
||||
SHAMROCK_INPUT_SLIT_DIRECT = _int32(2)
|
||||
SHAMROCK_OUTPUT_SLIT_SIDE = _int32(3)
|
||||
SHAMROCK_OUTPUT_SLIT_DIRECT = _int32(4)
|
||||
SHAMROCK_FLIPPER_INDEX_MIN = _int32(1)
|
||||
SHAMROCK_FLIPPER_INDEX_MAX = _int32(2)
|
||||
SHAMROCK_PORTMIN = _int32(0)
|
||||
SHAMROCK_PORTMAX = _int32(1)
|
||||
SHAMROCK_INPUT_FLIPPER = _int32(1)
|
||||
SHAMROCK_OUTPUT_FLIPPER = _int32(2)
|
||||
SHAMROCK_DIRECT_PORT = _int32(0)
|
||||
SHAMROCK_SIDE_PORT = _int32(1)
|
||||
dSHAMROCK_CONST={a.name:a.value for a in SHAMROCK_CONST}
|
||||
drSHAMROCK_CONST={a.value:a.name for a in SHAMROCK_CONST}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##### TYPE DEFINITIONS #####
|
||||
|
||||
|
||||
BYTE=ctypes.c_ubyte
|
||||
PBYTE=ctypes.POINTER(BYTE)
|
||||
CHAR=ctypes.c_char
|
||||
PCHAR=ctypes.c_char_p
|
||||
UCHAR=ctypes.c_ubyte
|
||||
PUCHAR=ctypes.POINTER(UCHAR)
|
||||
ULONG_PTR=ctypes.c_uint64
|
||||
LONG_PTR=ctypes.c_int64
|
||||
WORD=ctypes.c_ushort
|
||||
DWORD=ctypes.c_ulong
|
||||
LPWORD=ctypes.POINTER(WORD)
|
||||
LONG=ctypes.c_long
|
||||
LONGLONG=ctypes.c_int64
|
||||
LPLONG=ctypes.POINTER(ctypes.c_long)
|
||||
HANDLE=ctypes.c_void_p
|
||||
LPHANDLE=ctypes.POINTER(HANDLE)
|
||||
PHANDLE=ctypes.POINTER(HANDLE)
|
||||
HWND=ctypes.c_void_p
|
||||
HGLOBAL=ctypes.c_void_p
|
||||
HINSTANCE=ctypes.c_void_p
|
||||
HDC=ctypes.c_void_p
|
||||
HMODULE=ctypes.c_void_p
|
||||
HKEY=ctypes.c_void_p
|
||||
PVOID=ctypes.c_void_p
|
||||
LPVOID=ctypes.c_void_p
|
||||
class RECT(ctypes.Structure):
|
||||
_fields_=[ ("left",LONG),
|
||||
("top",LONG),
|
||||
("right",LONG),
|
||||
("bottom",LONG) ]
|
||||
PRECT=ctypes.POINTER(RECT)
|
||||
class CRECT(ctypes_wrap.CStructWrapper):
|
||||
_struct=RECT
|
||||
|
||||
|
||||
class BITMAPINFOHEADER(ctypes.Structure):
|
||||
_fields_=[ ("biSize",DWORD),
|
||||
("biWidth",LONG),
|
||||
("biHeight",LONG),
|
||||
("biPlanes",WORD),
|
||||
("biBitCount",WORD),
|
||||
("biCompression",DWORD),
|
||||
("biSizeImage",DWORD),
|
||||
("biXPelsPerMeter",LONG),
|
||||
("biYPelsPerMeter",LONG),
|
||||
("biClrUsed",DWORD),
|
||||
("biClrImportant",DWORD) ]
|
||||
PBITMAPINFOHEADER=ctypes.POINTER(BITMAPINFOHEADER)
|
||||
class CBITMAPINFOHEADER(ctypes_wrap.CStructWrapper):
|
||||
_struct=BITMAPINFOHEADER
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##### FUNCTION DEFINITIONS #####
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def addfunc(lib, name, restype, argtypes=None, argnames=None):
|
||||
if getattr(lib,name,None) is None:
|
||||
setattr(lib,name,None)
|
||||
else:
|
||||
func=getattr(lib,name)
|
||||
func.restype=restype
|
||||
if argtypes is not None:
|
||||
func.argtypes=argtypes
|
||||
if argnames is not None:
|
||||
func.argnames=argnames
|
||||
|
||||
def define_functions(lib):
|
||||
# ctypes.c_uint ShamrockInitialize(ctypes.c_char_p IniPath)
|
||||
addfunc(lib, "ShamrockInitialize", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_char_p],
|
||||
argnames = ["IniPath"] )
|
||||
# ctypes.c_uint ShamrockClose()
|
||||
addfunc(lib, "ShamrockClose", restype = ctypes.c_uint,
|
||||
argtypes = [],
|
||||
argnames = [] )
|
||||
# ctypes.c_uint ShamrockGetNumberDevices(ctypes.POINTER(ctypes.c_int) nodevices)
|
||||
addfunc(lib, "ShamrockGetNumberDevices", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["nodevices"] )
|
||||
# ctypes.c_uint ShamrockGetFunctionReturnDescription(ctypes.c_int error, ctypes.c_char_p description, ctypes.c_int MaxDescStrLen)
|
||||
addfunc(lib, "ShamrockGetFunctionReturnDescription", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_char_p, ctypes.c_int],
|
||||
argnames = ["error", "description", "MaxDescStrLen"] )
|
||||
# ctypes.c_uint ShamrockGetSerialNumber(ctypes.c_int device, ctypes.c_char_p serial)
|
||||
addfunc(lib, "ShamrockGetSerialNumber", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_char_p],
|
||||
argnames = ["device", "serial"] )
|
||||
# ctypes.c_uint ShamrockEepromSetOpticalParams(ctypes.c_int device, ctypes.c_float FocalLength, ctypes.c_float AngularDeviation, ctypes.c_float FocalTilt)
|
||||
addfunc(lib, "ShamrockEepromSetOpticalParams", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_float, ctypes.c_float, ctypes.c_float],
|
||||
argnames = ["device", "FocalLength", "AngularDeviation", "FocalTilt"] )
|
||||
# ctypes.c_uint ShamrockEepromGetOpticalParams(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) FocalLength, ctypes.POINTER(ctypes.c_float) AngularDeviation, ctypes.POINTER(ctypes.c_float) FocalTilt)
|
||||
addfunc(lib, "ShamrockEepromGetOpticalParams", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "FocalLength", "AngularDeviation", "FocalTilt"] )
|
||||
# ctypes.c_uint ShamrockSetGrating(ctypes.c_int device, ctypes.c_int grating)
|
||||
addfunc(lib, "ShamrockSetGrating", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "grating"] )
|
||||
# ctypes.c_uint ShamrockGetGrating(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) grating)
|
||||
addfunc(lib, "ShamrockGetGrating", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "grating"] )
|
||||
# ctypes.c_uint ShamrockWavelengthReset(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockWavelengthReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
# ctypes.c_uint ShamrockGetNumberGratings(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) noGratings)
|
||||
addfunc(lib, "ShamrockGetNumberGratings", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "noGratings"] )
|
||||
# ctypes.c_uint ShamrockGetGratingInfo(ctypes.c_int device, ctypes.c_int Grating, ctypes.POINTER(ctypes.c_float) Lines, ctypes.c_char_p Blaze, ctypes.POINTER(ctypes.c_int) Home, ctypes.POINTER(ctypes.c_int) Offset)
|
||||
addfunc(lib, "ShamrockGetGratingInfo", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_float), ctypes.c_char_p, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "Grating", "Lines", "Blaze", "Home", "Offset"] )
|
||||
# ctypes.c_uint ShamrockSetDetectorOffset(ctypes.c_int device, ctypes.c_int offset)
|
||||
addfunc(lib, "ShamrockSetDetectorOffset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "offset"] )
|
||||
# ctypes.c_uint ShamrockGetDetectorOffset(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) offset)
|
||||
addfunc(lib, "ShamrockGetDetectorOffset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "offset"] )
|
||||
# ctypes.c_uint ShamrockSetDetectorOffsetPort2(ctypes.c_int device, ctypes.c_int offset)
|
||||
addfunc(lib, "ShamrockSetDetectorOffsetPort2", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "offset"] )
|
||||
# ctypes.c_uint ShamrockGetDetectorOffsetPort2(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) offset)
|
||||
addfunc(lib, "ShamrockGetDetectorOffsetPort2", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "offset"] )
|
||||
# ctypes.c_uint ShamrockSetDetectorOffsetEx(ctypes.c_int device, ctypes.c_int entrancePort, ctypes.c_int exitPort, ctypes.c_int offset)
|
||||
addfunc(lib, "ShamrockSetDetectorOffsetEx", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "entrancePort", "exitPort", "offset"] )
|
||||
# ctypes.c_uint ShamrockGetDetectorOffsetEx(ctypes.c_int device, ctypes.c_int entrancePort, ctypes.c_int exitPort, ctypes.POINTER(ctypes.c_int) offset)
|
||||
addfunc(lib, "ShamrockGetDetectorOffsetEx", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "entrancePort", "exitPort", "offset"] )
|
||||
# ctypes.c_uint ShamrockSetGratingOffset(ctypes.c_int device, ctypes.c_int Grating, ctypes.c_int offset)
|
||||
addfunc(lib, "ShamrockSetGratingOffset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "Grating", "offset"] )
|
||||
# ctypes.c_uint ShamrockGetGratingOffset(ctypes.c_int device, ctypes.c_int Grating, ctypes.POINTER(ctypes.c_int) offset)
|
||||
addfunc(lib, "ShamrockGetGratingOffset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "Grating", "offset"] )
|
||||
# ctypes.c_uint ShamrockGratingIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockGratingIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetTurret(ctypes.c_int device, ctypes.c_int Turret)
|
||||
addfunc(lib, "ShamrockSetTurret", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "Turret"] )
|
||||
# ctypes.c_uint ShamrockGetTurret(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) Turret)
|
||||
addfunc(lib, "ShamrockGetTurret", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "Turret"] )
|
||||
# ctypes.c_uint ShamrockSetWavelength(ctypes.c_int device, ctypes.c_float wavelength)
|
||||
addfunc(lib, "ShamrockSetWavelength", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_float],
|
||||
argnames = ["device", "wavelength"] )
|
||||
# ctypes.c_uint ShamrockGetWavelength(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) wavelength)
|
||||
addfunc(lib, "ShamrockGetWavelength", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "wavelength"] )
|
||||
# ctypes.c_uint ShamrockGotoZeroOrder(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockGotoZeroOrder", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
# ctypes.c_uint ShamrockAtZeroOrder(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) atZeroOrder)
|
||||
addfunc(lib, "ShamrockAtZeroOrder", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "atZeroOrder"] )
|
||||
# ctypes.c_uint ShamrockGetWavelengthLimits(ctypes.c_int device, ctypes.c_int Grating, ctypes.POINTER(ctypes.c_float) Min, ctypes.POINTER(ctypes.c_float) Max)
|
||||
addfunc(lib, "ShamrockGetWavelengthLimits", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "Grating", "Min", "Max"] )
|
||||
# ctypes.c_uint ShamrockWavelengthIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockWavelengthIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetAutoSlitWidth(ctypes.c_int device, ctypes.c_int index, ctypes.c_float width)
|
||||
addfunc(lib, "ShamrockSetAutoSlitWidth", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_float],
|
||||
argnames = ["device", "index", "width"] )
|
||||
# ctypes.c_uint ShamrockGetAutoSlitWidth(ctypes.c_int device, ctypes.c_int index, ctypes.POINTER(ctypes.c_float) width)
|
||||
addfunc(lib, "ShamrockGetAutoSlitWidth", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "index", "width"] )
|
||||
# ctypes.c_uint ShamrockAutoSlitReset(ctypes.c_int device, ctypes.c_int index)
|
||||
addfunc(lib, "ShamrockAutoSlitReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "index"] )
|
||||
# ctypes.c_uint ShamrockAutoSlitIsPresent(ctypes.c_int device, ctypes.c_int index, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockAutoSlitIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "index", "present"] )
|
||||
# ctypes.c_uint ShamrockSetAutoSlitCoefficients(ctypes.c_int device, ctypes.c_int index, ctypes.c_int x1, ctypes.c_int y1, ctypes.c_int x2, ctypes.c_int y2)
|
||||
addfunc(lib, "ShamrockSetAutoSlitCoefficients", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "index", "x1", "y1", "x2", "y2"] )
|
||||
# ctypes.c_uint ShamrockGetAutoSlitCoefficients(ctypes.c_int device, ctypes.c_int index, ctypes.POINTER(ctypes.c_int) x1, ctypes.POINTER(ctypes.c_int) y1, ctypes.POINTER(ctypes.c_int) x2, ctypes.POINTER(ctypes.c_int) y2)
|
||||
addfunc(lib, "ShamrockGetAutoSlitCoefficients", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "index", "x1", "y1", "x2", "y2"] )
|
||||
# ctypes.c_uint ShamrockSetSlitZeroPosition(ctypes.c_int device, ctypes.c_int index, ctypes.c_int offset)
|
||||
addfunc(lib, "ShamrockSetSlitZeroPosition", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "index", "offset"] )
|
||||
# ctypes.c_uint ShamrockGetSlitZeroPosition(ctypes.c_int device, ctypes.c_int index, ctypes.POINTER(ctypes.c_int) offset)
|
||||
addfunc(lib, "ShamrockGetSlitZeroPosition", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "index", "offset"] )
|
||||
# ctypes.c_uint ShamrockSetSlit(ctypes.c_int device, ctypes.c_float width)
|
||||
addfunc(lib, "ShamrockSetSlit", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_float],
|
||||
argnames = ["device", "width"] )
|
||||
# ctypes.c_uint ShamrockGetSlit(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) width)
|
||||
addfunc(lib, "ShamrockGetSlit", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "width"] )
|
||||
# ctypes.c_uint ShamrockSlitReset(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockSlitReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
# ctypes.c_uint ShamrockSlitIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockSlitIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetSlitCoefficients(ctypes.c_int device, ctypes.c_int x1, ctypes.c_int y1, ctypes.c_int x2, ctypes.c_int y2)
|
||||
addfunc(lib, "ShamrockSetSlitCoefficients", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "x1", "y1", "x2", "y2"] )
|
||||
# ctypes.c_uint ShamrockGetSlitCoefficients(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) x1, ctypes.POINTER(ctypes.c_int) y1, ctypes.POINTER(ctypes.c_int) x2, ctypes.POINTER(ctypes.c_int) y2)
|
||||
addfunc(lib, "ShamrockGetSlitCoefficients", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "x1", "y1", "x2", "y2"] )
|
||||
# ctypes.c_uint ShamrockSetOutputSlit(ctypes.c_int device, ctypes.c_float width)
|
||||
addfunc(lib, "ShamrockSetOutputSlit", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_float],
|
||||
argnames = ["device", "width"] )
|
||||
# ctypes.c_uint ShamrockGetOutputSlit(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) width)
|
||||
addfunc(lib, "ShamrockGetOutputSlit", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "width"] )
|
||||
# ctypes.c_uint ShamrockOutputSlitReset(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockOutputSlitReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
# ctypes.c_uint ShamrockOutputSlitIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockOutputSlitIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetShutter(ctypes.c_int device, ctypes.c_int mode)
|
||||
addfunc(lib, "ShamrockSetShutter", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "mode"] )
|
||||
# ctypes.c_uint ShamrockGetShutter(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) mode)
|
||||
addfunc(lib, "ShamrockGetShutter", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "mode"] )
|
||||
# ctypes.c_uint ShamrockIsModePossible(ctypes.c_int device, ctypes.c_int mode, ctypes.POINTER(ctypes.c_int) possible)
|
||||
addfunc(lib, "ShamrockIsModePossible", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "mode", "possible"] )
|
||||
# ctypes.c_uint ShamrockShutterIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockShutterIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetFilter(ctypes.c_int device, ctypes.c_int filter)
|
||||
addfunc(lib, "ShamrockSetFilter", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "filter"] )
|
||||
# ctypes.c_uint ShamrockGetFilter(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) filter)
|
||||
addfunc(lib, "ShamrockGetFilter", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "filter"] )
|
||||
# ctypes.c_uint ShamrockGetFilterInfo(ctypes.c_int device, ctypes.c_int Filter, ctypes.c_char_p Info)
|
||||
addfunc(lib, "ShamrockGetFilterInfo", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_char_p],
|
||||
argnames = ["device", "Filter", "Info"] )
|
||||
# ctypes.c_uint ShamrockSetFilterInfo(ctypes.c_int device, ctypes.c_int Filter, ctypes.c_char_p Info)
|
||||
addfunc(lib, "ShamrockSetFilterInfo", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_char_p],
|
||||
argnames = ["device", "Filter", "Info"] )
|
||||
# ctypes.c_uint ShamrockFilterReset(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockFilterReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
# ctypes.c_uint ShamrockFilterIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockFilterIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetFlipperMirror(ctypes.c_int device, ctypes.c_int flipper, ctypes.c_int port)
|
||||
addfunc(lib, "ShamrockSetFlipperMirror", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "flipper", "port"] )
|
||||
# ctypes.c_uint ShamrockGetFlipperMirror(ctypes.c_int device, ctypes.c_int flipper, ctypes.POINTER(ctypes.c_int) port)
|
||||
addfunc(lib, "ShamrockGetFlipperMirror", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "flipper", "port"] )
|
||||
# ctypes.c_uint ShamrockFlipperMirrorReset(ctypes.c_int device, ctypes.c_int flipper)
|
||||
addfunc(lib, "ShamrockFlipperMirrorReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "flipper"] )
|
||||
# ctypes.c_uint ShamrockFlipperMirrorIsPresent(ctypes.c_int device, ctypes.c_int flipper, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockFlipperMirrorIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "flipper", "present"] )
|
||||
# ctypes.c_uint ShamrockGetCCDLimits(ctypes.c_int device, ctypes.c_int port, ctypes.POINTER(ctypes.c_float) Low, ctypes.POINTER(ctypes.c_float) High)
|
||||
addfunc(lib, "ShamrockGetCCDLimits", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "port", "Low", "High"] )
|
||||
# ctypes.c_uint ShamrockSetFlipperMirrorPosition(ctypes.c_int device, ctypes.c_int flipper, ctypes.c_int position)
|
||||
addfunc(lib, "ShamrockSetFlipperMirrorPosition", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "flipper", "position"] )
|
||||
# ctypes.c_uint ShamrockGetFlipperMirrorPosition(ctypes.c_int device, ctypes.c_int flipper, ctypes.POINTER(ctypes.c_int) position)
|
||||
addfunc(lib, "ShamrockGetFlipperMirrorPosition", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "flipper", "position"] )
|
||||
# ctypes.c_uint ShamrockGetFlipperMirrorMaxPosition(ctypes.c_int device, ctypes.c_int flipper, ctypes.POINTER(ctypes.c_int) max)
|
||||
addfunc(lib, "ShamrockGetFlipperMirrorMaxPosition", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "flipper", "max"] )
|
||||
# ctypes.c_uint ShamrockSetPort(ctypes.c_int device, ctypes.c_int port)
|
||||
addfunc(lib, "ShamrockSetPort", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "port"] )
|
||||
# ctypes.c_uint ShamrockGetPort(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) port)
|
||||
addfunc(lib, "ShamrockGetPort", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "port"] )
|
||||
# ctypes.c_uint ShamrockFlipperReset(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockFlipperReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
# ctypes.c_uint ShamrockFlipperIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockFlipperIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetAccessory(ctypes.c_int device, ctypes.c_int Accessory, ctypes.c_int State)
|
||||
addfunc(lib, "ShamrockSetAccessory", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "Accessory", "State"] )
|
||||
# ctypes.c_uint ShamrockGetAccessoryState(ctypes.c_int device, ctypes.c_int Accessory, ctypes.POINTER(ctypes.c_int) state)
|
||||
addfunc(lib, "ShamrockGetAccessoryState", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "Accessory", "state"] )
|
||||
# ctypes.c_uint ShamrockAccessoryIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockAccessoryIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetFocusMirror(ctypes.c_int device, ctypes.c_int focus)
|
||||
addfunc(lib, "ShamrockSetFocusMirror", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "focus"] )
|
||||
# ctypes.c_uint ShamrockGetFocusMirror(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) focus)
|
||||
addfunc(lib, "ShamrockGetFocusMirror", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "focus"] )
|
||||
# ctypes.c_uint ShamrockGetFocusMirrorMaxSteps(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) steps)
|
||||
addfunc(lib, "ShamrockGetFocusMirrorMaxSteps", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "steps"] )
|
||||
# ctypes.c_uint ShamrockFocusMirrorReset(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockFocusMirrorReset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
# ctypes.c_uint ShamrockFocusMirrorIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockFocusMirrorIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetPixelWidth(ctypes.c_int device, ctypes.c_float Width)
|
||||
addfunc(lib, "ShamrockSetPixelWidth", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_float],
|
||||
argnames = ["device", "Width"] )
|
||||
# ctypes.c_uint ShamrockSetNumberPixels(ctypes.c_int device, ctypes.c_int NumberPixels)
|
||||
addfunc(lib, "ShamrockSetNumberPixels", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "NumberPixels"] )
|
||||
# ctypes.c_uint ShamrockGetPixelWidth(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) Width)
|
||||
addfunc(lib, "ShamrockGetPixelWidth", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "Width"] )
|
||||
# ctypes.c_uint ShamrockGetNumberPixels(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) NumberPixels)
|
||||
addfunc(lib, "ShamrockGetNumberPixels", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "NumberPixels"] )
|
||||
# ctypes.c_uint ShamrockGetCalibration(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) CalibrationValues, ctypes.c_int NumberPixels)
|
||||
addfunc(lib, "ShamrockGetCalibration", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_float), ctypes.c_int],
|
||||
argnames = ["device", "CalibrationValues", "NumberPixels"] )
|
||||
# ctypes.c_uint ShamrockGetPixelCalibrationCoefficients(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) A, ctypes.POINTER(ctypes.c_float) B, ctypes.POINTER(ctypes.c_float) C, ctypes.POINTER(ctypes.c_float) D)
|
||||
addfunc(lib, "ShamrockGetPixelCalibrationCoefficients", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float)],
|
||||
argnames = ["device", "A", "B", "C", "D"] )
|
||||
# ctypes.c_uint ShamrockIrisIsPresent(ctypes.c_int device, ctypes.c_int iris, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockIrisIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "iris", "present"] )
|
||||
# ctypes.c_uint ShamrockSetIris(ctypes.c_int device, ctypes.c_int iris, ctypes.c_int value)
|
||||
addfunc(lib, "ShamrockSetIris", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "iris", "value"] )
|
||||
# ctypes.c_uint ShamrockGetIris(ctypes.c_int device, ctypes.c_int iris, ctypes.POINTER(ctypes.c_int) value)
|
||||
addfunc(lib, "ShamrockGetIris", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "iris", "value"] )
|
||||
# ctypes.c_uint ShamrockFocusMirrorTiltIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
addfunc(lib, "ShamrockFocusMirrorTiltIsPresent", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "present"] )
|
||||
# ctypes.c_uint ShamrockSetFocusMirrorTilt(ctypes.c_int device, ctypes.c_int tilt)
|
||||
addfunc(lib, "ShamrockSetFocusMirrorTilt", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "tilt"] )
|
||||
# ctypes.c_uint ShamrockGetFocusMirrorTilt(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) tilt)
|
||||
addfunc(lib, "ShamrockGetFocusMirrorTilt", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "tilt"] )
|
||||
# ctypes.c_uint ShamrockSetFocusMirrorTiltOffset(ctypes.c_int device, ctypes.c_int entrancePort, ctypes.c_int exitPort, ctypes.c_int offset)
|
||||
addfunc(lib, "ShamrockSetFocusMirrorTiltOffset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int],
|
||||
argnames = ["device", "entrancePort", "exitPort", "offset"] )
|
||||
# ctypes.c_uint ShamrockGetFocusMirrorTiltOffset(ctypes.c_int device, ctypes.c_int entrancePort, ctypes.c_int exitPort, ctypes.POINTER(ctypes.c_int) offset)
|
||||
addfunc(lib, "ShamrockGetFocusMirrorTiltOffset", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["device", "entrancePort", "exitPort", "offset"] )
|
||||
# ctypes.c_uint ShamrockMoveTurretToSafeChangePosition(ctypes.c_int device)
|
||||
addfunc(lib, "ShamrockMoveTurretToSafeChangePosition", restype = ctypes.c_uint,
|
||||
argtypes = [ctypes.c_int],
|
||||
argnames = ["device"] )
|
||||
|
||||
|
||||
@@ -1,254 +0,0 @@
|
||||
# pylint: disable=spelling
|
||||
|
||||
from . import ShamrockCIF_defs # pylint: disable=unused-import
|
||||
from .ShamrockCIF_defs import SHAMROCK_ERR, drSHAMROCK_ERR
|
||||
from .ShamrockCIF_defs import SHAMROCK_CONST # pylint: disable=unused-import
|
||||
from .ShamrockCIF_defs import define_functions
|
||||
from .base import AndorError
|
||||
|
||||
from ...core.utils import ctypes_wrap, py3
|
||||
from ..utils import load_lib
|
||||
|
||||
import platform
|
||||
import ctypes
|
||||
import os
|
||||
|
||||
|
||||
|
||||
class ShamrockLibError(AndorError):
|
||||
"""Generic Andor Shamrock library error"""
|
||||
def __init__(self, func, code, lib=None):
|
||||
self.func=func
|
||||
self.code=code
|
||||
self.name=drSHAMROCK_ERR.get(self.code,"UNKNOWN")
|
||||
self.desc=""
|
||||
try:
|
||||
if lib is not None:
|
||||
self.desc=py3.as_str(lib.ShamrockGetFunctionReturnDescription(code))
|
||||
except ShamrockLibError:
|
||||
pass
|
||||
msg="function '{}' raised error {}({}): {}".format(func,code,self.name,self.desc)
|
||||
super().__init__(msg)
|
||||
def errcheck(passing=None, lib=None):
|
||||
"""
|
||||
Build an error checking function.
|
||||
|
||||
Return a function which checks return codes of Andor Shamrock library functions.
|
||||
`passing` is a list specifying which return codes are acceptable (by default only 0, which is success code, is acceptable).
|
||||
"""
|
||||
passing=set(passing) if passing is not None else set()
|
||||
passing.add(SHAMROCK_ERR.SHAMROCK_SUCCESS) # always allow success
|
||||
def errchecker(result, func, arguments): # pylint: disable=unused-argument
|
||||
if result not in passing:
|
||||
raise ShamrockLibError(func.__name__,result,lib=lib)
|
||||
return result
|
||||
return errchecker
|
||||
|
||||
|
||||
|
||||
|
||||
class ShamrockLib:
|
||||
def __init__(self):
|
||||
self._initialized=False
|
||||
|
||||
def initlib(self):
|
||||
if self._initialized:
|
||||
return
|
||||
|
||||
solis_path=load_lib.get_program_files_folder("Andor SOLIS")
|
||||
shamrock_path=os.path.join(solis_path,"Shamrock")
|
||||
sdk2_path=load_lib.get_program_files_folder("Andor SDK")
|
||||
archbit=platform.architecture()[0][:2]
|
||||
error_message="The library is automatically supplied with Andor SDK2 software or micromanager plugin\n"+load_lib.par_error_message.format("andor_shamrock")
|
||||
lib_names=["atspectrograph.dll","ShamrockCIF{}.dll".format(archbit),"ShamrockCIF.dll"]
|
||||
depends=["atshamrock.dll","atshamrock{}.dll".format(archbit),"atmcd{}d.dll".format(archbit),"atmcd{}d_legacy.dll".format(archbit)]
|
||||
locations=["parameter/andor_shamrock",sdk2_path,solis_path,shamrock_path,"global"]
|
||||
self.lib=load_lib.load_lib(lib_names,locations=locations,depends=depends,depends_required=False,error_message=error_message,call_conv="stdcall")
|
||||
lib=self.lib
|
||||
define_functions(lib)
|
||||
|
||||
wrapper=ctypes_wrap.CFunctionWrapper(errcheck=errcheck(lib=self),default_rvals="pointer")
|
||||
default_strlen=256
|
||||
strprep=ctypes_wrap.strprep(default_strlen)
|
||||
|
||||
|
||||
# ctypes.c_uint ShamrockInitialize(ctypes.c_char_p IniPath)
|
||||
self.ShamrockInitialize=wrapper(lib.ShamrockInitialize)
|
||||
# ctypes.c_uint ShamrockClose()
|
||||
self.ShamrockClose=wrapper(lib.ShamrockClose)
|
||||
# ctypes.c_uint ShamrockGetFunctionReturnDescription(ctypes.c_int error, ctypes.c_char_p description, ctypes.c_int MaxDescStrLen)
|
||||
self.ShamrockGetFunctionReturnDescription=wrapper(lib.ShamrockGetFunctionReturnDescription, args=["error"], rvals=["description"],
|
||||
argprep={"description":strprep,"MaxDescStrLen":default_strlen}, byref=[], errcheck=errcheck())
|
||||
|
||||
# ctypes.c_uint ShamrockGetNumberDevices(ctypes.POINTER(ctypes.c_int) nodevices)
|
||||
self.ShamrockGetNumberDevices=wrapper(lib.ShamrockGetNumberDevices)
|
||||
# ctypes.c_uint ShamrockGetSerialNumber(ctypes.c_int device, ctypes.c_char_p serial)
|
||||
self.ShamrockGetSerialNumber=wrapper(lib.ShamrockGetSerialNumber, args=["device"], rvals=["serial"],
|
||||
argprep={"serial":strprep}, byref=[])
|
||||
# ctypes.c_uint ShamrockEepromGetOpticalParams(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) FocalLength, ctypes.POINTER(ctypes.c_float) AngularDeviation, ctypes.POINTER(ctypes.c_float) FocalTilt)
|
||||
self.ShamrockEepromGetOpticalParams=wrapper(lib.ShamrockEepromGetOpticalParams)
|
||||
|
||||
# ctypes.c_uint ShamrockGratingIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockGratingIsPresent=wrapper(lib.ShamrockGratingIsPresent)
|
||||
# ctypes.c_uint ShamrockGetTurret(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) Turret)
|
||||
self.ShamrockGetTurret=wrapper(lib.ShamrockGetTurret)
|
||||
# ctypes.c_uint ShamrockSetTurret(ctypes.c_int device, ctypes.c_int Turret)
|
||||
self.ShamrockSetTurret=wrapper(lib.ShamrockSetTurret)
|
||||
# ctypes.c_uint ShamrockGetNumberGratings(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) noGratings)
|
||||
self.ShamrockGetNumberGratings=wrapper(lib.ShamrockGetNumberGratings)
|
||||
# ctypes.c_uint ShamrockGetGrating(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) grating)
|
||||
self.ShamrockGetGrating=wrapper(lib.ShamrockGetGrating)
|
||||
# ctypes.c_uint ShamrockSetGrating(ctypes.c_int device, ctypes.c_int grating)
|
||||
self.ShamrockSetGrating=wrapper(lib.ShamrockSetGrating)
|
||||
# ctypes.c_uint ShamrockGetGratingInfo(ctypes.c_int device, ctypes.c_int Grating, ctypes.POINTER(ctypes.c_float) Lines, ctypes.c_char_p Blaze, ctypes.POINTER(ctypes.c_int) Home, ctypes.POINTER(ctypes.c_int) Offset)
|
||||
self.ShamrockGetGratingInfo=wrapper(lib.ShamrockGetGratingInfo, args=["device","Grating"], rvals=["Lines","Blaze","Home","Offset"],
|
||||
argprep={"Blaze":strprep}, byref=["Lines","Home","Offset"])
|
||||
# ctypes.c_uint ShamrockGetGratingOffset(ctypes.c_int device, ctypes.c_int Grating, ctypes.POINTER(ctypes.c_int) offset)
|
||||
self.ShamrockGetGratingOffset=wrapper(lib.ShamrockGetGratingOffset)
|
||||
# ctypes.c_uint ShamrockSetGratingOffset(ctypes.c_int device, ctypes.c_int Grating, ctypes.c_int offset)
|
||||
self.ShamrockSetGratingOffset=wrapper(lib.ShamrockSetGratingOffset)
|
||||
# ctypes.c_uint ShamrockGetDetectorOffset(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) offset)
|
||||
self.ShamrockGetDetectorOffset=wrapper(lib.ShamrockGetDetectorOffset)
|
||||
# ctypes.c_uint ShamrockSetDetectorOffset(ctypes.c_int device, ctypes.c_int offset)
|
||||
self.ShamrockSetDetectorOffset=wrapper(lib.ShamrockSetDetectorOffset)
|
||||
# ctypes.c_uint ShamrockGetDetectorOffsetPort2(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) offset)
|
||||
self.ShamrockGetDetectorOffsetPort2=wrapper(lib.ShamrockGetDetectorOffsetPort2)
|
||||
# ctypes.c_uint ShamrockSetDetectorOffsetPort2(ctypes.c_int device, ctypes.c_int offset)
|
||||
self.ShamrockSetDetectorOffsetPort2=wrapper(lib.ShamrockSetDetectorOffsetPort2)
|
||||
# ctypes.c_uint ShamrockWavelengthReset(ctypes.c_int device)
|
||||
self.ShamrockWavelengthReset=wrapper(lib.ShamrockWavelengthReset)
|
||||
|
||||
# ctypes.c_uint ShamrockWavelengthIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockWavelengthIsPresent=wrapper(lib.ShamrockWavelengthIsPresent)
|
||||
# ctypes.c_uint ShamrockGetWavelengthLimits(ctypes.c_int device, ctypes.c_int Grating, ctypes.POINTER(ctypes.c_float) Min, ctypes.POINTER(ctypes.c_float) Max)
|
||||
self.ShamrockGetWavelengthLimits=wrapper(lib.ShamrockGetWavelengthLimits)
|
||||
# ctypes.c_uint ShamrockGetWavelength(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) wavelength)
|
||||
self.ShamrockGetWavelength=wrapper(lib.ShamrockGetWavelength)
|
||||
# ctypes.c_uint ShamrockSetWavelength(ctypes.c_int device, ctypes.c_float wavelength)
|
||||
self.ShamrockSetWavelength=wrapper(lib.ShamrockSetWavelength)
|
||||
# ctypes.c_uint ShamrockAtZeroOrder(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) atZeroOrder)
|
||||
self.ShamrockAtZeroOrder=wrapper(lib.ShamrockAtZeroOrder)
|
||||
# ctypes.c_uint ShamrockGotoZeroOrder(ctypes.c_int device)
|
||||
self.ShamrockGotoZeroOrder=wrapper(lib.ShamrockGotoZeroOrder)
|
||||
|
||||
# ctypes.c_uint ShamrockAutoSlitIsPresent(ctypes.c_int device, ctypes.c_int index, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockAutoSlitIsPresent=wrapper(lib.ShamrockAutoSlitIsPresent)
|
||||
# ctypes.c_uint ShamrockAutoSlitReset(ctypes.c_int device, ctypes.c_int index)
|
||||
self.ShamrockAutoSlitReset=wrapper(lib.ShamrockAutoSlitReset)
|
||||
# ctypes.c_uint ShamrockGetAutoSlitWidth(ctypes.c_int device, ctypes.c_int index, ctypes.POINTER(ctypes.c_float) width)
|
||||
self.ShamrockGetAutoSlitWidth=wrapper(lib.ShamrockGetAutoSlitWidth)
|
||||
# ctypes.c_uint ShamrockSetAutoSlitWidth(ctypes.c_int device, ctypes.c_int index, ctypes.c_float width)
|
||||
self.ShamrockSetAutoSlitWidth=wrapper(lib.ShamrockSetAutoSlitWidth)
|
||||
# ctypes.c_uint ShamrockGetAutoSlitCoefficients(ctypes.c_int device, ctypes.c_int index, ctypes.POINTER(ctypes.c_int) x1, ctypes.POINTER(ctypes.c_int) y1, ctypes.POINTER(ctypes.c_int) x2, ctypes.POINTER(ctypes.c_int) y2)
|
||||
self.ShamrockGetAutoSlitCoefficients=wrapper(lib.ShamrockGetAutoSlitCoefficients)
|
||||
# ctypes.c_uint ShamrockSetAutoSlitCoefficients(ctypes.c_int device, ctypes.c_int index, ctypes.c_int x1, ctypes.c_int y1, ctypes.c_int x2, ctypes.c_int y2)
|
||||
self.ShamrockSetAutoSlitCoefficients=wrapper(lib.ShamrockSetAutoSlitCoefficients)
|
||||
|
||||
# ctypes.c_uint ShamrockShutterIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockShutterIsPresent=wrapper(lib.ShamrockShutterIsPresent)
|
||||
# ctypes.c_uint ShamrockIsModePossible(ctypes.c_int device, ctypes.c_int mode, ctypes.POINTER(ctypes.c_int) possible)
|
||||
self.ShamrockIsModePossible=wrapper(lib.ShamrockIsModePossible)
|
||||
# ctypes.c_uint ShamrockGetShutter(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) mode)
|
||||
self.ShamrockGetShutter=wrapper(lib.ShamrockGetShutter)
|
||||
# ctypes.c_uint ShamrockSetShutter(ctypes.c_int device, ctypes.c_int mode)
|
||||
self.ShamrockSetShutter=wrapper(lib.ShamrockSetShutter)
|
||||
|
||||
# ctypes.c_uint ShamrockIrisIsPresent(ctypes.c_int device, ctypes.c_int iris, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockIrisIsPresent=wrapper(lib.ShamrockIrisIsPresent)
|
||||
# ctypes.c_uint ShamrockSetIris(ctypes.c_int device, ctypes.c_int iris, ctypes.c_int value)
|
||||
self.ShamrockSetIris=wrapper(lib.ShamrockSetIris)
|
||||
# ctypes.c_uint ShamrockGetIris(ctypes.c_int device, ctypes.c_int iris, ctypes.POINTER(ctypes.c_int) value)
|
||||
self.ShamrockGetIris=wrapper(lib.ShamrockGetIris)
|
||||
|
||||
# ctypes.c_uint ShamrockSetFocusMirror(ctypes.c_int device, ctypes.c_int focus)
|
||||
self.ShamrockSetFocusMirror=wrapper(lib.ShamrockSetFocusMirror)
|
||||
# ctypes.c_uint ShamrockGetFocusMirror(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) focus)
|
||||
self.ShamrockGetFocusMirror=wrapper(lib.ShamrockGetFocusMirror)
|
||||
# ctypes.c_uint ShamrockGetFocusMirrorMaxSteps(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) steps)
|
||||
self.ShamrockGetFocusMirrorMaxSteps=wrapper(lib.ShamrockGetFocusMirrorMaxSteps)
|
||||
# ctypes.c_uint ShamrockFocusMirrorReset(ctypes.c_int device)
|
||||
self.ShamrockFocusMirrorReset=wrapper(lib.ShamrockFocusMirrorReset)
|
||||
# ctypes.c_uint ShamrockFocusMirrorIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockFocusMirrorIsPresent=wrapper(lib.ShamrockFocusMirrorIsPresent)
|
||||
|
||||
# ctypes.c_uint ShamrockFilterIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockFilterIsPresent=wrapper(lib.ShamrockFilterIsPresent)
|
||||
# ctypes.c_uint ShamrockFilterReset(ctypes.c_int device)
|
||||
self.ShamrockFilterReset=wrapper(lib.ShamrockFilterReset)
|
||||
# ctypes.c_uint ShamrockGetFilter(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) filter)
|
||||
self.ShamrockGetFilter=wrapper(lib.ShamrockGetFilter)
|
||||
# ctypes.c_uint ShamrockSetFilter(ctypes.c_int device, ctypes.c_int filter)
|
||||
self.ShamrockSetFilter=wrapper(lib.ShamrockSetFilter)
|
||||
# ctypes.c_uint ShamrockGetFilterInfo(ctypes.c_int device, ctypes.c_int Filter, ctypes.c_char_p Info)
|
||||
self.ShamrockGetFilterInfo=wrapper(lib.ShamrockGetFilterInfo)
|
||||
# ctypes.c_uint ShamrockSetFilterInfo(ctypes.c_int device, ctypes.c_int Filter, ctypes.c_char_p Info)
|
||||
self.ShamrockSetFilterInfo=wrapper(lib.ShamrockSetFilterInfo)
|
||||
|
||||
# ctypes.c_uint ShamrockFlipperMirrorIsPresent(ctypes.c_int device, ctypes.c_int flipper, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockFlipperMirrorIsPresent=wrapper(lib.ShamrockFlipperMirrorIsPresent)
|
||||
# ctypes.c_uint ShamrockFlipperMirrorReset(ctypes.c_int device, ctypes.c_int flipper)
|
||||
self.ShamrockFlipperMirrorReset=wrapper(lib.ShamrockFlipperMirrorReset)
|
||||
# ctypes.c_uint ShamrockGetFlipperMirror(ctypes.c_int device, ctypes.c_int flipper, ctypes.POINTER(ctypes.c_int) port)
|
||||
self.ShamrockGetFlipperMirror=wrapper(lib.ShamrockGetFlipperMirror)
|
||||
# ctypes.c_uint ShamrockSetFlipperMirror(ctypes.c_int device, ctypes.c_int flipper, ctypes.c_int port)
|
||||
self.ShamrockSetFlipperMirror=wrapper(lib.ShamrockSetFlipperMirror)
|
||||
# ctypes.c_uint ShamrockGetCCDLimits(ctypes.c_int device, ctypes.c_int port, ctypes.POINTER(ctypes.c_float) Low, ctypes.POINTER(ctypes.c_float) High)
|
||||
self.ShamrockGetCCDLimits=wrapper(lib.ShamrockGetCCDLimits)
|
||||
|
||||
# ctypes.c_uint ShamrockAccessoryIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
self.ShamrockAccessoryIsPresent=wrapper(lib.ShamrockAccessoryIsPresent)
|
||||
# ctypes.c_uint ShamrockGetAccessoryState(ctypes.c_int device, ctypes.c_int Accessory, ctypes.POINTER(ctypes.c_int) state)
|
||||
self.ShamrockGetAccessoryState=wrapper(lib.ShamrockGetAccessoryState)
|
||||
# ctypes.c_uint ShamrockSetAccessory(ctypes.c_int device, ctypes.c_int Accessory, ctypes.c_int State)
|
||||
self.ShamrockSetAccessory=wrapper(lib.ShamrockSetAccessory)
|
||||
|
||||
# ctypes.c_uint ShamrockGetPixelWidth(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) Width)
|
||||
self.ShamrockGetPixelWidth=wrapper(lib.ShamrockGetPixelWidth)
|
||||
# ctypes.c_uint ShamrockSetPixelWidth(ctypes.c_int device, ctypes.c_float Width)
|
||||
self.ShamrockSetPixelWidth=wrapper(lib.ShamrockSetPixelWidth)
|
||||
# ctypes.c_uint ShamrockGetNumberPixels(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) NumberPixels)
|
||||
self.ShamrockGetNumberPixels=wrapper(lib.ShamrockGetNumberPixels)
|
||||
# ctypes.c_uint ShamrockSetNumberPixels(ctypes.c_int device, ctypes.c_int NumberPixels)
|
||||
self.ShamrockSetNumberPixels=wrapper(lib.ShamrockSetNumberPixels)
|
||||
# ctypes.c_uint ShamrockGetCalibration(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) CalibrationValues, ctypes.c_int NumberPixels)
|
||||
self.ShamrockGetCalibration_lib=wrapper(lib.ShamrockGetCalibration, rvals=[])
|
||||
|
||||
return
|
||||
|
||||
# ### Deprecated ###
|
||||
# # ctypes.c_uint ShamrockSlitIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
# self.ShamrockSlitIsPresent=wrapper(lib.ShamrockSlitIsPresent)
|
||||
# # ctypes.c_uint ShamrockSlitReset(ctypes.c_int device)
|
||||
# self.ShamrockSlitReset=wrapper(lib.ShamrockSlitReset)
|
||||
# # ctypes.c_uint ShamrockGetSlit(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) width)
|
||||
# self.ShamrockGetSlit=wrapper(lib.ShamrockGetSlit)
|
||||
# # ctypes.c_uint ShamrockSetSlit(ctypes.c_int device, ctypes.c_float width)
|
||||
# self.ShamrockSetSlit=wrapper(lib.ShamrockSetSlit)
|
||||
# # ctypes.c_uint ShamrockOutputSlitIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
# self.ShamrockOutputSlitIsPresent=wrapper(lib.ShamrockOutputSlitIsPresent)
|
||||
# # ctypes.c_uint ShamrockOutputSlitReset(ctypes.c_int device)
|
||||
# self.ShamrockOutputSlitReset=wrapper(lib.ShamrockOutputSlitReset)
|
||||
# # ctypes.c_uint ShamrockGetOutputSlit(ctypes.c_int device, ctypes.POINTER(ctypes.c_float) width)
|
||||
# self.ShamrockGetOutputSlit=wrapper(lib.ShamrockGetOutputSlit)
|
||||
# # ctypes.c_uint ShamrockSetOutputSlit(ctypes.c_int device, ctypes.c_float width)
|
||||
# self.ShamrockSetOutputSlit=wrapper(lib.ShamrockSetOutputSlit)
|
||||
# # ctypes.c_uint ShamrockSetSlitCoefficients(ctypes.c_int device, ctypes.c_int x1, ctypes.c_int y1, ctypes.c_int x2, ctypes.c_int y2)
|
||||
# self.ShamrockSetSlitCoefficients=wrapper(lib.ShamrockSetSlitCoefficients)
|
||||
# # ctypes.c_uint ShamrockGetSlitCoefficients(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) x1, ctypes.POINTER(ctypes.c_int) y1, ctypes.POINTER(ctypes.c_int) x2, ctypes.POINTER(ctypes.c_int) y2)
|
||||
# self.ShamrockGetSlitCoefficients=wrapper(lib.ShamrockGetSlitCoefficients)
|
||||
# # ctypes.c_uint ShamrockFlipperIsPresent(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) present)
|
||||
# self.ShamrockFlipperIsPresent=wrapper(lib.ShamrockFlipperIsPresent)
|
||||
# # ctypes.c_uint ShamrockFlipperReset(ctypes.c_int device)
|
||||
# self.ShamrockFlipperReset=wrapper(lib.ShamrockFlipperReset)
|
||||
# # ctypes.c_uint ShamrockGetPort(ctypes.c_int device, ctypes.POINTER(ctypes.c_int) port)
|
||||
# self.ShamrockGetPort=wrapper(lib.ShamrockGetPort)
|
||||
# # ctypes.c_uint ShamrockSetPort(ctypes.c_int device, ctypes.c_int port)
|
||||
# self.ShamrockSetPort=wrapper(lib.ShamrockSetPort)
|
||||
|
||||
def ShamrockGetCalibration(self, device, NumberPixels):
|
||||
values=(ctypes.c_float*NumberPixels)()
|
||||
self.ShamrockGetCalibration_lib(device,values,NumberPixels)
|
||||
return values[:]
|
||||
|
||||
|
||||
wlib=ShamrockLib()
|
||||
@@ -1,6 +0,0 @@
|
||||
from . import AndorSDK2
|
||||
from .AndorSDK2 import AndorSDK2Camera, get_cameras_number as get_cameras_number_SDK2, get_SDK_version as get_SDK2_version
|
||||
from . import AndorSDK3
|
||||
from .AndorSDK3 import AndorSDK3Camera, get_cameras_number as get_cameras_number_SDK3
|
||||
from .Shamrock import list_spectrographs as list_shamrock_spectrographs, get_spectrographs_number as get_shamrock_spectrographs_number, ShamrockSpectrograph
|
||||
from .base import AndorError, AndorNotSupportedError, AndorTimeoutError
|
||||
@@ -1,266 +0,0 @@
|
||||
########## This file is generated automatically based on atcore.h ##########
|
||||
|
||||
# pylint: disable=unused-import, unused-argument, wrong-spelling-in-comment
|
||||
|
||||
|
||||
import ctypes
|
||||
import enum
|
||||
from ...core.utils import ctypes_wrap
|
||||
|
||||
|
||||
|
||||
|
||||
def _int32(v): return (v+0x80000000)%0x100000000-0x80000000
|
||||
|
||||
|
||||
|
||||
|
||||
##### DEFINE GROUPS #####
|
||||
|
||||
|
||||
class AT_ERR(enum.IntEnum):
|
||||
AT_SUCCESS = _int32(0)
|
||||
AT_ERR_NOTINITIALISED = _int32(1)
|
||||
AT_ERR_NOTIMPLEMENTED = _int32(2)
|
||||
AT_ERR_READONLY = _int32(3)
|
||||
AT_ERR_NOTREADABLE = _int32(4)
|
||||
AT_ERR_NOTWRITABLE = _int32(5)
|
||||
AT_ERR_OUTOFRANGE = _int32(6)
|
||||
AT_ERR_INDEXNOTAVAILABLE = _int32(7)
|
||||
AT_ERR_INDEXNOTIMPLEMENTED = _int32(8)
|
||||
AT_ERR_EXCEEDEDMAXSTRINGLENGTH = _int32(9)
|
||||
AT_ERR_CONNECTION = _int32(10)
|
||||
AT_ERR_NODATA = _int32(11)
|
||||
AT_ERR_INVALIDHANDLE = _int32(12)
|
||||
AT_ERR_TIMEDOUT = _int32(13)
|
||||
AT_ERR_BUFFERFULL = _int32(14)
|
||||
AT_ERR_INVALIDSIZE = _int32(15)
|
||||
AT_ERR_INVALIDALIGNMENT = _int32(16)
|
||||
AT_ERR_COMM = _int32(17)
|
||||
AT_ERR_STRINGNOTAVAILABLE = _int32(18)
|
||||
AT_ERR_STRINGNOTIMPLEMENTED = _int32(19)
|
||||
AT_ERR_NULL_FEATURE = _int32(20)
|
||||
AT_ERR_NULL_HANDLE = _int32(21)
|
||||
AT_ERR_NULL_IMPLEMENTED_VAR = _int32(22)
|
||||
AT_ERR_NULL_READABLE_VAR = _int32(23)
|
||||
AT_ERR_NULL_READONLY_VAR = _int32(24)
|
||||
AT_ERR_NULL_WRITABLE_VAR = _int32(25)
|
||||
AT_ERR_NULL_MINVALUE = _int32(26)
|
||||
AT_ERR_NULL_MAXVALUE = _int32(27)
|
||||
AT_ERR_NULL_VALUE = _int32(28)
|
||||
AT_ERR_NULL_STRING = _int32(29)
|
||||
AT_ERR_NULL_COUNT_VAR = _int32(30)
|
||||
AT_ERR_NULL_ISAVAILABLE_VAR = _int32(31)
|
||||
AT_ERR_NULL_MAXSTRINGLENGTH = _int32(32)
|
||||
AT_ERR_NULL_EVCALLBACK = _int32(33)
|
||||
AT_ERR_NULL_QUEUE_PTR = _int32(34)
|
||||
AT_ERR_NULL_WAIT_PTR = _int32(35)
|
||||
AT_ERR_NULL_PTRSIZE = _int32(36)
|
||||
AT_ERR_NOMEMORY = _int32(37)
|
||||
AT_ERR_DEVICEINUSE = _int32(38)
|
||||
AT_ERR_DEVICENOTFOUND = _int32(39)
|
||||
AT_ERR_HARDWARE_OVERFLOW = _int32(100)
|
||||
dAT_ERR={a.name:a.value for a in AT_ERR}
|
||||
drAT_ERR={a.value:a.name for a in AT_ERR}
|
||||
|
||||
|
||||
class AT_HANDLE(enum.IntEnum):
|
||||
AT_HANDLE_UNINITIALISED = _int32(-1)
|
||||
AT_HANDLE_SYSTEM = _int32(1)
|
||||
dAT_HANDLE={a.name:a.value for a in AT_HANDLE}
|
||||
drAT_HANDLE={a.value:a.name for a in AT_HANDLE}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##### TYPE DEFINITIONS #####
|
||||
|
||||
|
||||
BYTE=ctypes.c_ubyte
|
||||
PBYTE=ctypes.POINTER(BYTE)
|
||||
CHAR=ctypes.c_char
|
||||
PCHAR=ctypes.c_char_p
|
||||
UCHAR=ctypes.c_ubyte
|
||||
PUCHAR=ctypes.POINTER(UCHAR)
|
||||
ULONG_PTR=ctypes.c_uint64
|
||||
LONG_PTR=ctypes.c_int64
|
||||
WORD=ctypes.c_ushort
|
||||
LPWORD=ctypes.POINTER(WORD)
|
||||
LONGLONG=ctypes.c_int64
|
||||
LPLONG=ctypes.POINTER(ctypes.c_long)
|
||||
HANDLE=ctypes.c_void_p
|
||||
LPHANDLE=ctypes.POINTER(HANDLE)
|
||||
HWND=ctypes.c_void_p
|
||||
HGLOBAL=ctypes.c_void_p
|
||||
HINSTANCE=ctypes.c_void_p
|
||||
HDC=ctypes.c_void_p
|
||||
HMODULE=ctypes.c_void_p
|
||||
HKEY=ctypes.c_void_p
|
||||
PVOID=ctypes.c_void_p
|
||||
LPVOID=ctypes.c_void_p
|
||||
AT_H=ctypes.c_int
|
||||
AT_BOOL=ctypes.c_int
|
||||
AT_64=ctypes.c_longlong
|
||||
AT_U8=ctypes.c_ubyte
|
||||
AT_WC=ctypes.c_wchar
|
||||
FeatureCallback=ctypes.c_void_p
|
||||
|
||||
|
||||
|
||||
##### FUNCTION DEFINITIONS #####
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def addfunc(lib, name, restype, argtypes=None, argnames=None):
|
||||
if getattr(lib,name,None) is None:
|
||||
setattr(lib,name,None)
|
||||
else:
|
||||
func=getattr(lib,name)
|
||||
func.restype=restype
|
||||
if argtypes is not None:
|
||||
func.argtypes=argtypes
|
||||
if argnames is not None:
|
||||
func.argnames=argnames
|
||||
|
||||
def define_functions(lib):
|
||||
# ctypes.c_int AT_InitialiseLibrary()
|
||||
addfunc(lib, "AT_InitialiseLibrary", restype = ctypes.c_int,
|
||||
argtypes = [],
|
||||
argnames = [] )
|
||||
# ctypes.c_int AT_FinaliseLibrary()
|
||||
addfunc(lib, "AT_FinaliseLibrary", restype = ctypes.c_int,
|
||||
argtypes = [],
|
||||
argnames = [] )
|
||||
# ctypes.c_int AT_Open(ctypes.c_int CameraIndex, ctypes.POINTER(AT_H) Hndl)
|
||||
addfunc(lib, "AT_Open", restype = ctypes.c_int,
|
||||
argtypes = [ctypes.c_int, ctypes.POINTER(AT_H)],
|
||||
argnames = ["CameraIndex", "Hndl"] )
|
||||
# ctypes.c_int AT_Close(AT_H Hndl)
|
||||
addfunc(lib, "AT_Close", restype = ctypes.c_int,
|
||||
argtypes = [AT_H],
|
||||
argnames = ["Hndl"] )
|
||||
# ctypes.c_int AT_RegisterFeatureCallback(AT_H Hndl, ctypes.c_wchar_p Feature, FeatureCallback EvCallback, ctypes.c_void_p Context)
|
||||
addfunc(lib, "AT_RegisterFeatureCallback", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, FeatureCallback, ctypes.c_void_p],
|
||||
argnames = ["Hndl", "Feature", "EvCallback", "Context"] )
|
||||
# ctypes.c_int AT_UnregisterFeatureCallback(AT_H Hndl, ctypes.c_wchar_p Feature, FeatureCallback EvCallback, ctypes.c_void_p Context)
|
||||
addfunc(lib, "AT_UnregisterFeatureCallback", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, FeatureCallback, ctypes.c_void_p],
|
||||
argnames = ["Hndl", "Feature", "EvCallback", "Context"] )
|
||||
# ctypes.c_int AT_IsImplemented(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_BOOL) Implemented)
|
||||
addfunc(lib, "AT_IsImplemented", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_BOOL)],
|
||||
argnames = ["Hndl", "Feature", "Implemented"] )
|
||||
# ctypes.c_int AT_IsReadable(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_BOOL) Readable)
|
||||
addfunc(lib, "AT_IsReadable", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_BOOL)],
|
||||
argnames = ["Hndl", "Feature", "Readable"] )
|
||||
# ctypes.c_int AT_IsWritable(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_BOOL) Writable)
|
||||
addfunc(lib, "AT_IsWritable", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_BOOL)],
|
||||
argnames = ["Hndl", "Feature", "Writable"] )
|
||||
# ctypes.c_int AT_IsReadOnly(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_BOOL) ReadOnly)
|
||||
addfunc(lib, "AT_IsReadOnly", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_BOOL)],
|
||||
argnames = ["Hndl", "Feature", "ReadOnly"] )
|
||||
# ctypes.c_int AT_SetInt(AT_H Hndl, ctypes.c_wchar_p Feature, AT_64 Value)
|
||||
addfunc(lib, "AT_SetInt", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, AT_64],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_GetInt(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_64) Value)
|
||||
addfunc(lib, "AT_GetInt", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_64)],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_GetIntMax(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_64) MaxValue)
|
||||
addfunc(lib, "AT_GetIntMax", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_64)],
|
||||
argnames = ["Hndl", "Feature", "MaxValue"] )
|
||||
# ctypes.c_int AT_GetIntMin(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_64) MinValue)
|
||||
addfunc(lib, "AT_GetIntMin", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_64)],
|
||||
argnames = ["Hndl", "Feature", "MinValue"] )
|
||||
# ctypes.c_int AT_SetFloat(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_double Value)
|
||||
addfunc(lib, "AT_SetFloat", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_double],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_GetFloat(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(ctypes.c_double) Value)
|
||||
addfunc(lib, "AT_GetFloat", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_double)],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_GetFloatMax(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(ctypes.c_double) MaxValue)
|
||||
addfunc(lib, "AT_GetFloatMax", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_double)],
|
||||
argnames = ["Hndl", "Feature", "MaxValue"] )
|
||||
# ctypes.c_int AT_GetFloatMin(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(ctypes.c_double) MinValue)
|
||||
addfunc(lib, "AT_GetFloatMin", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_double)],
|
||||
argnames = ["Hndl", "Feature", "MinValue"] )
|
||||
# ctypes.c_int AT_SetBool(AT_H Hndl, ctypes.c_wchar_p Feature, AT_BOOL Value)
|
||||
addfunc(lib, "AT_SetBool", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, AT_BOOL],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_GetBool(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(AT_BOOL) Value)
|
||||
addfunc(lib, "AT_GetBool", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(AT_BOOL)],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_SetEnumIndex(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_int Value)
|
||||
addfunc(lib, "AT_SetEnumIndex", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_int],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_SetEnumString(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_wchar_p String)
|
||||
addfunc(lib, "AT_SetEnumString", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_wchar_p],
|
||||
argnames = ["Hndl", "Feature", "String"] )
|
||||
# ctypes.c_int AT_GetEnumIndex(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(ctypes.c_int) Value)
|
||||
addfunc(lib, "AT_GetEnumIndex", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["Hndl", "Feature", "Value"] )
|
||||
# ctypes.c_int AT_GetEnumCount(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(ctypes.c_int) Count)
|
||||
addfunc(lib, "AT_GetEnumCount", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["Hndl", "Feature", "Count"] )
|
||||
# ctypes.c_int AT_IsEnumIndexAvailable(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_int Index, ctypes.POINTER(AT_BOOL) Available)
|
||||
addfunc(lib, "AT_IsEnumIndexAvailable", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_int, ctypes.POINTER(AT_BOOL)],
|
||||
argnames = ["Hndl", "Feature", "Index", "Available"] )
|
||||
# ctypes.c_int AT_IsEnumIndexImplemented(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_int Index, ctypes.POINTER(AT_BOOL) Implemented)
|
||||
addfunc(lib, "AT_IsEnumIndexImplemented", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_int, ctypes.POINTER(AT_BOOL)],
|
||||
argnames = ["Hndl", "Feature", "Index", "Implemented"] )
|
||||
# ctypes.c_int AT_GetEnumStringByIndex(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_int Index, ctypes.c_wchar_p String, ctypes.c_int StringLength)
|
||||
addfunc(lib, "AT_GetEnumStringByIndex", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_int, ctypes.c_wchar_p, ctypes.c_int],
|
||||
argnames = ["Hndl", "Feature", "Index", "String", "StringLength"] )
|
||||
# ctypes.c_int AT_Command(AT_H Hndl, ctypes.c_wchar_p Feature)
|
||||
addfunc(lib, "AT_Command", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p],
|
||||
argnames = ["Hndl", "Feature"] )
|
||||
# ctypes.c_int AT_SetString(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_wchar_p String)
|
||||
addfunc(lib, "AT_SetString", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_wchar_p],
|
||||
argnames = ["Hndl", "Feature", "String"] )
|
||||
# ctypes.c_int AT_GetString(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.c_wchar_p String, ctypes.c_int StringLength)
|
||||
addfunc(lib, "AT_GetString", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_int],
|
||||
argnames = ["Hndl", "Feature", "String", "StringLength"] )
|
||||
# ctypes.c_int AT_GetStringMaxLength(AT_H Hndl, ctypes.c_wchar_p Feature, ctypes.POINTER(ctypes.c_int) MaxStringLength)
|
||||
addfunc(lib, "AT_GetStringMaxLength", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_int)],
|
||||
argnames = ["Hndl", "Feature", "MaxStringLength"] )
|
||||
# ctypes.c_int AT_QueueBuffer(AT_H Hndl, ctypes.POINTER(AT_U8) Ptr, ctypes.c_int PtrSize)
|
||||
addfunc(lib, "AT_QueueBuffer", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.POINTER(AT_U8), ctypes.c_int],
|
||||
argnames = ["Hndl", "Ptr", "PtrSize"] )
|
||||
# ctypes.c_int AT_WaitBuffer(AT_H Hndl, ctypes.POINTER(ctypes.POINTER(AT_U8)) Ptr, ctypes.POINTER(ctypes.c_int) PtrSize, ctypes.c_uint Timeout)
|
||||
addfunc(lib, "AT_WaitBuffer", restype = ctypes.c_int,
|
||||
argtypes = [AT_H, ctypes.POINTER(ctypes.POINTER(AT_U8)), ctypes.POINTER(ctypes.c_int), ctypes.c_uint],
|
||||
argnames = ["Hndl", "Ptr", "PtrSize", "Timeout"] )
|
||||
# ctypes.c_int AT_Flush(AT_H Hndl)
|
||||
addfunc(lib, "AT_Flush", restype = ctypes.c_int,
|
||||
argtypes = [AT_H],
|
||||
argnames = ["Hndl"] )
|
||||
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
# pylint: disable=wrong-spelling-in-comment
|
||||
|
||||
feature_types={
|
||||
"AcquisitionStart": "comm",
|
||||
"AcquisitionStop": "comm",
|
||||
"CameraDump": "comm",
|
||||
"DDGStepUploadModeValues": "comm",
|
||||
"I2CRead": "comm",
|
||||
"I2CWrite": "comm",
|
||||
"SoftwareTrigger": "comm",
|
||||
"TimestampClockReset": "comm",
|
||||
|
||||
"AccumulateCount": "int",
|
||||
"AcquiredCount": "int",
|
||||
"AOIHBin": "int",
|
||||
"AOIHeight": "int",
|
||||
"AOILeft": "int",
|
||||
"AOIStride": "int",
|
||||
"AOITop": "int",
|
||||
"AOIVBin": "int",
|
||||
"AOIWidth": "int",
|
||||
"Baseline": "int",
|
||||
"BufferOverflowEvent": "int",
|
||||
"CameraMemory": "int",
|
||||
"DDGIOCNumberOfPulses": "int",
|
||||
"DDGIOCPeriod": "int",
|
||||
"DDGOutputDelay": "int",
|
||||
"DDGOutputWidth": "int",
|
||||
"DDGStepCount": "int",
|
||||
"DDGStepUploadProgress": "int",
|
||||
"DeviceCount": "int",
|
||||
"DeviceVideoIndex": "int",
|
||||
"EventsMissedEvent": "int",
|
||||
"ExposedPixelHeight": "int",
|
||||
"ExposureEndEvent": "int",
|
||||
"ExposureStartEvent": "int",
|
||||
"FrameCount": "int",
|
||||
"I2CAddress": "int",
|
||||
"I2CByte": "int",
|
||||
"I2CByteCount": "int",
|
||||
"I2CByteSelector": "int",
|
||||
"ImageSizeBytes": "int",
|
||||
"LUTIndex": "int",
|
||||
"LUTValue": "int",
|
||||
"MCPGain": "int",
|
||||
"MCPVoltage": "int",
|
||||
"MultitrackCount": "int",
|
||||
"MultitrackEnd": "int",
|
||||
"MultitrackSelector": "int",
|
||||
"MultitrackStart": "int",
|
||||
"PortSelector": "int",
|
||||
"PreAmpGainValue": "int",
|
||||
"PreAmpOffsetValue": "int",
|
||||
"RowNExposureEndEvent": "int",
|
||||
"RowNExposureStartEvent": "int",
|
||||
"SensorHeight": "int",
|
||||
"SensorWidth": "int",
|
||||
"TimestampClock": "int",
|
||||
"TimestampClockFrequency": "int",
|
||||
"UsbProductId": "int",
|
||||
"UsbDeviceId": "int",
|
||||
|
||||
"AlternatingReadoutDirection": "bool",
|
||||
"CameraAcquiring": "bool",
|
||||
"CameraPresent": "bool",
|
||||
"DDGIOCEnable": "bool",
|
||||
"DDGOutputEnable": "bool",
|
||||
"DDGOutputStepEnable": "bool",
|
||||
"DDGOpticalWidthEnable": "bool",
|
||||
"DDGStepEnabled": "bool",
|
||||
"DDGStepUploadRequired": "bool",
|
||||
"DisableShutter": "bool",
|
||||
"EventEnable": "bool",
|
||||
"ExternalIOReadout": "bool",
|
||||
"FastAOIFrameRateEnable": "bool",
|
||||
"ForceShutterOpen": "bool",
|
||||
"FrameIntervalTiming": "bool",
|
||||
"FullAOIControl": "bool",
|
||||
"IODirection": "bool",
|
||||
"IOState": "bool",
|
||||
"IOInvert": "bool",
|
||||
"IRPreFlashEnable": "bool",
|
||||
"KeepCleanEnable": "bool",
|
||||
"KeepCleanPostExposureEnable": "bool",
|
||||
"MCPIntelligate": "bool",
|
||||
"MetadataEnable": "bool",
|
||||
"MetadataFrame": "bool",
|
||||
"MetadataFrameInfo": "bool",
|
||||
"MetadataTimestamp": "bool",
|
||||
"MultitrackBinned": "bool",
|
||||
"Overlap": "bool",
|
||||
"PIVEnable": "bool",
|
||||
"PreTriggerEnable": "bool",
|
||||
"RollingShutterGlobalClear": "bool",
|
||||
"ScanSpeedControlEnable": "bool",
|
||||
"SensorCooling": "bool",
|
||||
"ShutterAmpControl": "bool",
|
||||
"ShutterState": "bool",
|
||||
"SpuriousNoiseFilter": "bool",
|
||||
"StaticBlemishCorrection": "bool",
|
||||
"SynchronousTriggering": "bool",
|
||||
"TransmitFrames": "bool",
|
||||
"VerticallyCentreAOI": "bool",
|
||||
|
||||
"BackoffTemperatureOffset": "float",
|
||||
"BytesPerPixel": "float",
|
||||
"CoolerPower": "float",
|
||||
"DDGStepDelayCoefficientA": "float",
|
||||
"DDGStepDelayCoefficientB": "float",
|
||||
"DDGStepWidthCoefficientA": "float",
|
||||
"DDGStepWidthCoefficientB": "float",
|
||||
"ExposureTime": "float",
|
||||
"ExternalTriggerDelay": "float",
|
||||
"FrameInterval": "float",
|
||||
"FrameRate": "float",
|
||||
"HeatSinkTemperature": "float",
|
||||
"InputVoltage": "float",
|
||||
"LineScanSpeed": "float",
|
||||
"PixelHeight": "float",
|
||||
"PixelWidth": "float",
|
||||
"ReadoutTime": "float",
|
||||
"RowReadTime": "float",
|
||||
"SensorTemperature": "float",
|
||||
"ShutterTransferTime": "float",
|
||||
"TargetSensorTemperature": "float",
|
||||
|
||||
"CameraFamily": "str",
|
||||
"CameraModel": "str",
|
||||
"CameraName": "str",
|
||||
"ControllerID": "str",
|
||||
"DDR2Type": "str",
|
||||
"DriverVersion": "str",
|
||||
"FirmwareVersion": "str",
|
||||
"MicrocodeVersion": "str",
|
||||
"SerialNumber": "str",
|
||||
"SoftwareVersion": "str",
|
||||
|
||||
"AOIBinning": "enum",
|
||||
"AOILayout": "enum",
|
||||
"AuxiliaryOutSource": "enum",
|
||||
"AuxOutSourceTwo": "enum",
|
||||
"BitDepth": "enum",
|
||||
"ColourFilter": "enum",
|
||||
"CycleMode": "enum",
|
||||
"DDGOutputPolarity": "enum",
|
||||
"DDGOutputSelector": "enum",
|
||||
"DDGStepDelayMode": "enum",
|
||||
"DDGStepWidthMode": "enum",
|
||||
"ElectronicShutteringMode": "enum",
|
||||
"EventSelector": "enum",
|
||||
"FanSpeed": "enum",
|
||||
"GateMode": "enum",
|
||||
"InsertionDelay": "enum",
|
||||
"IOControl": "enum",
|
||||
"IOSelector": "enum",
|
||||
"PixelCorrection": "enum",
|
||||
"PixelEncoding": "enum",
|
||||
"PixelReadoutRate": "enum",
|
||||
"PreAmpGain": "enum",
|
||||
"PreAmpGainChannel": "enum",
|
||||
"PreAmpGainControl": "enum",
|
||||
"PreAmpGainSelector": "enum",
|
||||
"SensorReadoutMode": "enum",
|
||||
"SensorType": "enum",
|
||||
"ShutterMode": "enum",
|
||||
"ShutterOutputMode": "enum",
|
||||
"SimplePreAmpGainControl": "enum",
|
||||
"TemperatureControl": "enum",
|
||||
"TemperatureStatus": "enum",
|
||||
"TriggerMode": "enum"
|
||||
}
|
||||
@@ -1,238 +0,0 @@
|
||||
# pylint: disable=wrong-spelling-in-comment
|
||||
|
||||
from . import atcore_defs
|
||||
from .atcore_defs import AT_ERR, drAT_ERR
|
||||
from .atcore_defs import define_functions
|
||||
from .atcore_features import feature_types # pylint: disable=unused-import
|
||||
from .base import AndorError
|
||||
|
||||
from ...core.utils import ctypes_wrap, ctypes_tools
|
||||
from ..utils import load_lib
|
||||
|
||||
import ctypes
|
||||
import warnings
|
||||
import numpy as np
|
||||
|
||||
|
||||
|
||||
class AndorSDK3LibError(AndorError):
|
||||
"""Generic Andor SDK3 library error"""
|
||||
def __init__(self, func, code):
|
||||
self.func=func
|
||||
self.code=code
|
||||
self.name=drAT_ERR.get(self.code,"UNKNOWN")
|
||||
msg="function '{}' raised error {}({})".format(func,code,self.name)
|
||||
AndorError.__init__(self,msg)
|
||||
def errcheck(passing=None):
|
||||
"""
|
||||
Build an error checking function.
|
||||
|
||||
Return a function which checks return codes of Andor SDK3 library functions.
|
||||
`passing` is a list specifying which return codes are acceptable (by default only 0, which is success code, is acceptable).
|
||||
"""
|
||||
passing=set(passing) if passing is not None else set()
|
||||
passing.add(0) # always allow success
|
||||
def errchecker(result, func, arguments): # pylint: disable=unused-argument
|
||||
if result not in passing:
|
||||
raise AndorSDK3LibError(func.__name__,result)
|
||||
return result
|
||||
return errchecker
|
||||
|
||||
|
||||
|
||||
AT_pWC=ctypes.c_wchar_p
|
||||
AT_H=atcore_defs.AT_H
|
||||
|
||||
class AndorSDK3Lib:
|
||||
def __init__(self):
|
||||
self._initialized=False
|
||||
|
||||
def initlib(self):
|
||||
if self._initialized:
|
||||
return
|
||||
|
||||
solis_path=load_lib.get_program_files_folder("Andor SOLIS")
|
||||
sdk3_path=load_lib.get_program_files_folder("Andor SDK3")
|
||||
error_message=( "The library is automatically supplied with Andor Solis software or Andor SDK3 software;\n"+
|
||||
load_lib.par_error_message.format("andor_sdk3")+
|
||||
"\nAdditional required libraries: atblkbx.dll, atcl_bitflow.dll, atdevapogee.dll, atdevregcam.dll, atusb_libusb.dll, atusb_libusb10.dll (distributed together with the main library)")
|
||||
self.lib=load_lib.load_lib("atcore.dll",locations=("parameter/andor_sdk3",solis_path,sdk3_path,"global"),error_message=error_message,locally=True,call_conv="stdcall")
|
||||
lib=self.lib
|
||||
define_functions(lib)
|
||||
|
||||
wrapper=ctypes_wrap.CFunctionWrapper(errcheck=errcheck())
|
||||
|
||||
# ctypes.c_int AT_InitialiseLibrary()
|
||||
self.AT_InitialiseLibrary=wrapper(lib.AT_InitialiseLibrary)
|
||||
# ctypes.c_int AT_FinaliseLibrary()
|
||||
self.AT_FinaliseLibrary=wrapper(lib.AT_FinaliseLibrary)
|
||||
# ctypes.c_int AT_Open(ctypes.c_int CameraIndex, ctypes.POINTER(AT_H) Hndl)
|
||||
self.AT_Open=wrapper(lib.AT_Open, rvals=["Hndl"])
|
||||
# ctypes.c_int AT_Close(AT_H Hndl)
|
||||
self.AT_Close=wrapper(lib.AT_Close)
|
||||
|
||||
|
||||
# ctypes.c_int AT_IsImplemented(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_BOOL) Implemented)
|
||||
self.AT_IsImplemented=wrapper(lib.AT_IsImplemented, rvals=["Implemented"])
|
||||
# ctypes.c_int AT_IsReadable(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_BOOL) Readable)
|
||||
self.AT_IsReadable=wrapper(lib.AT_IsReadable, rvals=["Readable"])
|
||||
# ctypes.c_int AT_IsWritable(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_BOOL) Writable)
|
||||
self.AT_IsWritable=wrapper(lib.AT_IsWritable, rvals=["Writable"])
|
||||
# ctypes.c_int AT_IsReadOnly(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_BOOL) ReadOnly)
|
||||
self.AT_IsReadOnly=wrapper(lib.AT_IsReadOnly, rvals=["ReadOnly"])
|
||||
|
||||
# ctypes.c_int AT_SetInt(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, AT_64 Value)
|
||||
self.AT_SetInt=wrapper(lib.AT_SetInt)
|
||||
# ctypes.c_int AT_GetInt(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_64) Value)
|
||||
self.AT_GetInt=wrapper(lib.AT_GetInt, rvals=["Value"])
|
||||
# ctypes.c_int AT_GetIntMax(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_64) MaxValue)
|
||||
self.AT_GetIntMax=wrapper(lib.AT_GetIntMax, rvals=["MaxValue"])
|
||||
# ctypes.c_int AT_GetIntMin(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_64) MinValue)
|
||||
self.AT_GetIntMin=wrapper(lib.AT_GetIntMin, rvals=["MinValue"])
|
||||
|
||||
# ctypes.c_int AT_SetFloat(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.c_double Value)
|
||||
self.AT_SetFloat=wrapper(lib.AT_SetFloat)
|
||||
# ctypes.c_int AT_GetFloat(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(ctypes.c_double) Value)
|
||||
self.AT_GetFloat=wrapper(lib.AT_GetFloat, rvals=["Value"])
|
||||
# ctypes.c_int AT_GetFloatMax(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(ctypes.c_double) MaxValue)
|
||||
self.AT_GetFloatMax=wrapper(lib.AT_GetFloatMax, rvals=["MaxValue"])
|
||||
# ctypes.c_int AT_GetFloatMin(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(ctypes.c_double) MinValue)
|
||||
self.AT_GetFloatMin=wrapper(lib.AT_GetFloatMin, rvals=["MinValue"])
|
||||
|
||||
# ctypes.c_int AT_SetBool(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, AT_BOOL Value)
|
||||
self.AT_SetBool=wrapper(lib.AT_SetBool)
|
||||
# ctypes.c_int AT_GetBool(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_BOOL) Value)
|
||||
self.AT_GetBool=wrapper(lib.AT_GetBool, rvals=["Value"])
|
||||
|
||||
# ctypes.c_int AT_SetEnumIndex(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.c_int Value)
|
||||
self.AT_SetEnumIndex=wrapper(lib.AT_SetEnumIndex)
|
||||
# ctypes.c_int AT_SetEnumString(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_WC) String)
|
||||
self.AT_SetEnumString=wrapper(lib.AT_SetEnumString)
|
||||
# ctypes.c_int AT_GetEnumIndex(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(ctypes.c_int) Value)
|
||||
self.AT_GetEnumIndex=wrapper(lib.AT_GetEnumIndex, rvals=["Value"])
|
||||
# ctypes.c_int AT_GetEnumCount(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(ctypes.c_int) Count)
|
||||
self.AT_GetEnumCount=wrapper(lib.AT_GetEnumCount, rvals=["Count"])
|
||||
# ctypes.c_int AT_IsEnumIndexAvailable(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.c_int Index, ctypes.POINTER(AT_BOOL) Available)
|
||||
self.AT_IsEnumIndexAvailable=wrapper(lib.AT_IsEnumIndexAvailable, rvals=["Available"])
|
||||
# ctypes.c_int AT_IsEnumIndexImplemented(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.c_int Index, ctypes.POINTER(AT_BOOL) Implemented)
|
||||
self.AT_IsEnumIndexImplemented=wrapper(lib.AT_IsEnumIndexImplemented, rvals=["Implemented"])
|
||||
# ctypes.c_int AT_GetEnumStringByIndex(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.c_int Index, ctypes.POINTER(AT_WC) String, ctypes.c_int StringLength)
|
||||
self.AT_GetEnumStringByIndex=wrapper(lib.AT_GetEnumStringByIndex, args=["Hndl","Feature","Index","StringLength"],
|
||||
rvals=["String"], argprep={"String":lambda StringLength: ctypes_wrap.strprep(StringLength,ctype=AT_pWC,unicode=True)()}, byref=[])
|
||||
|
||||
# ctypes.c_int AT_SetString(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_WC) String)
|
||||
self.AT_SetString=wrapper(lib.AT_SetString)
|
||||
# ctypes.c_int AT_GetString(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(AT_WC) String, ctypes.c_int StringLength)
|
||||
self.AT_GetString=wrapper(lib.AT_GetString, args=["Hndl","Feature","StringLength"],
|
||||
rvals=["String"], argprep={"String":lambda StringLength: ctypes_wrap.strprep(StringLength,ctype=AT_pWC,unicode=True)()}, byref=[])
|
||||
# ctypes.c_int AT_GetStringMaxLength(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, ctypes.POINTER(ctypes.c_int) MaxStringLength)
|
||||
self.AT_GetStringMaxLength=wrapper(lib.AT_GetStringMaxLength, rvals=["MaxStringLength"])
|
||||
|
||||
# ctypes.c_int AT_Command(AT_H Hndl, ctypes.POINTER(AT_WC) Feature)
|
||||
self.AT_Command=wrapper(lib.AT_Command)
|
||||
|
||||
# typedef int (AT_EXP_CONV *FeatureCallback)(AT_H Hndl, const AT_WC* Feature, void* Context);
|
||||
self.c_callback=ctypes_tools.WINFUNCTYPE(ctypes.c_int,AT_H,AT_pWC,ctypes.c_void_p)
|
||||
# ctypes.c_int AT_RegisterFeatureCallback(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, FeatureCallback EvCallback, ctypes.c_void_p Context)
|
||||
self.AT_RegisterFeatureCallback_lib=wrapper(lib.AT_RegisterFeatureCallback)
|
||||
# ctypes.c_int AT_UnregisterFeatureCallback(AT_H Hndl, ctypes.POINTER(AT_WC) Feature, FeatureCallback EvCallback, ctypes.c_void_p Context)
|
||||
self.AT_UnregisterFeatureCallback_lib=wrapper(lib.AT_UnregisterFeatureCallback)
|
||||
|
||||
# ctypes.c_int AT_QueueBuffer(AT_H Hndl, ctypes.POINTER(AT_U8) Ptr, ctypes.c_int PtrSize)
|
||||
self.AT_QueueBuffer=wrapper(lib.AT_QueueBuffer)
|
||||
# ctypes.c_int AT_WaitBuffer(AT_H Hndl, ctypes.POINTER(ctypes.POINTER(AT_U8)) Ptr, ctypes.POINTER(ctypes.c_int) PtrSize, ctypes.c_uint Timeout)
|
||||
self.AT_WaitBuffer=wrapper(lib.AT_WaitBuffer, rvals=["Ptr","PtrSize"])
|
||||
# ctypes.c_int AT_Flush(AT_H Hndl)
|
||||
self.AT_Flush=wrapper(lib.AT_Flush)
|
||||
|
||||
self._initialized=True
|
||||
|
||||
|
||||
|
||||
def AT_RegisterFeatureCallback(self, Hndl, Feature, callback, Context=None, wrap=True):
|
||||
if wrap:
|
||||
def wrapped_callback(*args):
|
||||
try:
|
||||
callback(*args)
|
||||
return 0
|
||||
except: # pylint: disable=bare-except
|
||||
return 1
|
||||
cb=self.c_callback(wrapped_callback)
|
||||
else:
|
||||
cb=self.c_callback(callback)
|
||||
self.AT_RegisterFeatureCallback_lib(Hndl,Feature,cb,Context)
|
||||
return cb
|
||||
def AT_UnregisterFeatureCallback(self, Hndl, Feature, callback, Context=None):
|
||||
self.AT_UnregisterFeatureCallback_lib(Hndl,Feature,callback,Context)
|
||||
|
||||
# def allocate_buffers(self, handle, nframes, frame_size):
|
||||
# buffs=[]
|
||||
# for _ in range(nframes):
|
||||
# b=ctypes.create_string_buffer(frame_size)
|
||||
# buffs.append(b)
|
||||
# return buffs
|
||||
def flush_buffers(self, handle):
|
||||
while True:
|
||||
try:
|
||||
self.AT_WaitBuffer(handle,0)
|
||||
except AndorSDK3LibError as e:
|
||||
if e.code in {AT_ERR.AT_ERR_TIMEDOUT,AT_ERR.AT_ERR_NODATA}:
|
||||
break
|
||||
raise
|
||||
self.AT_Flush(handle)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NBError=ImportError
|
||||
try:
|
||||
import numba as nb
|
||||
NBError=nb.errors.NumbaError
|
||||
nb_uint8_ro=nb.typeof(np.frombuffer(b"\x00",dtype="u1").reshape((1,1))) # for readonly attribute of a numpy array
|
||||
nb_width=nb.typeof(np.empty([0]).shape[0]) # pylint: disable=unsubscriptable-object
|
||||
@nb.njit(nb.uint16[:,:](nb_uint8_ro,nb_width),parallel=False,nogil=True)
|
||||
def read_uint12(raw_data, width):
|
||||
"""
|
||||
Convert packed 12bit data (3 bytes per 2 pixels) into unpacked 16bit data (2 bytes per pixel).
|
||||
|
||||
`raw_data` is a 2D numpy array with the raw frame data of dimensions ``(nrows, stride)``, where ``stride`` is the size of one row in bytes.
|
||||
`width` is the size of the resulting row in pixels; if it is 0, assumed to be maximal possible size.
|
||||
|
||||
Function semantics is identical to :func:`read_uint12`, but it is implemented with Numba to speed up calculations.
|
||||
"""
|
||||
h,s=raw_data.shape
|
||||
if width==0:
|
||||
width=(s*2)//3
|
||||
out=np.empty((h,width),dtype=nb.uint16)
|
||||
chwidth=width//2
|
||||
for i in range(h):
|
||||
for j in range(chwidth):
|
||||
fst_uint8=nb.uint16(raw_data[i,j*3])
|
||||
mid_uint8=nb.uint16(raw_data[i,j*3+1])
|
||||
lst_uint8=nb.uint16(raw_data[i,j*3+2])
|
||||
out[i,j*2]=(fst_uint8<<4)|(mid_uint8&0x0F)
|
||||
out[i,j*2+1]=(mid_uint8>>4)|(lst_uint8<<4)
|
||||
if width%2==1:
|
||||
fst_uint8=nb.uint16(raw_data[i,chwidth*3])
|
||||
mid_uint8=nb.uint16(raw_data[i,chwidth*3+1])
|
||||
out[i,width-1]=(fst_uint8<<4)|(mid_uint8&0x0F)
|
||||
return out
|
||||
except NBError:
|
||||
def read_uint12(raw_data, width):
|
||||
"""
|
||||
Convert packed 12bit data (3 bytes per 2 pixels) into unpacked 16bit data (2 bytes per pixel).
|
||||
|
||||
`raw_data` is a 2D numpy array with the raw frame data of dimensions ``(nrows, stride)``, where ``stride`` is the size of one row in bytes.
|
||||
`width` is the size of the resulting row in pixels; if it is 0, assumed to be maximal possible size.
|
||||
"""
|
||||
warnings.warn("Numba is missing, so the 12-bit data unpacking is implemented via Numpy; the performance might suffer")
|
||||
data=raw_data.astype("<u2")
|
||||
fst_uint8,mid_uint8,lst_uint8=data[:,::3],data[:,1::3],data[:,2::3]
|
||||
result=np.empty(shape=(fst_uint8.shape[0],lst_uint8.shape[1]+mid_uint8.shape[1]),dtype="<u2")
|
||||
result[:,::2]=(fst_uint8[:,:mid_uint8.shape[1]]<<4)|(mid_uint8&0x0F)
|
||||
result[:,1::2]=(mid_uint8[:,:lst_uint8.shape[1]]>>4)|(lst_uint8<<4)
|
||||
return result[:,:width] if width else result
|
||||
|
||||
wlib=AndorSDK3Lib()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,709 +0,0 @@
|
||||
# pylint: disable=spelling
|
||||
|
||||
from . import atmcd32d_defs
|
||||
from .atmcd32d_defs import DRV_STATUS, drDRV_STATUS
|
||||
from .atmcd32d_defs import define_functions
|
||||
from .atmcd32d_defs import AT_STEPMODE, AT_GATEMODE # pylint: disable=unused-import
|
||||
from .atmcd32d_defs import AC_ACQMODE, AC_READMODE, AC_TRIGGERMODE, AC_EMGAIN, AC_FEATURES # pylint: disable=unused-import
|
||||
from .atmcd32d_defs import AC_CAMERATYPE, drAC_CAMERATYPE, AC_PIXELMODE # pylint: disable=unused-import
|
||||
from .atmcd32d_defs import AC_SETFUNC, AC_GETFUNC # pylint: disable=unused-import
|
||||
from .base import AndorError
|
||||
|
||||
from ...core.utils import ctypes_wrap, py3
|
||||
from ..utils import load_lib
|
||||
|
||||
import numpy as np
|
||||
import platform
|
||||
import ctypes
|
||||
import collections
|
||||
|
||||
|
||||
|
||||
class AndorSDK2LibError(AndorError):
|
||||
"""Generic Andor SDK2 library error"""
|
||||
def __init__(self, func, code):
|
||||
self.func=func
|
||||
self.code=code
|
||||
self.name=drDRV_STATUS.get(self.code,"UNKNOWN")
|
||||
msg="function '{}' raised error {}({})".format(func,code,self.name)
|
||||
AndorError.__init__(self,msg)
|
||||
def errcheck(passing=None):
|
||||
"""
|
||||
Build an error checking function.
|
||||
|
||||
Return a function which checks return codes of Andor SDK3 library functions.
|
||||
`passing` is a list specifying which return codes are acceptable (by default only 0, which is success code, is acceptable).
|
||||
"""
|
||||
passing=set(passing) if passing is not None else set()
|
||||
passing.add(DRV_STATUS.DRV_SUCCESS) # always allow success
|
||||
def errchecker(result, func, arguments): # pylint: disable=unused-argument
|
||||
if result not in passing:
|
||||
raise AndorSDK2LibError(func.__name__,result)
|
||||
return result
|
||||
return errchecker
|
||||
|
||||
class CAndorCapabilities(atmcd32d_defs.CAndorCapabilities):
|
||||
def prep(self, struct):
|
||||
struct.ulSize=ctypes.sizeof(struct)
|
||||
return struct
|
||||
|
||||
TAmpModeSimple=collections.namedtuple("TAmpModeSimple",["channel","oamp","hsspeed","preamp"])
|
||||
TAmpModeFull=collections.namedtuple("TAmpModeFull",["channel","channel_bitdepth","oamp","oamp_kind","hsspeed","hsspeed_MHz","preamp","preamp_gain"])
|
||||
class AndorSDK2Lib:
|
||||
def __init__(self):
|
||||
self._initialized=False
|
||||
|
||||
def initlib(self):
|
||||
if self._initialized:
|
||||
return
|
||||
|
||||
solis_path=load_lib.get_program_files_folder("Andor SOLIS")
|
||||
sdk2_path=load_lib.get_program_files_folder("Andor SDK")
|
||||
archbit=platform.architecture()[0][:2]
|
||||
error_message="The library is automatically supplied with Andor Solis software or Andor SDK2 software\n"+load_lib.par_error_message.format("andor_sdk2")
|
||||
lib_names=["atmcd{}d_legacy.dll".format(archbit),"atmcd{}d.dll".format(archbit)]
|
||||
self.lib=load_lib.load_lib(lib_names,locations=("parameter/andor_sdk2",solis_path,sdk2_path,"global"),error_message=error_message,call_conv="stdcall")
|
||||
lib=self.lib
|
||||
define_functions(lib)
|
||||
|
||||
wrapper=ctypes_wrap.CFunctionWrapper(errcheck=errcheck(),default_rvals="pointer")
|
||||
default_strlen=256
|
||||
strprep=ctypes_wrap.strprep(default_strlen)
|
||||
|
||||
# ctypes.c_uint Initialize(ctypes.c_char_p dir)
|
||||
self.Initialize=wrapper(lib.Initialize)
|
||||
# ctypes.c_uint ShutDown()
|
||||
self.ShutDown=wrapper(lib.ShutDown)
|
||||
# ctypes.c_uint GetVersionInfo(ctypes.c_int arr, ctypes.c_char_p szVersionInfo, ctypes.c_ulong ui32BufferLen)
|
||||
self.GetVersionInfo=wrapper(lib.GetVersionInfo, args=["arr"], rvals=["szVersionInfo"],
|
||||
argprep={"szVersionInfo":strprep,"ui32BufferLen":default_strlen}, byref=[])
|
||||
# ctypes.c_uint GetAvailableCameras(ctypes.POINTER(ctypes.c_long) totalCameras)
|
||||
self.GetAvailableCameras=wrapper(lib.GetAvailableCameras)
|
||||
# ctypes.c_uint GetCameraHandle(ctypes.c_long cameraIndex, ctypes.POINTER(ctypes.c_long) cameraHandle)
|
||||
self.GetCameraHandle=wrapper(lib.GetCameraHandle)
|
||||
# ctypes.c_uint GetCurrentCamera(ctypes.POINTER(ctypes.c_long) cameraHandle)
|
||||
self.GetCurrentCamera=wrapper(lib.GetCurrentCamera)
|
||||
# ctypes.c_uint SetCurrentCamera(ctypes.c_long cameraHandle)
|
||||
self.SetCurrentCamera=wrapper(lib.SetCurrentCamera)
|
||||
|
||||
# # ctypes.c_uint GetCapabilities(ctypes.POINTER(AndorCapabilities) caps)
|
||||
self.GetCapabilities=wrapper(lib.GetCapabilities, rvals=["caps"],
|
||||
argprep={"caps":CAndorCapabilities.prep_struct}, rconv={"caps":CAndorCapabilities.tup_struct})
|
||||
# # ctypes.c_uint GetControllerCardModel(ctypes.c_char_p controllerCardModel)
|
||||
self.GetControllerCardModel=wrapper(lib.GetControllerCardModel, rvals=["controllerCardModel"],
|
||||
argprep={"controllerCardModel":strprep}, byref=[])
|
||||
# # ctypes.c_uint GetHeadModel(ctypes.c_char_p name)
|
||||
self.GetHeadModel=wrapper(lib.GetHeadModel, rvals=["name"],
|
||||
argprep={"name":strprep}, byref=[])
|
||||
# ctypes.c_uint GetHardwareVersion(ctypes.POINTER(ctypes.c_uint) PCB, ctypes.POINTER(ctypes.c_uint) Decode, ctypes.POINTER(ctypes.c_uint) dummy1, ctypes.POINTER(ctypes.c_uint) dummy2, ctypes.POINTER(ctypes.c_uint) CameraFirmwareVersion, ctypes.POINTER(ctypes.c_uint) CameraFirmwareBuild)
|
||||
self.GetHardwareVersion=wrapper(lib.GetHardwareVersion)
|
||||
# ctypes.c_uint GetSoftwareVersion(ctypes.POINTER(ctypes.c_uint) eprom, ctypes.POINTER(ctypes.c_uint) coffile, ctypes.POINTER(ctypes.c_uint) vxdrev, ctypes.POINTER(ctypes.c_uint) vxdver, ctypes.POINTER(ctypes.c_uint) dllrev, ctypes.POINTER(ctypes.c_uint) dllver)
|
||||
self.GetSoftwareVersion=wrapper(lib.GetSoftwareVersion)
|
||||
# ctypes.c_uint GetCameraSerialNumber(ctypes.POINTER(ctypes.c_int) number)
|
||||
self.GetCameraSerialNumber=wrapper(lib.GetCameraSerialNumber) # only iDus, set index=0
|
||||
# # ctypes.c_uint GetPixelSize(ctypes.POINTER(ctypes.c_float) xSize, ctypes.POINTER(ctypes.c_float) ySize)
|
||||
self.GetPixelSize=wrapper(lib.GetPixelSize)
|
||||
# ctypes.c_uint GetQE(ctypes.c_char_p sensor, ctypes.c_float wavelength, ctypes.c_uint mode, ctypes.POINTER(ctypes.c_float) QE)
|
||||
self.GetQE=wrapper(lib.GetQE)
|
||||
|
||||
# ctypes.c_uint InAuxPort(ctypes.c_int port, ctypes.POINTER(ctypes.c_int) state)
|
||||
self.InAuxPort=wrapper(lib.InAuxPort)
|
||||
# ctypes.c_uint OutAuxPort(ctypes.c_int port, ctypes.c_int state)
|
||||
self.OutAuxPort=wrapper(lib.OutAuxPort)
|
||||
# ctypes.c_uint GetNumberIO(ctypes.POINTER(ctypes.c_int) iNumber)
|
||||
self.GetNumberIO=wrapper(lib.GetNumberIO)
|
||||
# ctypes.c_uint GetIODirection(ctypes.c_int index, ctypes.POINTER(ctypes.c_int) iDirection)
|
||||
self.GetIODirection=wrapper(lib.GetIODirection)
|
||||
# ctypes.c_uint GetIOLevel(ctypes.c_int index, ctypes.POINTER(ctypes.c_int) iLevel)
|
||||
self.SetIODirection=wrapper(lib.SetIODirection)
|
||||
# ctypes.c_uint SetIOLevel(ctypes.c_int index, ctypes.c_int iLevel)
|
||||
self.GetIOLevel=wrapper(lib.GetIOLevel)
|
||||
# ctypes.c_uint SetIODirection(ctypes.c_int index, ctypes.c_int iDirection)
|
||||
self.SetIOLevel=wrapper(lib.SetIOLevel)
|
||||
# ctypes.c_uint SetDACOutput(ctypes.c_int iOption, ctypes.c_int iResolution, ctypes.c_int iValue)
|
||||
self.SetDACOutput=wrapper(lib.SetDACOutput)
|
||||
# ctypes.c_uint SetDACOutputScale(ctypes.c_int iScale)
|
||||
self.SetDACOutputScale=wrapper(lib.SetDACOutputScale)
|
||||
|
||||
# ctypes.c_uint GPIBReceive(ctypes.c_int id, ctypes.c_short address, ctypes.c_char_p text, ctypes.c_int size)
|
||||
self.GPIBReceive=wrapper(lib.GPIBReceive, rvals=["text"],
|
||||
argprep={"text": lambda size: strprep(size)()}, byref=[])
|
||||
# ctypes.c_uint GPIBSend(ctypes.c_int id, ctypes.c_short address, ctypes.c_char_p text)
|
||||
self.GPIBSend=wrapper(lib.GPIBSend)
|
||||
# ctypes.c_uint SetDelayGenerator(ctypes.c_int board, ctypes.c_short address, ctypes.c_int typ)
|
||||
self.SetDelayGenerator=wrapper(lib.SetDelayGenerator)
|
||||
# # ctypes.c_uint I2CBurstRead(BYTE i2cAddress, ctypes.c_long nBytes, ctypes.POINTER(BYTE) data)
|
||||
# lib.I2CBurstRead.restype=ctypes.c_uint
|
||||
# lib.I2CBurstRead.argtypes=[BYTE, ctypes.c_long, ctypes.POINTER(BYTE)]
|
||||
# lib.I2CBurstRead.argnames=["i2cAddress", "nBytes", "data"]
|
||||
# # ctypes.c_uint I2CBurstWrite(BYTE i2cAddress, ctypes.c_long nBytes, ctypes.POINTER(BYTE) data)
|
||||
# lib.I2CBurstWrite.restype=ctypes.c_uint
|
||||
# lib.I2CBurstWrite.argtypes=[BYTE, ctypes.c_long, ctypes.POINTER(BYTE)]
|
||||
# lib.I2CBurstWrite.argnames=["i2cAddress", "nBytes", "data"]
|
||||
# # ctypes.c_uint I2CRead(BYTE deviceID, BYTE intAddress, ctypes.POINTER(BYTE) pdata)
|
||||
# lib.I2CRead.restype=ctypes.c_uint
|
||||
# lib.I2CRead.argtypes=[BYTE, BYTE, ctypes.POINTER(BYTE)]
|
||||
# lib.I2CRead.argnames=["deviceID", "intAddress", "pdata"]
|
||||
# # ctypes.c_uint I2CReset()
|
||||
# lib.I2CReset.restype=ctypes.c_uint
|
||||
# lib.I2CReset.argtypes=[]
|
||||
# lib.I2CReset.argnames=[]
|
||||
# # ctypes.c_uint I2CWrite(BYTE deviceID, BYTE intAddress, BYTE data)
|
||||
# lib.I2CWrite.restype=ctypes.c_uint
|
||||
# lib.I2CWrite.argtypes=[BYTE, BYTE, BYTE]
|
||||
# lib.I2CWrite.argnames=["deviceID", "intAddress", "data"]
|
||||
|
||||
# ctypes.c_uint SetTriggerMode(ctypes.c_int mode)
|
||||
self.SetTriggerMode=wrapper(lib.SetTriggerMode)
|
||||
# ctypes.c_uint GetExternalTriggerTermination(ctypes.POINTER(ctypes.c_ulong) puiTermination)
|
||||
self.GetExternalTriggerTermination=wrapper(lib.GetExternalTriggerTermination)
|
||||
# ctypes.c_uint SetExternalTriggerTermination(ctypes.c_ulong uiTermination)
|
||||
self.SetExternalTriggerTermination=wrapper(lib.SetExternalTriggerTermination)
|
||||
# ctypes.c_uint GetTriggerLevelRange(ctypes.POINTER(ctypes.c_float) minimum, ctypes.POINTER(ctypes.c_float) maximum)
|
||||
self.GetTriggerLevelRange=wrapper(lib.GetTriggerLevelRange)
|
||||
# ctypes.c_uint SetTriggerLevel(ctypes.c_float f_level)
|
||||
self.SetTriggerLevel=wrapper(lib.SetTriggerLevel)
|
||||
# ctypes.c_uint SetTriggerInvert(ctypes.c_int mode)
|
||||
self.SetTriggerInvert=wrapper(lib.SetTriggerInvert)
|
||||
# ctypes.c_uint IsTriggerModeAvailable(ctypes.c_int iTriggerMode)
|
||||
self.IsTriggerModeAvailable=wrapper(lib.IsTriggerModeAvailable)
|
||||
# ctypes.c_uint SendSoftwareTrigger()
|
||||
self.SendSoftwareTrigger=wrapper(lib.SendSoftwareTrigger)
|
||||
# ctypes.c_uint SetAdvancedTriggerModeState(ctypes.c_int iState)
|
||||
self.SetAdvancedTriggerModeState=wrapper(lib.SetAdvancedTriggerModeState)
|
||||
# ctypes.c_uint SetFastExtTrigger(ctypes.c_int mode)
|
||||
self.SetFastExtTrigger=wrapper(lib.SetFastExtTrigger)
|
||||
# ctypes.c_uint SetChargeShifting(ctypes.c_uint NumberRows, ctypes.c_uint NumberRepeats)
|
||||
self.SetChargeShifting=wrapper(lib.SetChargeShifting)
|
||||
|
||||
errcheck_temp=errcheck(passing={20034,20035,20036,20037,20040})
|
||||
# ctypes.c_uint GetTemperature(ctypes.POINTER(ctypes.c_int) temperature)
|
||||
self.GetTemperature=wrapper(lib.GetTemperature, rvals=[None,"temperature"], errcheck=errcheck_temp)
|
||||
# ctypes.c_uint GetTemperatureF(ctypes.POINTER(ctypes.c_float) temperature)
|
||||
self.GetTemperatureF=wrapper(lib.GetTemperatureF, rvals=[None,"temperature"], errcheck=errcheck_temp)
|
||||
# ctypes.c_uint SetTemperature(ctypes.c_int temperature)
|
||||
self.SetTemperature=wrapper(lib.SetTemperature)
|
||||
# ctypes.c_uint GetTemperatureRange(ctypes.POINTER(ctypes.c_int) mintemp, ctypes.POINTER(ctypes.c_int) maxtemp)
|
||||
self.GetTemperatureRange=wrapper(lib.GetTemperatureRange)
|
||||
# ctypes.c_uint CoolerON()
|
||||
self.CoolerON=wrapper(lib.CoolerON)
|
||||
# ctypes.c_uint CoolerOFF()
|
||||
self.CoolerOFF=wrapper(lib.CoolerOFF)
|
||||
# ctypes.c_uint IsCoolerOn(ctypes.POINTER(ctypes.c_int) iCoolerStatus)
|
||||
self.IsCoolerOn=wrapper(lib.IsCoolerOn)
|
||||
# ctypes.c_uint SetCoolerMode(ctypes.c_int mode)
|
||||
self.SetCoolerMode=wrapper(lib.SetCoolerMode)
|
||||
# ctypes.c_uint SetFanMode(ctypes.c_int mode)
|
||||
self.SetFanMode=wrapper(lib.SetFanMode)
|
||||
# ctypes.c_uint GetTECStatus(ctypes.POINTER(ctypes.c_int) piFlag)
|
||||
self.GetTECStatus=wrapper(lib.GetTECStatus)
|
||||
|
||||
# ctypes.c_uint GetNumberADChannels(ctypes.POINTER(ctypes.c_int) channels)
|
||||
self.GetNumberADChannels=wrapper(lib.GetNumberADChannels)
|
||||
# ctypes.c_uint SetADChannel(ctypes.c_int channel)
|
||||
self.SetADChannel=wrapper(lib.SetADChannel)
|
||||
# ctypes.c_uint GetBitDepth(ctypes.c_int channel, ctypes.POINTER(ctypes.c_int) depth)
|
||||
self.GetBitDepth=wrapper(lib.GetBitDepth)
|
||||
# ctypes.c_uint GetNumberAmp(ctypes.POINTER(ctypes.c_int) amp)
|
||||
self.GetNumberAmp=wrapper(lib.GetNumberAmp)
|
||||
# ctypes.c_uint SetOutputAmplifier(ctypes.c_int typ)
|
||||
self.SetOutputAmplifier=wrapper(lib.SetOutputAmplifier)
|
||||
# ctypes.c_uint IsAmplifierAvailable(ctypes.c_int iamp)
|
||||
self.IsAmplifierAvailable=wrapper(lib.IsAmplifierAvailable)
|
||||
# ctypes.c_uint GetNumberPreAmpGains(ctypes.POINTER(ctypes.c_int) noGains)
|
||||
self.GetNumberPreAmpGains=wrapper(lib.GetNumberPreAmpGains)
|
||||
# ctypes.c_uint GetPreAmpGain(ctypes.c_int index, ctypes.POINTER(ctypes.c_float) gain)
|
||||
self.GetPreAmpGain=wrapper(lib.GetPreAmpGain)
|
||||
# ctypes.c_uint SetPreAmpGain(ctypes.c_int index)
|
||||
self.SetPreAmpGain=wrapper(lib.SetPreAmpGain)
|
||||
# ctypes.c_uint IsPreAmpGainAvailable(ctypes.c_int channel, ctypes.c_int amplifier, ctypes.c_int index, ctypes.c_int pa, ctypes.POINTER(ctypes.c_int) status)
|
||||
self.IsPreAmpGainAvailable=wrapper(lib.IsPreAmpGainAvailable)
|
||||
# ctypes.c_uint GetPreAmpGainText(ctypes.c_int index, ctypes.c_char_p name, ctypes.c_int length)
|
||||
self.GetPreAmpGainText=wrapper(lib.GetPreAmpGainText, args=["index"], rvals=["name"],
|
||||
argprep={"name":strprep,"length":default_strlen}, byref=[])
|
||||
# ctypes.c_uint GetAmpDesc(ctypes.c_int index, ctypes.c_char_p name, ctypes.c_int length)
|
||||
self.GetAmpDesc=wrapper(lib.GetAmpDesc, args=["index"], rvals=["name"],
|
||||
argprep={"name":strprep,"length":default_strlen}, byref=[])
|
||||
# ctypes.c_uint GetAmpMaxSpeed(ctypes.c_int index, ctypes.POINTER(ctypes.c_float) speed)
|
||||
self.GetAmpMaxSpeed=wrapper(lib.GetAmpMaxSpeed)
|
||||
# ctypes.c_uint GetSensitivity(ctypes.c_int channel, ctypes.c_int horzShift, ctypes.c_int amplifier, ctypes.c_int pa, ctypes.POINTER(ctypes.c_float) sensitivity)
|
||||
self.GetSensitivity=wrapper(lib.GetSensitivity)
|
||||
|
||||
# ctypes.c_uint GetNumberHSSpeeds(ctypes.c_int channel, ctypes.c_int typ, ctypes.POINTER(ctypes.c_int) speeds)
|
||||
self.GetNumberHSSpeeds=wrapper(lib.GetNumberHSSpeeds)
|
||||
# ctypes.c_uint GetHSSpeed(ctypes.c_int channel, ctypes.c_int typ, ctypes.c_int index, ctypes.POINTER(ctypes.c_float) speed)
|
||||
self.GetHSSpeed=wrapper(lib.GetHSSpeed)
|
||||
# ctypes.c_uint SetHSSpeed(ctypes.c_int typ, ctypes.c_int index)
|
||||
self.SetHSSpeed=wrapper(lib.SetHSSpeed)
|
||||
# ctypes.c_uint GetNumberVSSpeeds(ctypes.POINTER(ctypes.c_int) speeds)
|
||||
self.GetNumberVSSpeeds=wrapper(lib.GetNumberVSSpeeds)
|
||||
# ctypes.c_uint GetVSSpeed(ctypes.c_int index, ctypes.POINTER(ctypes.c_float) speed)
|
||||
self.GetVSSpeed=wrapper(lib.GetVSSpeed)
|
||||
# ctypes.c_uint SetVSSpeed(ctypes.c_int index)
|
||||
self.SetVSSpeed=wrapper(lib.SetVSSpeed)
|
||||
# ctypes.c_uint GetFastestRecommendedVSSpeed(ctypes.POINTER(ctypes.c_int) index, ctypes.POINTER(ctypes.c_float) speed)
|
||||
self.GetFastestRecommendedVSSpeed=wrapper(lib.GetFastestRecommendedVSSpeed)
|
||||
# ctypes.c_uint GetNumberVSAmplitudes(ctypes.POINTER(ctypes.c_int) number)
|
||||
self.GetNumberVSAmplitudes=wrapper(lib.GetNumberVSAmplitudes)
|
||||
# ctypes.c_uint GetVSAmplitudeValue(ctypes.c_int index, ctypes.POINTER(ctypes.c_int) value)
|
||||
self.GetVSAmplitudeValue=wrapper(lib.GetVSAmplitudeValue)
|
||||
# ctypes.c_uint SetVSAmplitude(ctypes.c_int index)
|
||||
self.SetVSAmplitude=wrapper(lib.SetVSAmplitude)
|
||||
# ctypes.c_uint GetVSAmplitudeString(ctypes.c_int index, ctypes.c_char_p text)
|
||||
self.GetVSAmplitudeString=wrapper(lib.GetVSAmplitudeString, rvals=["text"],
|
||||
argprep={"text":strprep}, byref=[])
|
||||
# ctypes.c_uint GetVSAmplitudeFromString(ctypes.c_char_p text, ctypes.POINTER(ctypes.c_int) index)
|
||||
self.GetVSAmplitudeFromString=wrapper(lib.GetVSAmplitudeFromString)
|
||||
# ctypes.c_uint SetHighCapacity(ctypes.c_int state)
|
||||
self.SetHighCapacity=wrapper(lib.SetHighCapacity)
|
||||
|
||||
# ctypes.c_uint SetEMGainMode(ctypes.c_int mode)
|
||||
self.SetEMGainMode=wrapper(lib.SetEMGainMode)
|
||||
# ctypes.c_uint GetEMGainRange(ctypes.POINTER(ctypes.c_int) low, ctypes.POINTER(ctypes.c_int) high)
|
||||
self.GetEMGainRange=wrapper(lib.GetEMGainRange)
|
||||
# ctypes.c_uint GetEMCCDGain(ctypes.POINTER(ctypes.c_int) gain)
|
||||
self.GetEMCCDGain=wrapper(lib.GetEMCCDGain)
|
||||
# ctypes.c_uint SetEMCCDGain(ctypes.c_int gain)
|
||||
self.SetEMCCDGain=wrapper(lib.SetEMCCDGain)
|
||||
# ctypes.c_uint GetEMAdvanced(ctypes.POINTER(ctypes.c_int) state)
|
||||
self.GetEMAdvanced=wrapper(lib.GetEMAdvanced)
|
||||
# ctypes.c_uint SetEMAdvanced(ctypes.c_int state)
|
||||
self.SetEMAdvanced=wrapper(lib.SetEMAdvanced)
|
||||
|
||||
# ctypes.c_uint GetShutterMinTimes(ctypes.POINTER(ctypes.c_int) minclosingtime, ctypes.POINTER(ctypes.c_int) minopeningtime)
|
||||
self.GetShutterMinTimes=wrapper(lib.GetShutterMinTimes)
|
||||
# ctypes.c_uint SetShutter(ctypes.c_int typ, ctypes.c_int mode, ctypes.c_int closingtime, ctypes.c_int openingtime)
|
||||
self.SetShutter=wrapper(lib.SetShutter)
|
||||
# ctypes.c_uint SetShutterEx(ctypes.c_int typ, ctypes.c_int mode, ctypes.c_int closingtime, ctypes.c_int openingtime, ctypes.c_int extmode)
|
||||
self.SetShutterEx=wrapper(lib.SetShutterEx)
|
||||
# ctypes.c_uint IsInternalMechanicalShutter(ctypes.POINTER(ctypes.c_int) InternalShutter)
|
||||
self.IsInternalMechanicalShutter=wrapper(lib.IsInternalMechanicalShutter)
|
||||
|
||||
# ctypes.c_uint GetCountConvertWavelengthRange(ctypes.POINTER(ctypes.c_float) minval, ctypes.POINTER(ctypes.c_float) maxval)
|
||||
self.GetCountConvertWavelengthRange=wrapper(lib.GetCountConvertWavelengthRange)
|
||||
# ctypes.c_uint IsCountConvertModeAvailable(ctypes.c_int mode)
|
||||
self.IsCountConvertModeAvailable=wrapper(lib.IsCountConvertModeAvailable)
|
||||
# ctypes.c_uint SetCountConvertMode(ctypes.c_int Mode)
|
||||
self.SetCountConvertMode=wrapper(lib.SetCountConvertMode)
|
||||
# ctypes.c_uint SetCountConvertWavelength(ctypes.c_float wavelength)
|
||||
self.SetCountConvertWavelength=wrapper(lib.SetCountConvertWavelength)
|
||||
|
||||
# ctypes.c_uint SetPhotonCounting(ctypes.c_int state)
|
||||
self.SetPhotonCounting=wrapper(lib.SetPhotonCounting)
|
||||
# ctypes.c_uint SetPhotonCountingThreshold(ctypes.c_long min, ctypes.c_long max)
|
||||
self.SetPhotonCountingThreshold=wrapper(lib.SetPhotonCountingThreshold)
|
||||
# ctypes.c_uint GetNumberPhotonCountingDivisions(ctypes.POINTER(ctypes.c_ulong) noOfDivisions)
|
||||
self.GetNumberPhotonCountingDivisions=wrapper(lib.GetNumberPhotonCountingDivisions)
|
||||
# ctypes.c_uint SetPhotonCountingDivisions(ctypes.c_ulong noOfDivisions, ctypes.POINTER(ctypes.c_long) divisions)
|
||||
self.SetPhotonCountingDivisions=wrapper(lib.SetPhotonCountingDivisions, rvals=[])
|
||||
|
||||
# ctypes.c_uint SetGate(ctypes.c_float delay, ctypes.c_float width, ctypes.c_float stepRenamed)
|
||||
self.SetGate=wrapper(lib.SetGate)
|
||||
# ctypes.c_uint GetGateMode(ctypes.POINTER(ctypes.c_int) piGatemode)
|
||||
self.GetGateMode=wrapper(lib.GetGateMode)
|
||||
# ctypes.c_uint SetGateMode(ctypes.c_int gatemode)
|
||||
self.SetGateMode=wrapper(lib.SetGateMode)
|
||||
|
||||
# ctypes.c_uint GetAcquisitionTimings(ctypes.POINTER(ctypes.c_float) exposure, ctypes.POINTER(ctypes.c_float) accumulate, ctypes.POINTER(ctypes.c_float) kinetic)
|
||||
self.GetAcquisitionTimings=wrapper(lib.GetAcquisitionTimings)
|
||||
# ctypes.c_uint SetExposureTime(ctypes.c_float time)
|
||||
self.SetExposureTime=wrapper(lib.SetExposureTime)
|
||||
# ctypes.c_uint GetMaximumExposure(ctypes.POINTER(ctypes.c_float) MaxExp)
|
||||
self.GetMaximumExposure=wrapper(lib.GetMaximumExposure)
|
||||
# ctypes.c_uint SetDualExposureTimes(ctypes.c_float expTime1, ctypes.c_float expTime2)
|
||||
self.SetDualExposureTimes=wrapper(lib.SetDualExposureTimes)
|
||||
# ctypes.c_uint SetDualExposureMode(ctypes.c_int mode)
|
||||
self.SetDualExposureMode=wrapper(lib.SetDualExposureMode)
|
||||
# ctypes.c_uint GetDualExposureTimes(ctypes.POINTER(ctypes.c_float) exposure1, ctypes.POINTER(ctypes.c_float) exposure2)
|
||||
self.GetDualExposureTimes=wrapper(lib.GetDualExposureTimes)
|
||||
# ctypes.c_uint GetMaximumNumberRingExposureTimes(ctypes.POINTER(ctypes.c_int) number)
|
||||
self.GetMaximumNumberRingExposureTimes=wrapper(lib.GetMaximumNumberRingExposureTimes)
|
||||
# ctypes.c_uint GetRingExposureRange(ctypes.POINTER(ctypes.c_float) fpMin, ctypes.POINTER(ctypes.c_float) fpMax)
|
||||
self.GetRingExposureRange=wrapper(lib.GetRingExposureRange)
|
||||
# ctypes.c_uint GetNumberRingExposureTimes(ctypes.POINTER(ctypes.c_int) ipnumTimes)
|
||||
self.GetNumberRingExposureTimes=wrapper(lib.GetNumberRingExposureTimes)
|
||||
# ctypes.c_uint SetRingExposureTimes(ctypes.c_int numTimes, ctypes.POINTER(ctypes.c_float) times)
|
||||
self.SetRingExposureTimes=wrapper(lib.SetRingExposureTimes, rvals=["times"], byref=[],
|
||||
argprep={"times":lambda numTimes: (ctypes.c_float*numTimes)()},
|
||||
rconv={"times": lambda v,_,kwargs: np.ctypeslib.as_array(v,(kwargs["numTimes"],)).copy()})
|
||||
# ctypes.c_uint GetAdjustedRingExposureTimes(ctypes.c_int inumTimes, ctypes.POINTER(ctypes.c_float) fptimes)
|
||||
self.GetAdjustedRingExposureTimes=wrapper(lib.GetAdjustedRingExposureTimes, rvals=["fptimes"], byref=[],
|
||||
argprep={"fptimes":lambda inumTimes: (ctypes.c_float*inumTimes)()},
|
||||
rconv={"fptimes": lambda v,_,kwargs: np.ctypeslib.as_array(v,(kwargs["inumTimes"],)).copy()})
|
||||
|
||||
# ctypes.c_uint SetAcquisitionMode(ctypes.c_int mode)
|
||||
self.SetAcquisitionMode=wrapper(lib.SetAcquisitionMode)
|
||||
# ctypes.c_uint SetNumberAccumulations(ctypes.c_int number)
|
||||
self.SetNumberAccumulations=wrapper(lib.SetNumberAccumulations)
|
||||
# ctypes.c_uint SetNumberKinetics(ctypes.c_int number)
|
||||
self.SetNumberKinetics=wrapper(lib.SetNumberKinetics)
|
||||
# ctypes.c_uint SetNumberPrescans(ctypes.c_int iNumber)
|
||||
self.SetNumberPrescans=wrapper(lib.SetNumberPrescans)
|
||||
# ctypes.c_uint SetKineticCycleTime(ctypes.c_float time)
|
||||
self.SetKineticCycleTime=wrapper(lib.SetKineticCycleTime)
|
||||
# ctypes.c_uint SetAccumulationCycleTime(ctypes.c_float time)
|
||||
self.SetAccumulationCycleTime=wrapper(lib.SetAccumulationCycleTime)
|
||||
# ctypes.c_uint SetFrameTransferMode(ctypes.c_int mode)
|
||||
self.SetFrameTransferMode=wrapper(lib.SetFrameTransferMode)
|
||||
# ctypes.c_uint GetReadOutTime(ctypes.POINTER(ctypes.c_float) ReadOutTime)
|
||||
self.GetReadOutTime=wrapper(lib.GetReadOutTime)
|
||||
# ctypes.c_uint GetKeepCleanTime(ctypes.POINTER(ctypes.c_float) KeepCleanTime)
|
||||
self.GetKeepCleanTime=wrapper(lib.GetKeepCleanTime)
|
||||
# ctypes.c_uint EnableKeepCleans(ctypes.c_int iMode)
|
||||
self.EnableKeepCleans=wrapper(lib.EnableKeepCleans)
|
||||
# ctypes.c_uint SetOverlapMode(ctypes.c_int mode)
|
||||
self.SetOverlapMode=wrapper(lib.SetOverlapMode)
|
||||
|
||||
# ctypes.c_uint SetFastKinetics(ctypes.c_int exposedRows, ctypes.c_int seriesLength, ctypes.c_float time, ctypes.c_int mode, ctypes.c_int hbin, ctypes.c_int vbin)
|
||||
self.SetFastKinetics=wrapper(lib.SetFastKinetics)
|
||||
# ctypes.c_uint SetFastKineticsEx(ctypes.c_int exposedRows, ctypes.c_int seriesLength, ctypes.c_float time, ctypes.c_int mode, ctypes.c_int hbin, ctypes.c_int vbin, ctypes.c_int offset)
|
||||
self.SetFastKineticsEx=wrapper(lib.SetFastKineticsEx)
|
||||
# ctypes.c_uint GetFKExposureTime(ctypes.POINTER(ctypes.c_float) time)
|
||||
self.GetFKExposureTime=wrapper(lib.GetFKExposureTime)
|
||||
# ctypes.c_uint GetFKVShiftSpeedF(ctypes.c_int index, ctypes.POINTER(ctypes.c_float) speed)
|
||||
self.GetFKVShiftSpeedF=wrapper(lib.GetFKVShiftSpeedF)
|
||||
# ctypes.c_uint SetFKVShiftSpeed(ctypes.c_int index)
|
||||
self.SetFKVShiftSpeed=wrapper(lib.SetFKVShiftSpeed)
|
||||
# ctypes.c_uint GetNumberFKVShiftSpeeds(ctypes.POINTER(ctypes.c_int) number)
|
||||
self.GetNumberFKVShiftSpeeds=wrapper(lib.GetNumberFKVShiftSpeeds)
|
||||
|
||||
# ctypes.c_uint GetMCPGain(ctypes.POINTER(ctypes.c_int) piGain)
|
||||
self.GetMCPGain=wrapper(lib.GetMCPGain)
|
||||
# ctypes.c_uint GetMCPGainRange(ctypes.POINTER(ctypes.c_int) iLow, ctypes.POINTER(ctypes.c_int) iHigh)
|
||||
self.GetMCPGainRange=wrapper(lib.GetMCPGainRange)
|
||||
# ctypes.c_uint GetMCPVoltage(ctypes.POINTER(ctypes.c_int) iVoltage)
|
||||
self.GetMCPVoltage=wrapper(lib.GetMCPVoltage)
|
||||
# ctypes.c_uint SetMCPGain(ctypes.c_int gain)
|
||||
self.SetMCPGain=wrapper(lib.SetMCPGain)
|
||||
# ctypes.c_uint SetMCPGating(ctypes.c_int gating)
|
||||
self.SetMCPGating=wrapper(lib.SetMCPGating)
|
||||
|
||||
# ctypes.c_uint PrepareAcquisition()
|
||||
self.PrepareAcquisition=wrapper(lib.PrepareAcquisition)
|
||||
# ctypes.c_uint StartAcquisition()
|
||||
self.StartAcquisition=wrapper(lib.StartAcquisition)
|
||||
# ctypes.c_uint AbortAcquisition()
|
||||
self.AbortAcquisition=wrapper(lib.AbortAcquisition)
|
||||
# ctypes.c_uint GetAcquisitionProgress(ctypes.POINTER(ctypes.c_long) acc, ctypes.POINTER(ctypes.c_long) series)
|
||||
self.GetAcquisitionProgress=wrapper(lib.GetAcquisitionProgress)
|
||||
# ctypes.c_uint GetStatus(ctypes.POINTER(ctypes.c_int) status)
|
||||
self.GetStatus=wrapper(lib.GetStatus)
|
||||
# ctypes.c_uint GetCameraEventStatus(ctypes.POINTER(DWORD) camStatus)
|
||||
self.GetCameraEventStatus=wrapper(lib.GetCameraEventStatus)
|
||||
# ctypes.c_uint GetFrontEndStatus(ctypes.POINTER(ctypes.c_int) piFlag)
|
||||
self.GetFrontEndStatus=wrapper(lib.GetFrontEndStatus)
|
||||
# ctypes.c_uint WaitForAcquisition()
|
||||
self.WaitForAcquisition=wrapper(lib.WaitForAcquisition)
|
||||
# ctypes.c_uint WaitForAcquisitionTimeOut(ctypes.c_int iTimeOutMs)
|
||||
self.WaitForAcquisitionTimeOut=wrapper(lib.WaitForAcquisitionTimeOut)
|
||||
# ctypes.c_uint WaitForAcquisitionByHandle(ctypes.c_long cameraHandle)
|
||||
self.WaitForAcquisitionByHandle=wrapper(lib.WaitForAcquisitionByHandle)
|
||||
# ctypes.c_uint WaitForAcquisitionByHandleTimeOut(ctypes.c_long cameraHandle, ctypes.c_int iTimeOutMs)
|
||||
self.WaitForAcquisitionByHandleTimeOut=wrapper(lib.WaitForAcquisitionByHandleTimeOut)
|
||||
# ctypes.c_uint CancelWait()
|
||||
self.CancelWait=wrapper(lib.CancelWait)
|
||||
|
||||
# ctypes.c_uint SetReadMode(ctypes.c_int mode)
|
||||
self.SetReadMode=wrapper(lib.SetReadMode)
|
||||
# ctypes.c_uint GetMaximumBinning(ctypes.c_int ReadMode, ctypes.c_int HorzVert, ctypes.POINTER(ctypes.c_int) MaxBinning)
|
||||
self.GetMaximumBinning=wrapper(lib.GetMaximumBinning)
|
||||
# ctypes.c_uint GetMinimumImageLength(ctypes.POINTER(ctypes.c_int) MinImageLength)
|
||||
self.GetMinimumImageLength=wrapper(lib.GetMinimumImageLength)
|
||||
# ctypes.c_uint SetSingleTrack(ctypes.c_int centre, ctypes.c_int height)
|
||||
self.SetSingleTrack=wrapper(lib.SetSingleTrack)
|
||||
# ctypes.c_uint SetMultiTrack(ctypes.c_int number, ctypes.c_int height, ctypes.c_int offset, ctypes.POINTER(ctypes.c_int) bottom, ctypes.POINTER(ctypes.c_int) gap)
|
||||
self.SetMultiTrack=wrapper(lib.SetMultiTrack)
|
||||
# ctypes.c_uint SetRa\ndomTracks(ctypes.c_int numTracks, ctypes.POINTER(ctypes.c_int) areas)
|
||||
self.SetRandomTracks_lib=wrapper(lib.SetRandomTracks, args="all", byref=[])
|
||||
# ctypes.c_uint SetImage(ctypes.c_int hbin, ctypes.c_int vbin, ctypes.c_int hstart, ctypes.c_int hend, ctypes.c_int vstart, ctypes.c_int vend)
|
||||
self.SetImage=wrapper(lib.SetImage)
|
||||
# ctypes.c_uint SetFVBHBin(ctypes.c_int bin)
|
||||
self.SetFVBHBin=wrapper(lib.SetFVBHBin)
|
||||
# ctypes.c_uint GetImageFlip(ctypes.POINTER(ctypes.c_int) iHFlip, ctypes.POINTER(ctypes.c_int) iVFlip)
|
||||
self.GetImageFlip=wrapper(lib.GetImageFlip)
|
||||
# ctypes.c_uint GetImageRotate(ctypes.POINTER(ctypes.c_int) iRotate)
|
||||
self.SetImageFlip=wrapper(lib.SetImageFlip)
|
||||
# ctypes.c_uint SetImageRotate(ctypes.c_int iRotate)
|
||||
self.GetImageRotate=wrapper(lib.GetImageRotate)
|
||||
# ctypes.c_uint SetImageFlip(ctypes.c_int iHFlip, ctypes.c_int iVFlip)
|
||||
self.SetImageRotate=wrapper(lib.SetImageRotate)
|
||||
# ctypes.c_uint GetDetector(ctypes.POINTER(ctypes.c_int) xpixels, ctypes.POINTER(ctypes.c_int) ypixels)
|
||||
self.GetDetector=wrapper(lib.GetDetector)
|
||||
|
||||
# ctypes.c_uint GetBaselineClamp(ctypes.POINTER(ctypes.c_int) state)
|
||||
self.GetBaselineClamp=wrapper(lib.GetBaselineClamp)
|
||||
# ctypes.c_uint SetBaselineClamp(ctypes.c_int state)
|
||||
self.SetBaselineClamp=wrapper(lib.SetBaselineClamp)
|
||||
# ctypes.c_uint SetBaselineOffset(ctypes.c_int offset)
|
||||
self.SetBaselineOffset=wrapper(lib.SetBaselineOffset)
|
||||
|
||||
# ctypes.c_uint GetFilterMode(ctypes.POINTER(ctypes.c_int) mode)
|
||||
self.GetFilterMode=wrapper(lib.GetFilterMode)
|
||||
# ctypes.c_uint SetFilterMode(ctypes.c_int mode)
|
||||
self.SetFilterMode=wrapper(lib.SetFilterMode)
|
||||
# ctypes.c_uint Filter_SetMode(ctypes.c_uint mode)
|
||||
self.Filter_SetMode=wrapper(lib.Filter_SetMode)
|
||||
# ctypes.c_uint Filter_GetMode(ctypes.POINTER(ctypes.c_uint) mode)
|
||||
self.Filter_GetMode=wrapper(lib.Filter_GetMode)
|
||||
# ctypes.c_uint Filter_SetThreshold(ctypes.c_float threshold)
|
||||
self.Filter_SetThreshold=wrapper(lib.Filter_SetThreshold)
|
||||
# ctypes.c_uint Filter_GetThreshold(ctypes.POINTER(ctypes.c_float) threshold)
|
||||
self.Filter_GetThreshold=wrapper(lib.Filter_GetThreshold)
|
||||
# ctypes.c_uint Filter_SetDataAveragingMode(ctypes.c_int mode)
|
||||
self.Filter_SetDataAveragingMode=wrapper(lib.Filter_SetDataAveragingMode)
|
||||
# ctypes.c_uint Filter_GetDataAveragingMode(ctypes.POINTER(ctypes.c_int) mode)
|
||||
self.Filter_GetDataAveragingMode=wrapper(lib.Filter_GetDataAveragingMode)
|
||||
# ctypes.c_uint Filter_SetAveragingFrameCount(ctypes.c_int frames)
|
||||
self.Filter_SetAveragingFrameCount=wrapper(lib.Filter_SetAveragingFrameCount)
|
||||
# ctypes.c_uint Filter_GetAveragingFrameCount(ctypes.POINTER(ctypes.c_int) frames)
|
||||
self.Filter_GetAveragingFrameCount=wrapper(lib.Filter_GetAveragingFrameCount)
|
||||
# ctypes.c_uint Filter_SetAveragingFactor(ctypes.c_int averagingFactor)
|
||||
self.Filter_SetAveragingFactor=wrapper(lib.Filter_SetAveragingFactor)
|
||||
# ctypes.c_uint Filter_GetAveragingFactor(ctypes.POINTER(ctypes.c_int) averagingFactor)
|
||||
self.Filter_GetAveragingFactor=wrapper(lib.Filter_GetAveragingFactor)
|
||||
|
||||
# ctypes.c_uint GetSizeOfCircularBuffer(ctypes.POINTER(ctypes.c_long) index)
|
||||
self.GetSizeOfCircularBuffer=wrapper(lib.GetSizeOfCircularBuffer)
|
||||
# ctypes.c_uint FreeInternalMemory()
|
||||
self.FreeInternalMemory=wrapper(lib.FreeInternalMemory)
|
||||
# ctypes.c_uint GetImagesPerDMA(ctypes.POINTER(ctypes.c_ulong) images)
|
||||
self.GetImagesPerDMA=wrapper(lib.GetImagesPerDMA)
|
||||
# ctypes.c_uint SetDMAParameters(ctypes.c_int MaxImagesPerDMA, ctypes.c_float SecondsPerDMA)
|
||||
self.SetDMAParameters=wrapper(lib.SetDMAParameters)
|
||||
|
||||
buffer16_prep=ctypes_wrap.buffprep(0,"<u2")
|
||||
buffer32_prep=ctypes_wrap.buffprep(0,"<u4")
|
||||
buffer16_conv=ctypes_wrap.buffconv(0,"<u2")
|
||||
buffer32_conv=ctypes_wrap.buffconv(0,"<u4")
|
||||
# ctypes.c_uint GetOldestImage(ctypes.POINTER(ctypes.c_long) arr, ctypes.c_ulong size)
|
||||
self.GetOldestImage=wrapper(lib.GetOldestImage, rvals=["arr"],
|
||||
argprep={"arr":buffer32_prep}, rconv={"arr":buffer32_conv}, byref=[])
|
||||
# ctypes.c_uint GetOldestImage16(ctypes.POINTER(WORD) arr, ctypes.c_ulong size)
|
||||
self.GetOldestImage16=wrapper(lib.GetOldestImage16, rvals=["arr"],
|
||||
argprep={"arr":buffer16_prep}, rconv={"arr":buffer16_conv}, byref=[])
|
||||
# ctypes.c_uint GetMostRecentImage(ctypes.POINTER(ctypes.c_long) arr, ctypes.c_ulong size)
|
||||
self.GetMostRecentImage=wrapper(lib.GetMostRecentImage, rvals=["arr"],
|
||||
argprep={"arr":buffer32_prep}, rconv={"arr":buffer32_conv}, byref=[])
|
||||
# ctypes.c_uint GetMostRecentImage16(ctypes.POINTER(WORD) arr, ctypes.c_ulong size)
|
||||
self.GetMostRecentImage16=wrapper(lib.GetMostRecentImage16, rvals=["arr"],
|
||||
argprep={"arr":buffer16_prep}, rconv={"arr":buffer16_conv}, byref=[])
|
||||
# ctypes.c_uint GetMostRecentColorImage16(ctypes.c_ulong size, ctypes.c_int algorithm, ctypes.POINTER(WORD) red, ctypes.POINTER(WORD) green, ctypes.POINTER(WORD) blue)
|
||||
self.GetMostRecentColorImage16=wrapper(lib.GetMostRecentColorImage16, rvals=["red","green","blue"],
|
||||
argprep={ch:buffer16_prep for ch in["red","green","blue"]}, rconv={ch:buffer16_conv for ch in["red","green","blue"]}, byref=[])
|
||||
# ctypes.c_uint GetNumberNewImages(ctypes.POINTER(ctypes.c_long) first, ctypes.POINTER(ctypes.c_long) last)
|
||||
self.GetNumberNewImages=wrapper(lib.GetNumberNewImages)
|
||||
# ctypes.c_uint GetNumberAvailableImages(ctypes.POINTER(ctypes.c_long) first, ctypes.POINTER(ctypes.c_long) last)
|
||||
self.GetNumberAvailableImages=wrapper(lib.GetNumberAvailableImages)
|
||||
# ctypes.c_uint GetTotalNumberImagesAcquired(ctypes.POINTER(ctypes.c_long) index)
|
||||
self.GetTotalNumberImagesAcquired=wrapper(lib.GetTotalNumberImagesAcquired)
|
||||
def images_buffer16_prep(size):
|
||||
return buffer16_prep(size)
|
||||
def images_buffer32_prep(size):
|
||||
return buffer32_prep(size)
|
||||
def images_buffer16_conv(buff, _, kwargs):
|
||||
return buffer16_conv(buff,kwargs["size"])
|
||||
def images_buffer32_conv(buff, _, kwargs):
|
||||
return buffer32_conv(buff,kwargs["size"])
|
||||
# ctypes.c_uint GetImages(ctypes.c_long first, ctypes.c_long last, ctypes.POINTER(ctypes.c_long) arr, ctypes.c_ulong size, ctypes.POINTER(ctypes.c_long) validfirst, ctypes.POINTER(ctypes.c_long) validlast)
|
||||
self.GetImages=wrapper(lib.GetImages, rvals=["arr","validfirst","validlast"],
|
||||
argprep={"arr":images_buffer32_prep}, rconv={"arr":images_buffer32_conv}, byref=["validfirst","validlast"])
|
||||
# ctypes.c_uint GetImages16(ctypes.c_long first, ctypes.c_long last, ctypes.POINTER(WORD) arr, ctypes.c_ulong size, ctypes.POINTER(ctypes.c_long) validfirst, ctypes.POINTER(ctypes.c_long) validlast)
|
||||
self.GetImages16=wrapper(lib.GetImages16, rvals=["arr","validfirst","validlast"],
|
||||
argprep={"arr":images_buffer16_prep}, rconv={"arr":images_buffer16_conv}, byref=["validfirst","validlast"])
|
||||
# ctypes.c_uint GetAcquiredData(ctypes.POINTER(ctypes.c_long) arr, ctypes.c_ulong size)
|
||||
self.GetAcquiredData=wrapper(lib.GetAcquiredData, rvals=["arr"],
|
||||
argprep={"arr":buffer32_prep}, rconv={"arr":buffer32_conv}, byref=[])
|
||||
# ctypes.c_uint GetAcquiredData16(ctypes.POINTER(WORD) arr, ctypes.c_ulong size)
|
||||
self.GetAcquiredData16=wrapper(lib.GetAcquiredData16, rvals=["arr"],
|
||||
argprep={"arr":buffer16_prep}, rconv={"arr":buffer16_conv}, byref=[])
|
||||
|
||||
# ctypes.c_uint GetMetaDataInfo(ctypes.c_void_p TimeOfStart, ctypes.POINTER(ctypes.c_float) pfTimeFromStart, ctypes.c_uint index)
|
||||
self.GetMetaDataInfo=wrapper(lib.GetMetaDataInfo)
|
||||
# ctypes.c_uint SetMetaData(ctypes.c_int state)
|
||||
self.SetMetaData=wrapper(lib.SetMetaData)
|
||||
# ctypes.c_uint GetMetaData(ctypes.POINTER(ctypes.c_ubyte) data, ctypes.c_uint _ui_index)
|
||||
self.GetMetaData=wrapper(lib.GetMetaData)
|
||||
|
||||
# ctypes.c_uint SetDriverEvent(HANDLE driverEvent)
|
||||
self.SetDriverEvent=wrapper(lib.SetDriverEvent)
|
||||
# ctypes.c_uint SetAcqStatusEvent(HANDLE statusEvent)
|
||||
self.SetAcqStatusEvent=wrapper(lib.SetAcqStatusEvent)
|
||||
# ctypes.c_uint SetFrontEndEvent(HANDLE driverEvent)
|
||||
self.SetFrontEndEvent=wrapper(lib.SetFrontEndEvent)
|
||||
# ctypes.c_uint SetOverTempEvent(HANDLE tempEvent)
|
||||
self.SetOverTempEvent=wrapper(lib.SetOverTempEvent)
|
||||
# ctypes.c_uint SetSaturationEvent(HANDLE saturationEvent)
|
||||
self.SetSaturationEvent=wrapper(lib.SetSaturationEvent)
|
||||
# ctypes.c_uint SetTECEvent(HANDLE driverEvent)
|
||||
self.SetTECEvent=wrapper(lib.SetTECEvent)
|
||||
|
||||
|
||||
self._initialized=True
|
||||
|
||||
return
|
||||
|
||||
# # ctypes.c_uint GetHVflag(ctypes.POINTER(ctypes.c_int) bFlag)
|
||||
# lib.GetHVflag.restype=ctypes.c_uint
|
||||
# lib.GetHVflag.argtypes=[ctypes.POINTER(ctypes.c_int)]
|
||||
# lib.GetHVflag.argnames=["bFlag"]
|
||||
# # ctypes.c_uint GetPhosphorStatus(ctypes.POINTER(ctypes.c_int) piFlag)
|
||||
# lib.GetPhosphorStatus.restype=ctypes.c_uint
|
||||
# lib.GetPhosphorStatus.argtypes=[ctypes.POINTER(ctypes.c_int)]
|
||||
# lib.GetPhosphorStatus.argnames=["piFlag"]
|
||||
# # ctypes.c_uint SetPhosphorEvent(HANDLE driverEvent)
|
||||
# lib.SetPhosphorEvent.restype=ctypes.c_uint
|
||||
# lib.SetPhosphorEvent.argtypes=[HANDLE]
|
||||
# lib.SetPhosphorEvent.argnames=["driverEvent"]
|
||||
# # ctypes.c_uint SetCameraLinkMode(ctypes.c_int mode)
|
||||
# lib.SetCameraLinkMode.restype=ctypes.c_uint
|
||||
# lib.SetCameraLinkMode.argtypes=[ctypes.c_int]
|
||||
# lib.SetCameraLinkMode.argnames=["mode"]
|
||||
# # ctypes.c_uint SetCameraStatusEnable(DWORD Enable)
|
||||
# lib.SetCameraStatusEnable.restype=ctypes.c_uint
|
||||
# lib.SetCameraStatusEnable.argtypes=[DWORD]
|
||||
# lib.SetCameraStatusEnable.argnames=["Enable"]
|
||||
# # ctypes.c_uint SetComplexImage(ctypes.c_int numAreas, ctypes.POINTER(ctypes.c_int) areas)
|
||||
# lib.SetComplexImage.restype=ctypes.c_uint
|
||||
# lib.SetComplexImage.argtypes=[ctypes.c_int, ctypes.POINTER(ctypes.c_int)]
|
||||
# lib.SetComplexImage.argnames=["numAreas", "areas"]
|
||||
# # ctypes.c_uint SetCropMode(ctypes.c_int active, ctypes.c_int cropHeight, ctypes.c_int reserved)
|
||||
# lib.SetCropMode.restype=ctypes.c_uint
|
||||
# lib.SetCropMode.argtypes=[ctypes.c_int, ctypes.c_int, ctypes.c_int]
|
||||
# lib.SetCropMode.argnames=["active", "cropHeight", "reserved"]
|
||||
# # ctypes.c_uint SetCustomTrackHBin(ctypes.c_int bin)
|
||||
# lib.SetCustomTrackHBin.restype=ctypes.c_uint
|
||||
# lib.SetCustomTrackHBin.argtypes=[ctypes.c_int]
|
||||
# lib.SetCustomTrackHBin.argnames=["bin"]
|
||||
# # ctypes.c_uint SetIsolatedCropMode(ctypes.c_int active, ctypes.c_int cropheight, ctypes.c_int cropwidth, ctypes.c_int vbin, ctypes.c_int hbin)
|
||||
# lib.SetIsolatedCropMode.restype=ctypes.c_uint
|
||||
# lib.SetIsolatedCropMode.argtypes=[ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
|
||||
# lib.SetIsolatedCropMode.argnames=["active", "cropheight", "cropwidth", "vbin", "hbin"]
|
||||
# ctypes.c_uint SetIsolatedCropModeEx(ctypes.c_int active, ctypes.c_int cropheight, ctypes.c_int cropwidth, ctypes.c_int vbin, ctypes.c_int hbin, ctypes.c_int cropleft, ctypes.c_int cropbottom)
|
||||
# lib.SetIsolatedCropModeEx.restype=ctypes.c_uint
|
||||
# lib.SetIsolatedCropModeEx.argtypes=[ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
|
||||
# lib.SetIsolatedCropModeEx.argnames=["active", "cropheight", "cropwidth", "vbin", "hbin", "cropleft", "cropbottom"]
|
||||
# # ctypes.c_uint SetIsolatedCropModeType(ctypes.c_int type)
|
||||
# lib.SetIsolatedCropModeType.restype=ctypes.c_uint
|
||||
# lib.SetIsolatedCropModeType.argtypes=[ctypes.c_int]
|
||||
# lib.SetIsolatedCropModeType.argnames=["type"]
|
||||
# # ctypes.c_uint SetMultiTrackHBin(ctypes.c_int bin)
|
||||
# lib.SetMultiTrackHBin.restype=ctypes.c_uint
|
||||
# lib.SetMultiTrackHBin.argtypes=[ctypes.c_int]
|
||||
# lib.SetMultiTrackHBin.argnames=["bin"]
|
||||
# # ctypes.c_uint SetMultiTrackHRange(ctypes.c_int iStart, ctypes.c_int iEnd)
|
||||
# lib.SetMultiTrackHRange.restype=ctypes.c_uint
|
||||
# lib.SetMultiTrackHRange.argtypes=[ctypes.c_int, ctypes.c_int]
|
||||
# lib.SetMultiTrackHRange.argnames=["iStart", "iEnd"]
|
||||
# ctypes.c_uint SetPCIMode(ctypes.c_int mode, ctypes.c_int value)
|
||||
# lib.SetPCIMode.restype=ctypes.c_uint
|
||||
# lib.SetPCIMode.argtypes=[ctypes.c_int, ctypes.c_int]
|
||||
# lib.SetPCIMode.argnames=["mode", "value"]
|
||||
# # ctypes.c_uint SetSingleTrackHBin(ctypes.c_int bin)
|
||||
# lib.SetSingleTrackHBin.restype=ctypes.c_uint
|
||||
# lib.SetSingleTrackHBin.argtypes=[ctypes.c_int]
|
||||
# lib.SetSingleTrackHBin.argnames=["bin"]
|
||||
# # ctypes.c_uint DemosaicImage(ctypes.POINTER(WORD) grey, ctypes.POINTER(WORD) red, ctypes.POINTER(WORD) green, ctypes.POINTER(WORD) blue, ctypes.POINTER(ColorDemosaicInfo) info)
|
||||
# lib.DemosaicImage.restype=ctypes.c_uint
|
||||
# lib.DemosaicImage.argtypes=[ctypes.POINTER(WORD), ctypes.POINTER(WORD), ctypes.POINTER(WORD), ctypes.POINTER(WORD), ctypes.POINTER(ColorDemosaicInfo)]
|
||||
# lib.DemosaicImage.argnames=["grey", "red", "green", "blue", "info"]
|
||||
# # ctypes.c_uint WhiteBalance(ctypes.POINTER(WORD) wRed, ctypes.POINTER(WORD) wGreen, ctypes.POINTER(WORD) wBlue, ctypes.POINTER(ctypes.c_float) fRelR, ctypes.POINTER(ctypes.c_float) fRelB, ctypes.POINTER(WhiteBalanceInfo) info)
|
||||
# lib.WhiteBalance.restype=ctypes.c_uint
|
||||
# lib.WhiteBalance.argtypes=[ctypes.POINTER(WORD), ctypes.POINTER(WORD), ctypes.POINTER(WORD), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(WhiteBalanceInfo)]
|
||||
# lib.WhiteBalance.argnames=["wRed", "wGreen", "wBlue", "fRelR", "fRelB", "info"]
|
||||
# # ctypes.c_uint PostProcessNoiseFilter(ctypes.POINTER(ctypes.c_long) pInputImage, ctypes.POINTER(ctypes.c_long) pOutputImage, ctypes.c_int iOutputBufferSize, ctypes.c_int iBaseline, ctypes.c_int iMode, ctypes.c_float fThreshold, ctypes.c_int iHeight, ctypes.c_int iWidth)
|
||||
# lib.PostProcessNoiseFilter.restype=ctypes.c_uint
|
||||
# lib.PostProcessNoiseFilter.argtypes=[ctypes.POINTER(ctypes.c_long), ctypes.POINTER(ctypes.c_long), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_float, ctypes.c_int, ctypes.c_int]
|
||||
# lib.PostProcessNoiseFilter.argnames=["pInputImage", "pOutputImage", "iOutputBufferSize", "iBaseline", "iMode", "fThreshold", "iHeight", "iWidth"]
|
||||
# # ctypes.c_uint PostProcessCountConvert(ctypes.POINTER(ctypes.c_long) pInputImage, ctypes.POINTER(ctypes.c_long) pOutputImage, ctypes.c_int iOutputBufferSize, ctypes.c_int iNumImages, ctypes.c_int iBaseline, ctypes.c_int iMode, ctypes.c_int iEmGain, ctypes.c_float fQE, ctypes.c_float fSensitivity, ctypes.c_int iHeight, ctypes.c_int iWidth)
|
||||
# lib.PostProcessCountConvert.restype=ctypes.c_uint
|
||||
# lib.PostProcessCountConvert.argtypes=[ctypes.POINTER(ctypes.c_long), ctypes.POINTER(ctypes.c_long), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_float, ctypes.c_float, ctypes.c_int, ctypes.c_int]
|
||||
# lib.PostProcessCountConvert.argnames=["pInputImage", "pOutputImage", "iOutputBufferSize", "iNumImages", "iBaseline", "iMode", "iEmGain", "fQE", "fSensitivity", "iHeight", "iWidth"]
|
||||
# # ctypes.c_uint PostProcessPhotonCounting(ctypes.POINTER(ctypes.c_long) pInputImage, ctypes.POINTER(ctypes.c_long) pOutputImage, ctypes.c_int iOutputBufferSize, ctypes.c_int iNumImages, ctypes.c_int iNumframes, ctypes.c_int iNumberOfThresholds, ctypes.POINTER(ctypes.c_float) pfThreshold, ctypes.c_int iHeight, ctypes.c_int iWidth)
|
||||
# lib.PostProcessPhotonCounting.restype=ctypes.c_uint
|
||||
# lib.PostProcessPhotonCounting.argtypes=[ctypes.POINTER(ctypes.c_long), ctypes.POINTER(ctypes.c_long), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_float), ctypes.c_int, ctypes.c_int]
|
||||
# lib.PostProcessPhotonCounting.argnames=["pInputImage", "pOutputImage", "iOutputBufferSize", "iNumImages", "iNumframes", "iNumberOfThresholds", "pfThreshold", "iHeight", "iWidth"]
|
||||
|
||||
|
||||
|
||||
|
||||
def SetRandomTracks(self, tracks):
|
||||
ntracks=len(tracks)
|
||||
areas=(ctypes.c_int32*(ntracks*2))(*[b for t in tracks for b in t])
|
||||
self.SetRandomTracks_lib(ntracks,areas)
|
||||
|
||||
|
||||
def get_amp_mode_description(self, mode):
|
||||
"""Get full amplifier mode description"""
|
||||
ch,oamp,hssp,pa=mode
|
||||
bit_depth=self.GetBitDepth(ch)
|
||||
oamp_kind=py3.as_str(self.GetAmpDesc(oamp))
|
||||
hsspeed_hz=self.GetHSSpeed(ch,oamp,hssp)
|
||||
preamp_gain=self.GetPreAmpGain(pa)
|
||||
return TAmpModeFull(ch,bit_depth,oamp,oamp_kind,hssp,hsspeed_hz,pa,preamp_gain)
|
||||
def get_all_amp_modes(self):
|
||||
"""
|
||||
Get all available preamp modes with their description.
|
||||
|
||||
Each preamp mode is characterized by an AD channel index, amplifier index, channel speed (horizontal scan speed) index and preamp gain index.
|
||||
Return list of tuples ``(channel, channel_bitdepth, oamp, oamp_kind, hsspeed, hsspeed_MHz, preamp, preamp_gain)``,
|
||||
where ``channel``, ``oamp``, ``hsspeed`` and ``preamp`` are indices, while ``channel_bitdepth``, ``oamp_kind``, ``hsspeed_MHz`` and ``preamp_gain`` are descriptions.
|
||||
"""
|
||||
channels=self.GetNumberADChannels()
|
||||
oamps=self.GetNumberAmp()
|
||||
preamps=self.GetNumberPreAmpGains()
|
||||
modes=[]
|
||||
for ch in range(channels):
|
||||
bit_depth=self.GetBitDepth(ch)
|
||||
for oamp in range(oamps):
|
||||
oamp_kind=py3.as_str(self.GetAmpDesc(oamp))
|
||||
hsspeeds=self.GetNumberHSSpeeds(ch,oamp)
|
||||
for hssp in range(hsspeeds):
|
||||
hsspeed_hz=self.GetHSSpeed(ch,oamp,hssp)
|
||||
for pa in range(preamps):
|
||||
try:
|
||||
preamp_gain=self.GetPreAmpGain(pa)
|
||||
if self.IsPreAmpGainAvailable(ch,oamp,hssp,pa):
|
||||
modes.append(TAmpModeFull(ch,bit_depth,oamp,oamp_kind,hssp,hsspeed_hz,pa,preamp_gain))
|
||||
except AndorSDK2LibError:
|
||||
pass
|
||||
return modes
|
||||
def set_amp_mode(self, amp_mode):
|
||||
"""
|
||||
Setup preamp mode.
|
||||
|
||||
`amp_mode` is a tuple ``(channel, oamp, hsspeed, preamp)``, specifying AD channel index, amplifier index, channel speed (horizontal scan speed) index and preamp gain index.
|
||||
"""
|
||||
if len(amp_mode)==4:
|
||||
amp_mode=TAmpModeSimple(*amp_mode)
|
||||
else:
|
||||
amp_mode=TAmpModeFull(*amp_mode)
|
||||
if amp_mode.channel is not None:
|
||||
self.SetADChannel(amp_mode.channel)
|
||||
if amp_mode.oamp is not None:
|
||||
self.SetOutputAmplifier(amp_mode.oamp)
|
||||
if amp_mode.hsspeed is not None:
|
||||
self.SetHSSpeed(amp_mode.oamp,amp_mode.hsspeed)
|
||||
if amp_mode.preamp is not None:
|
||||
self.SetPreAmpGain(amp_mode.preamp)
|
||||
|
||||
def get_EMCCD_gain(self):
|
||||
"""
|
||||
Get current EMCCD gain.
|
||||
|
||||
Return tuple ``(gain, advanced)``.
|
||||
"""
|
||||
gain=self.GetEMCCDGain()
|
||||
advanced=self.GetEMAdvanced()
|
||||
return gain,advanced
|
||||
def set_EMCCD_gain(self, gain, advanced=None):
|
||||
"""
|
||||
Set EMCCD gain.
|
||||
|
||||
Gain goes up to 300 if ``advanced==False`` or higher if ``advanced==True`` (in this mode the sensor can be permanently damaged by strong light).
|
||||
"""
|
||||
if advanced is not None:
|
||||
self.SetEMAdvanced(advanced)
|
||||
self.SetEMCCDGain(gain)
|
||||
|
||||
|
||||
wlib=AndorSDK2Lib()
|
||||
@@ -1,10 +0,0 @@
|
||||
from ...core.devio.comm_backend import DeviceError
|
||||
|
||||
class AndorError(DeviceError):
|
||||
"""Generic Andor error"""
|
||||
class AndorTimeoutError(AndorError):
|
||||
"""Andor timeout error"""
|
||||
class AndorFrameTransferError(AndorError):
|
||||
"""Andor frame transfer error"""
|
||||
class AndorNotSupportedError(AndorError):
|
||||
"""Option not supported error"""
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,43 +0,0 @@
|
||||
import cython
|
||||
from libc.string cimport memcpy
|
||||
|
||||
ctypedef int (*pAT_WaitBuffer)(int Hndl, void **Ptr, int *PtrSize, unsigned int Timeout) noexcept nogil
|
||||
ctypedef int (*pAT_QueueBuffer)(int Hndl, void *Ptr, int PtrSize) noexcept nogil
|
||||
|
||||
@cython.cdivision(True)
|
||||
cdef int clooper(int Hndl, unsigned nbuff, void **hbuffers, int esize, int queued, int *looping, unsigned *nread,
|
||||
pAT_WaitBuffer AT_WaitBuffer, pAT_QueueBuffer AT_QueueBuffer) nogil:
|
||||
cdef int size=0
|
||||
cdef int code=0
|
||||
cdef void* buffer=<void*>(0)
|
||||
while looping[0]:
|
||||
code=AT_WaitBuffer(Hndl,&buffer,&size,300)
|
||||
if code==13 or code==11: # AT_ERR_TIMEDOUT or AT_ERR_NODATA
|
||||
continue
|
||||
if code:
|
||||
return code
|
||||
if size!=esize:
|
||||
return -1
|
||||
AT_QueueBuffer(Hndl,hbuffers[(nread[0]+queued)%nbuff],esize)
|
||||
nread[0]+=1
|
||||
return code
|
||||
|
||||
def looper(int Hndl, unsigned nbuff, size_t hbuffers, int esize, int queued, size_t looping, size_t nread,
|
||||
size_t AT_WaitBuffer, size_t AT_QueueBuffer):
|
||||
cdef int result=0
|
||||
with nogil:
|
||||
result=clooper(Hndl,nbuff,<void **>hbuffers,esize,queued,<int *>looping,<unsigned *>nread,
|
||||
<pAT_WaitBuffer>AT_WaitBuffer,<pAT_QueueBuffer>AT_QueueBuffer)
|
||||
return result
|
||||
|
||||
|
||||
cdef int ccopyframes(unsigned nbuff, char **hbuffers, unsigned size, unsigned start, unsigned ncpy, unsigned off, char *dst) nogil:
|
||||
cdef unsigned i=0
|
||||
for i in range(ncpy):
|
||||
memcpy(dst,hbuffers[(start+i)%nbuff]+off,size)
|
||||
dst+=size
|
||||
return 0
|
||||
|
||||
def copyframes(unsigned nbuff, size_t hbuffers, unsigned size, unsigned start, unsigned ncpy, unsigned off, size_t dst):
|
||||
with nogil:
|
||||
ccopyframes(nbuff,<char**>hbuffers,size,start,ncpy,off,<char*>dst)
|
||||
Reference in New Issue
Block a user