Skip to content

Bug in the units of the shift in Zernikes 1/2 calculation #177

Description

@tobias-liaudat

We have a small issue with the units inside the function in the code snippet below, the function takes arctan() of a quantity with units [1/m], which is dimensionally incorrect:

return (
zernike_norm_factor
* (tel_diameter / 2)
* np.sin(np.arctan((dxy / reference_pix_sampling) / tel_focal_length))
* 3.0
)

See the issue #175

There is a unit problem inside the arctan! The reference pixel shift should be unitless and the 1e-6 should be to change from [m] to [um]!

Given the small angle approximation there is almost no error with the current implementation, but has a conceptual error.

TODO:

  • Fix the unit mismatch on the function
  • Write corresponding unit test for this

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions