Jammy2211 / PyAutoGalaxy

PyAutoGalaxy: Open-Source Multiwavelength Galaxy Structure & Morphology
https://pyautogalaxy.readthedocs.io/
MIT License
26 stars 13 forks source link

Background Sky Modeling #157

Closed Jammy2211 closed 4 months ago

Jammy2211 commented 4 months ago

Implements a Sky light profile which when included in galaxies models the background sky surrounding them.

This includes a lp_linear.Sky which fits for the sky as a linear light profile.

The linear sky light profile, representing the background sky emission as a constant sheet of values.

For a positive only linear solver, a single sky profile cannot be used to solve for the sky background robustly. This is because the solution must be positive, meaning that negative solutions are not accessible.

To address this, the sky is represented by two flat sky profiles, one with a positive intensity and one with a negative intensity. The positive linear solver then fits for the both the positive and negative sky values. The solution will have one of these values as zero, and the other as the sky background value.

When a positive-negative solver is used, no loss of performance is incurred by using two profiles, even though the two solutions are fully degenerate. The same API is therefore used for both solvers, for convenience.