This PR modifies the phasemasks to take a grid and pupil radius as input, rather than shape / spacing or the Field. This makes things a lot simpler. Main reason for not having the Field as input is that that would mix the abstractions; right now every function which takes in a field returns a field, and doing so would break this.
This PR also makes the distinction between functional and other things stronger: functionalonly contains functions which take in Fields and return Fields.
To achieve this I've moved the seidel and zernike aberrations to the utils (plus small functions like wrap_phase. The name and ordering for now is fluid, will fix this up in the next PR which will clean up utils and ops.
Essentially, this PR is a start to the following structure
Functional - only and only functions which transform Fields (and sources).
Elements - Functional, but in a stateful class to make them into layers.
Systems - Microscopes, 4f systems, etc.
Ops and Utils - to be cleaned, but more or less everything else.
Closing based on our discussion: we'll keep the structural change (initializers.py) but not the changes to the phase mask initializer function signatures.
This PR modifies the phasemasks to take a grid and pupil radius as input, rather than shape / spacing or the
Field
. This makes things a lot simpler. Main reason for not having theField
as input is that that would mix the abstractions; right now every function which takes in a field returns a field, and doing so would break this.This PR also makes the distinction between
functional
and other things stronger:functional
only contains functions which take inFields
and returnFields
.To achieve this I've moved the seidel and zernike aberrations to the utils (plus small functions like
wrap_phase
. The name and ordering for now is fluid, will fix this up in the next PR which will clean up utils and ops.Essentially, this PR is a start to the following structure
Field
s (and sources).