Closed magnium closed 7 months ago
In theory, the strobe_lump feature should also work, but I don't know how to use it and no implementation exists yet in pyseabreeze.features for OOI protocol.
Sorry, my bad. The real feature is continuous_strobe and the implementation for OOI exists. So one can add it to the list of NIRQUEST512 feature classes.
Hi @magnium
Happy to hear that python-seabreeze is useful to you!
This PR looks good! Are you still adding the continuous_strobe
feature? It sounded as if you tested it already with the NIRQUEST.
So far it adds:
integration_time
Regarding the second change, could you test if this causes problems when switching from a long integration time to a shorter one and requesting a spectrum?
import seabreeze
seabreeze.use("pyseabreeze")
from seabreeze.spectrometers import Spectrometer
spec = Spectrometer.from_first_available()
spec.integration_time_micros(1_000_000)
spec.intensities()
spec.integration_time_micros(100)
spec.intensities()
Cheers, Andreas 😃
Hi Andreas,
I see now what continuous strobe feature makes (read in the manual) but I have no possibility to test it right now (I don't have a cable to connect my NIRQuest to an oscilloscope, only a trigger cable). Still, the feature is officially supported, so I think it makes sens to add it along with the thermoelectric. Can you edit the commit to add the necessary line or can I do it? Or do I have to make another commit?
In what concerns the trigger timeout, I tested your script with a NIRQuest (with and without triggered input) and a ST (without trigger input): it works perfectly in all cases (I had to change the small integration time to 2000 µs, since the ST's min integration time is 1560 µs). BTW, the reason why I can't use the max_integration_time as a timeout in NIRQuest, is because it's 120 s (cf. with 6 s in ST, which is bearable, but still too conservative).
import seabreeze
seabreeze.use("pyseabreeze")
from seabreeze.spectrometers import Spectrometer, list_devices
from seabreeze.pyseabreeze.devices import TriggerMode
from usb.core import USBTimeoutError
print(list_devices())
spec = Spectrometer.from_first_available()
spec.trigger_mode(TriggerMode.LEVEL)
spec.integration_time_micros(1_000_000)
try:
spec.intensities()
except USBTimeoutError:
print("Timeout")
spec.integration_time_micros(2000)
try:
spec.intensities()
except USBTimeoutError:
print("Timeout")
spec.trigger_mode(TriggerMode.NORMAL)
print(spec.intensities()[0])
Cheers,
Raman
Still, the feature is officially supported, so I think it makes sens to add it along with the thermoelectric. Can you edit the commit to add the necessary line or can I do it? Or do I have to make another commit?
I'd prefer to add it once we confirm that it works. Some spectrometers might require special treatment that might not align with the datasheets.
In the meantime, I'll add your changes and cut a new release soon. We can always add more in later PRs.
Thanks again for your contribution ❤️ Cheers, Andreas
I'd prefer to add it once we confirm that it works. Some spectrometers might require special treatment that might not align with the datasheets.
I agree. Thanks for your work! Best, Raman
Hi, Thanks for the great job of creating this repository. I was interfacing our OceanView spectrometers one by one in raw mode until I stumbled on this. I added the thermo_electric feature to the list of feature classes in NIRQUEST512 after testing it with my spectrometer.
In theory, the strobe_lump feature should also work, but I don't know how to use it and no implementation exists yet in pyseabreeze.features for OOI protocol.
Another possible feature is the detector high gain mode, but 1) it doesn't seem to make any difference on my spectrometer, 2) I don't see anything in pyseabreeze.features that corresponds to this feature.
Also, here is result of running pytest: