manoharan-lab / holopy

Hologram processing and light scattering in python
GNU General Public License v3.0
134 stars 50 forks source link

PerfectLensModel doesn't allow alpha fitting #348

Closed carolinesmartin closed 3 years ago

carolinesmartin commented 4 years ago

The model available for Mielens calculations has the scaling parameter hard coded as 1 (calc_holo(detector, scatterer, theory=theory, scaling=1.0, **optics_kwargs) in PerfectLensModel class). This makes the version of mielens that's compatible with MCMC or cma-es fitting through holopy inconsistent with the paper's version of mielens, which does include alpha as a fitting parameter.

briandleahy commented 4 years ago

The old version of the fitting interface made some assumptions about the types of arguments that would be passed to calc_holo. These assumptions were inconsistent with the needs of the lens models. As a result, @ralex0 and I did the inference separate from holopy, using holopy only to calculate holograms. As a result the MieLens fitiing code in holopy diverged a bit from the use case.

This should now be fixed by #351 for the MieLens() model.

However, there is as yet no inference machinery for the new, general Lens model ( #333 ). We should think about small restructures to holopy's inference to address this.

briandleahy commented 3 years ago

What probably needs to happen is the ScatteringTheory needs to pick up a from_parameters method and a parameters attribute, cf. Scatterer. The inference.Model class then needs to create a map from the theory's parameters.

The goal should be to delete the PerfectLensModel class, and it should just work wtih an arbitrary theory and an aberrated lens.