ljstephenson / wand

Python Wavemeter Analysis 'N' Display
2 stars 1 forks source link

Add optional argument for the location of log files #23

Open amhankin opened 7 years ago

amhankin commented 7 years ago

Is there a way to change the default path for automatically generated log files? After a quick look at wand/common/common.py it appears that it is hard coded. Can this be added as an optional argument when running wand_server and wand_client?

ljstephenson commented 7 years ago

At the moment there is not, correct. Lots of stuff is hard coded that shouldn't really be :( I'll have a look but I think logging starts up before reading the config file, which is why I hard coded it - although a command line switch would circumvent this it's probably best put in the config file no?

Apologies for the slow reply, this isn't being actively developed any more really: we're looking at replacing with something less GUI focused with better integration with our lab tools.

amhankin commented 7 years ago

An optional argument in the config file would be great, but a command line argument would work fine. When you mention the better integration with your tools, are you refereeing to running the code using ARTIQ (similar to issue #22)? We have done some work with ARTIQ in our lab, so I would be interested if you're willing to share.

I need to make more changes covered in this issue, so I am planning on forking this code. Would you prefer that I submit pull requests for changes like this one, or should I just work on it independently (since you are no longer maintaining the code base)?

Off topic, but to add some context: One of your alumni from your lab suggested that I look into your code. I am currently planning on running Wand with our WS8-2, which uses two switches, one in NIR (from Totpica/High Finesse) and one VIS (we are looking to replace a Toptica switch with one from Leoni). The current version of the code works when using the switches that are sold with the wavemeter, but in order to deal with a High Finesse/Leoni combo, it appears that we will have to modify the code. Are there any issues you can think of that would make this impossible? I can see no obvious show stoppers, but it will take a bit of work.

ljstephenson commented 7 years ago

ARTIQ is the main focus of the planned replacement, yes. The idea is that actually most of the use cases for monitoring these lasers should be automated, and the only use for a GUI is when actually looking for a stable mode to operate on. Non-GUI use cases which are currently handled by humans would be things like wavemeter calibration and retuning lasers for which we rely on passive stability.

It's up to you really, we are still using the code (since it works and no one has had time to work on the replacement yet!) This change certainly was one I had wanted to do something about but didn't get to.

There is some scope to use non-integrated switches - in our lab we have a WS7 with a Leoni switch. If you look at the TestServer2.json example config and switcher.py, this shows how we do it. Here be dragons though - the difficulty with that is that the exposure time of the wavemeter may overlap with the switch between lasers, and so at least one measurement is garbage. We have successfully gotten around this by dropping the first couple of measurements after a switch, but that's a really hacky and horrid method obviously. The reason I drop more than one is because the the wavemeter sends the raw exposure to the computer, which then does the frequency calculation before making it available through the user API. This means there is a lag of unspecified duration between an exposure being taken and the measurement being available.

The "proper" way to do it would be to use the callback mechanism in the HighFinesse documentation to get measurements, since these come with a timestamp of the exposure. Even then you still have to deal with the fact that the Leoni switch only guarantees a switch within (I think) 50ms, so it's not 100% obvious. If you want an example of the callbacks being used in python, this repo from one of our other graduate students will be very helpful!