-
Notifications
You must be signed in to change notification settings - Fork 86
Add a bunch of new drivers #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
00152eb
Add Horiba FHR1000 driver.
thangleiter 344dc0c
Improve structure and add validators & val_mappings
thangleiter ab18555
Add example notebook.
thangleiter a7d765e
Add argument to stop() to raise errAbort exception
thangleiter ed2a88d
Make step a property
thangleiter 58bd503
Add width/relative position parameter
thangleiter be306e0
Add note about step parameter for SlitChannels
thangleiter a97896b
Merge branch 'main' into feature/horiba_fhr_1000_driver
thangleiter 2b2bd6a
Rename _private to private
thangleiter bcee2bd
Add information to example notebook.
thangleiter fae1b1b
Remove unnecessary parameters
thangleiter b446318
Rename without Model number
thangleiter b737e35
Rewrite to parse ini file for configuration.
thangleiter 4acf55b
Add connect message statement
thangleiter 93b3821
Dynamic dll filename argument
thangleiter 09605d8
Add Lighthouse Photonics Sprout G driver.
thangleiter a2daa36
Prepend Vendor to class name
thangleiter 8e2466a
Add Thermotek T255p chiller driver.
thangleiter 0381969
Simplify error handling
thangleiter 188ec7f
First version of Solstis 3 laser driver
3cbaa80
add methods _get_status and _get_wavelength and _set_wavelength
d33eade
additional methods to control the wavelength tuning (locked or not)
249d7dd
Rename Solstis to conform with convention
thangleiter 48073e2
Autoformat and sort imports:
thangleiter fc050c8
Update to new signatures and add some documentation.
thangleiter e9a27f3
Use DelegateGroupParameters for GroupedParameter's DelegateGroup.
thangleiter 3de9b47
Units and get_parsers
thangleiter d9b77e3
PEP-8
thangleiter 9a86c02
Add ramp_up method
thangleiter 8ab8d05
Merge branch 'feature/m2_solstis_driver' into tmp
thangleiter 44c9f17
Merge branch 'feature/lighthouse_photonics_sprout_g_driver' into tmp
thangleiter 62650ce
Add __init__.py
thangleiter ac2f9c9
Merge branch 'feature/horiba_fhr_1000_driver' into tmp
thangleiter e9878e9
Merge branch 'main' into feature/add_new_drivers
thangleiter fe7441e
Block notebook from executing and add header cell
thangleiter ed893a6
Fix MyPy errors
thangleiter 31fd087
Fix notebook headline
thangleiter b0d1889
Fix import
thangleiter 479cfba
add msl.loadlib to mypy overrides
thangleiter 42cdc24
add types-tqdm to test dependencies
thangleiter f3965ab
Make MotorChannel.type a classmethod
thangleiter 0157185
Drop Python 3.8 workaround (not supported anymore)
thangleiter 83b844b
Add msl.loadlib to doc requirements
thangleiter 0f0e847
Mock import in autodoc instead of install msl.loadlib
thangleiter 7f1bde2
Fix typing imports
thangleiter e06e6df
Fix remaining MyPy errors
thangleiter b58d1bd
Simplify calls to cli.SpeCommand
thangleiter 79576e3
Use _SimpleCData instead of _CData for type
thangleiter d601bc2
Validate numbers instead of ints
thangleiter a189367
Fix mocking msl import
thangleiter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,4 +131,5 @@ | |
"nidaqmx", | ||
"niswitch", | ||
"zhinst", | ||
"msl" | ||
] |
thangleiter marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,269 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "a657526c", | ||
"metadata": {}, | ||
"source": [ | ||
"# Example for Horiba FHR\n", | ||
"\n", | ||
"This driver has been tested with a FHR1000 spectrometer with one dual grating turret, an entrance slit, exit slit, and an exit slit selection mirror.\n", | ||
"\n", | ||
"The dll unfortunately does not have any version information. It was shipped with LabSpec 6.5.1. The supporting information is contained in a word document called `SpeControl_dll.docx`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "17976519-ee58-4afc-89ee-23d8475a3d14", | ||
"metadata": { | ||
"scrolled": true, | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Logging hadn't been started.\n", | ||
"Activating auto-logging. Current session state plus future input saved.\n", | ||
"Filename : C:\\Users\\Flash\\.qcodes\\logs\\command_history.log\n", | ||
"Mode : append\n", | ||
"Output logging : True\n", | ||
"Raw input log : False\n", | ||
"Timestamping : True\n", | ||
"State : active\n", | ||
"Qcodes Logfile : C:\\Users\\Flash\\.qcodes\\logs\\231006-740-qcodes.log\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import pathlib\n", | ||
"import tempfile\n", | ||
"from qcodes_contrib_drivers.drivers.Horiba.Horiba_FHR import HoribaFHR" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "4eaa3ffc-49e6-419d-a0e1-fc07d09b22b5", | ||
"metadata": { | ||
"jupyter": { | ||
"source_hidden": true | ||
}, | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"1326" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"dll_dir = r'C:\\HORIBA\\Software\\SDK FHR Express'\n", | ||
"config_file = pathlib.Path(tempfile.mkdtemp(), 'config.ini')\n", | ||
"config_file.write_text(\n", | ||
"\"\"\"[Firmware]\n", | ||
"VersionNumber=123456\n", | ||
"SerialNumber=1234567890\n", | ||
"==================================================\n", | ||
"[Port]\n", | ||
"ComPort=13\n", | ||
"Baudrate=115200\n", | ||
"Timeout=60000\n", | ||
"==================================================\n", | ||
"[Spectrometer]\n", | ||
"Focal=1000\n", | ||
"CoefficientOfAngle=0.20071286\n", | ||
"Board=1\n", | ||
"SpeedMin=500\n", | ||
"SpeedMax=280000\n", | ||
"Acceleration=400\n", | ||
"Backlash=-12500\n", | ||
"MotorStepUnit=2\n", | ||
"Reverse=0\n", | ||
"GratingNumber=2\n", | ||
"SlitNumber=2\n", | ||
"==================================================\n", | ||
"[Grating1]\n", | ||
"Name=1800 gr/mm\n", | ||
"Value=1800\n", | ||
"AddrAxe=5\n", | ||
"Offset=54940\n", | ||
"Shift=0\n", | ||
"MinNm=50\n", | ||
"MaxNm=750\n", | ||
"CoefficientOfLinearity=1.000069196\n", | ||
"==================================================\n", | ||
"[Grating2]\n", | ||
"Name=600 gr/mm\n", | ||
"Value=600\n", | ||
"AddrAxe=9\n", | ||
"Offset=2554965\n", | ||
"Shift=0\n", | ||
"MinNm=50\n", | ||
"MaxNm=2000\n", | ||
"CoefficientOfLinearity=0.999935906\n", | ||
"==================================================\n", | ||
"[Slit1]\n", | ||
"Name=Front entrance slit\n", | ||
"AddrAxe=1\n", | ||
"Offset=450\n", | ||
"Minum=0\n", | ||
"Maxum=2000\n", | ||
"Coeffum=1\n", | ||
"SpeedMin=50\n", | ||
"SpeedMax=500\n", | ||
"Acceleration=150\n", | ||
"Backlash=100\n", | ||
"MotorStepUnit=1\n", | ||
"Reverse=1\n", | ||
"==================================================\n", | ||
"[Slit2]\n", | ||
"Name=Side exit slit\n", | ||
"AddrAxe=4\n", | ||
"Offset=450\n", | ||
"Minum=0\n", | ||
"Maxum=2000\n", | ||
"Coeffum=1\n", | ||
"SpeedMin=50\n", | ||
"SpeedMax=500\n", | ||
"Acceleration=150\n", | ||
"Backlash=100\n", | ||
"MotorStepUnit=1\n", | ||
"Reverse=1\n", | ||
"==================================================\n", | ||
"[Mirror2]\n", | ||
"Name=Exit mirror\n", | ||
"AddrAxe=7\n", | ||
"Delayms=100\n", | ||
"DutyCycle%=30\n", | ||
"==================================================\n", | ||
"\"\"\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "778427c9-5732-4b04-bc14-6205f2314e04", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Connected to: Horiba FHR1000 (serial:1234567890, firmware:123456) in 1.48s\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"spe = HoribaFHR('spe', dll_dir, config_file,\n", | ||
" dc_val_mappings={2: {'front': 0, 'side': 1}})" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "6b93170e-1805-48cf-b87a-af40c863ee5e", | ||
"metadata": {}, | ||
"source": [ | ||
"The `dc_val_mappings` parameter allows to map the binary positions of the DC motors to a more inuititive string.\n", | ||
"\n", | ||
"The various controllers are stored as `ChannelList`s:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "b3293c81-6ab9-4799-ac94-3bdd2bc49e6b", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"grating_1800, grating_600 = spe.gratings\n", | ||
"slit_entrance, slit_exit = spe.slits\n", | ||
"mirror, = spe.mirrors" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "a71d6ef2-8f11-40bb-8e47-e2abfa3972e1", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"The main parameter each channel has is `position`. For `SlitChannel`s, there is also `width`, which should be preferred since it represents the actual opening width of the slit instead of the position of the stepper motor. To initialize the motors, meaning\n", | ||
"\n", | ||
"- move to zero order for gratings\n", | ||
"- completely close for slits\n", | ||
"\n", | ||
"call `init()`. Setting the position of a grating will turn the turret if the other grating was selected before:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f65466e7-869c-4ffc-9650-f43bd747cb1e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"grating_1800.position(600e3) # pm!\n", | ||
"grating_600.position(600e3) # will turn the turret by 180 degrees + X." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "0798cf6b", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"spe.close()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
}, | ||
"nbsphinx": { | ||
"execute": "never" | ||
}, | ||
"toc-autonumbering": true, | ||
"toc-showcode": false, | ||
"toc-showmarkdowntxt": true, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
"state": {}, | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.