-
Notifications
You must be signed in to change notification settings - Fork 0
Add fixed tones support #440
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
Conversation
|
Hi Tristan, this looks like a good start! A few comments:
One more thing is that recently I've found type hinting and static type checking to be very helpful for code readability and catching bugs early. For instance, it would be a lot clearer if the |
|
Thanks for the rapid feedback! That all makes sense and I'll make those changes |
sodetlib/operations/uxm_setup.py
Outdated
| return True, summary | ||
|
|
||
|
|
||
| def setup_fixed_tones(S, cfg, freq, tone_power=10, update_cfg=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably also need an automated procedure to find the frequencies to use based on gaps where resonances don't exist from the tunefiles or find_freq results.
sodetlib/stream.py
Outdated
| # ensure fixed tones are on | ||
| for band in S.bands: | ||
| if "fixed_tones" in cfg.dev.bands[band]: | ||
| uxm_setup.turn_on_fixed_tones(S, cfg, band) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this will work since you need to run tracking_setup after turning on fixed tones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just figure out how to enable fixed tones without tracking setup... I imagine there's just a register or two that needs to be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had looked through tracking_setup and it wasn't clear to me what would be missing, but in any case I will have to go through all of these steps with testing and I should find out then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a turn_on_fixed_tones call to relock_tracking_setup so that if it disables these channels they should be restored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need an additional enable_fixed_tones cfg entry which allows us to disable fixed tones without removing the fixed-tone dictionary.
|
I just pushed a new draft addressing some of the suggestions so far:
After realising that you need the subband frequency offsets, I moved all the steps into the |
|
Sorry should've mentioned this, there is already an algorithm in pysmurf that we tend to use when doing this manually: |
|
We may want to make something custom though that is based on an existing tunefile and doesn't need to rescan. |
Oh man, I hadn't seen that! I'll take a look and see how it could fit in. |
|
I tried to address the suggestions so far and did some testing on the SLAC UFM today. I think functionally things are working now, and next I will polish up the code and commit history and add docstrings. |
c6ca77d to
5cce286
Compare
jlashner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes tristan! I have a few more simple requests and then I'm happy to merge (assuming its been tested)!
sodetlib/stream.py
Outdated
| # ensure fixed tones are on | ||
| for band in S.bands: | ||
| if "fixed_tones" in cfg.dev.bands[band]: | ||
| uxm_setup.turn_on_fixed_tones(S, cfg, band) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need an additional enable_fixed_tones cfg entry which allows us to disable fixed tones without removing the fixed-tone dictionary.
Thanks for the suggestions -- I'll make those changes. I've tested the individual functions, but not in a full OCS context with agents running. But I did want to try to get something like that working. |
5cce286 to
29a7040
Compare
|
Thanks for all this work @tristpinsm! Wondering if it's worth adding a call to Also should feedback be disabled in |
The way it is now, it is called in
It doesn't look like I got around to changing the code for finding fixed tone channels to use existing functions -- I can take another look at that. |
|
Ah I'd missed both of these points. Thanks @tristpinsm! Looks good on my end to rebase and merge |
Let me take one last look over if that's ok @tpsatt and @tristpinsm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, I think we should fix the broken sphinx docs build also but probably not a requirement here. I think you'll need to re-request review from @jlashner and have him approve (hopefully he doesn't charge us his google rate!)
jlashner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna approve so that you don't have to wait on me to merge, this mostly looks good!
One potential problem I see is that "turn_on_fixed_tones" can disable the feedback on active channels. This might be an issue, since the fixed-tone array in the device cfg is not reset when a new tune is taken. So its possible that a new tune is taken, the channel assignment of the new tune is slightly different so it conflicts with existing set of fixed tones, and then the turn_on_fixed_tone function overwrites real channels.
You may want to make it so that a set of fixed tones is tied to a specific tune-file, and if that tune-file is changed the fixed-tones need to be reset or they won't apply.
That'll be $10 :)
17219f5 to
60b0907
Compare
This is a draft with a proposed implementation for supporting fixed tones. If this looks good, I can proceed to testing on the SLAC system and then polish things up / add docstrings.
Right now it relies on a new function in
pysmurf(slaclab/pysmurf#796) because I thought that would be a more complete implementation, but if it's preferable to keep these changes withinsodetlibI can move it into this PR.