-
Notifications
You must be signed in to change notification settings - Fork 0
wiregrid: Add bias step measurements during calibration #239
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
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 making this PR, I would definitely like to have biasstep when wiregrid is in! I'm not sure how to solve codecov error, we may need Brian's advice.
- I'm fine but I wonder having biasstep 4 times might be too much, we might only need twice.
- I'm not sure how helpful it is to take data when wiregrid is moving (insert/eject). I think it's more helpful to stream for 30 seconds when wiregrid is ejected.
If you click through on the failing check, '...' -> 'View details' -> 'View this Pull Request on Codecov', you'll see a page like this: https://app.codecov.io/gh/simonsobs/sorunlib/pull/239?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term=simonsobs There you'll see lines not covered by tests. The decrease in test coverage is what's causing the check to fail. So the test cases do not cover, in this instance, the lines where an insert fails and we try to eject. I'm wondering about the utility of ejecting after a failed insert. How likely is it that this works? Everywhere else we just fail when an insert/eject happens and state that the position needs to be inspected before continuing observations. I sort of think we should do the same here. |
I agree with you. I modified the argument. Now, we have
For example, what is the purpose of the 30-second stream? If needed, I can add it. |
I fixed it.
That’s a good point. We had one insert failure before because the limit switch didn’t work properly. It only happened once, so I agree that it’s better to remove the exception and ensure that we inspect the position before continuing observations. |
The purpose of 30 seconds stream with wiregrid ejected is to measure the non-wg instrumental polarization (background polarization). Currently wg-pileline estimates background pol as component which does not depend on wg angle from data when wiregrid is inserted, but I think direct measurement can be helpful to measure polarization efficiency. I thought this was also the reason why "calibrate" start to stream before wg insertion. I think the data when wiregrid is moving is much more complex and is not very useful. |
ykyohei
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 fine but I wonder having biasstep 4 times might be too much, we might only need twice.
I agree with you. I modified the argument. Now, we have
bias_step_wo_wg(defualt=True) andbias_step_wt_wg(default=False). Nominally, we just perform thebias_stepbefore insert and after eject (without wiregrid on the window). But, for the test or future request, I added the argumentbias_step_wt_wg, which will perform the bias_step before and after the rotation with wiregrid on the window.
I should have commented more explicitly.
I think bias_step_wt_wg is more important for wiregrid calibration so it should be run by default, bias_step_wo_wg is helpful to understand instruments but it's less useful for calibration. I was actually thinking in different way. I thought running pair of biasstep with and without wiregrid before "calibration" might be enough. because the duration of wg measurement is short and drift of detector properties are likely to be small. What do you think?
Oh, I misunderstood. I agree that we prefer to have two bias steps with and without wg before calibration. For the time drift, the stepwise rotation itself takes ~4min. Probably, there is not much change. I changed the arguments to |
|
@ykyohei |
ykyohei
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.
Thank you for the changes, looks mostly good to me. I will leave Brian to approve this.
|
@BrianJKoopman |
BrianJKoopman
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 PR! I mostly have small comments about the error handling, and a question about the sleep after each bias step.
The large comment here relates to the structure of the calibrate function. Rather than having two separate blocks that deal with when we use a bias step flag vs when we do not, I suggested merging the two blocks, interrupting streaming where needed to run a bias step. Let me know whether you find this more readable or not.
|
@BrianJKoopman , @ykyohei |
Sorry, I'm not seeing responses or a new commit. Did your push not go through? |
I did not push anything. I commented on each of your comments before. Please check them. |
Removed error handling for wiregrid insertion failure.
Co-authored-by: Brian Koopman <[email protected]>
…onstant() were removed.
BrianJKoopman
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 updates on this! Looks good to me.
Purpose
To understand the time constant deeply, we would like to perform bias step measurements before and after the wiregrid calibration.
Changes
insert()and alsoeject()incalibrate()function.insert()in thecalibrate()function, and addeject()in the exception.Changed files
src/sorunlib/wiregrid.pytests/test_wiregrid.py