Skip to content

feat: general beamcenter calibration #57

@pdudenas

Description

@pdudenas

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

def func2(x, image, q_min, q_max, chi_min, chi_max, integrator):
    poni1, poni2, rot1, rot2 = x
    integrator.poni1 = poni1
    integrator.poni2 = poni2
    integrator.rot1 = rot1
    integrator.rot2 = rot2

    image_chi, image_int = integrator.integrate_radial(image, 150, radial_range=(q_min, q_max), azimuth_range=(chi_min, chi_max))
    return np.var(image_int[image_int != 0 ])

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions