mabuchilab / Instrumental

Python-based instrumentation library from the Mabuchi Lab.
http://instrumental-lib.readthedocs.org/
GNU General Public License v3.0
117 stars 77 forks source link

Thorlabs CCS Spectrometers (CCS200) not loadable #169

Open conronc opened 5 months ago

conronc commented 5 months ago

I use a CCS200 spectrometer which I can verify is appropriately connected by using the pyvisa resource manager

import pyvisa
rm = pyvisa.ResourceManager()
print(rm.list_resources(query='?*'))

output:

('USB0::0x1313::0x8089::M00723454::RAW', 'ASRL1::INSTR', 'ASRL3::INSTR', 'ASRL4::INSTR')

(the query is required to force pyvisa to recognize USB devices, otherwise it will only recognize the three ASRL devices)

However I cannot get Instrumental-lib to recognize the CCS200 thorlabs device. this device used to work with Instrumental-lib, though I do not recall which version was used on the computer that used it, something about the more recent Instrumental-lib has broken this work.

In an attempt to diagnose this, I've included the following test code in the instrumental\drivers\spectrometers\thorlabs_ccs.py

def list_instruments():
    print('did we get here') #diagnostics - CAR
    [..remaining code..]

and then attempt to call list instruments in a spyder environment

from instrumental import instrument, list_instruments,
print(list_instruments())

however the test print is never triggered. I'm not sure why this is, but it seems like there's a completely broken attempt to call this module.

-CAR

conronc commented 5 months ago

I was able to bypass this issue by importing the list_instruments() function from thorlabs_ccs.py directly

from instrumental.drivers.spectrometers.thorlabs_ccs import list_instruments

I'm not sure what is preventing the intended function of lazy loading this function definition properly, but someone may want to look into duplicating this issue.