beam-tracing / Scotty

Beam tracing code for diagnostics
https://scotty.readthedocs.io/en/latest/
GNU General Public License v3.0
7 stars 4 forks source link

Refactor density fitting #48

Closed ZedThree closed 2 years ago

ZedThree commented 2 years ago

Make density fitting more flexible:

The DensityFit base class basically just handles zeroing the density outside of poloidal_flux_enter. This means the derived classes only need to handle the fitting. This is done through having a private method _fit_impl ("impl" is a standard abbreviation for "implementation") that the base class calls. The magic method __call__ allows instances to be called like functions.

These changes don't touch the actual uses of find_density_1D -- as far as the rest of the code is concerned, this is still the same thing.