-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: general beamcenter calibration #57
Comments
This is a faster/better version of what I did. I support shipping this in SST1RSoXS unless anybody else has a better solution. The real, long-term solution is to take the scans that @EliotGann and I did last beamtime (direct beam on detector with undulator massively detuned) and fit a Gauss2D to those results. I am an advocate for writing a macro that does this and running that macro once a day or something like that until we know how much (if at all) the beamcenter really moves. Based on our diagnosis of the ugly beam shape, I suspect that any vibrations on the mesh will move the beamcenter around potentially significantly. |
To get back to this, how do you want to integrate this into PyHyper @pbeaucage ? Put it in the RSoXS class so that it's accessible through .rsoxs, have it in it's own file, or somewhere else? |
My first vote would be to put it into the much-neglected .util. namespace, similar to the integration checking and mask drawing widgets... I'm not sure that organization makes sense but it's at least consistent with the other things around it. |
I created a util xarray accessor to hold the beamcentering. You can invoke it with If there are performance concerns with extra accessors, or you just want a class similar to the integration checking and mask utils, I can convert it. |
The beam center recorded in SST1 metadata is a decent starting place, but I find refinement is often necessary. I've found that simply minimizing the variance of I(chi) over some q slice is a pretty robust method and doesn't require having sharp peaks. The downside is it's fairly slow, calling integrate_radial. I know @pbeaucage has tinkered around with this problem, and I'm curious if anyone else has. Below is the function that I minimize with
scipy.optimize.minimize
The text was updated successfully, but these errors were encountered: