sbpy
sbpy copied to clipboard
Enable arithmetic with SpectralSource
This is a request for
- [ ] a new feature
- [x] an enhancement to existing sbpy functionality
- [ ] somethings else: [explain here]
The requested changes will be implemented by
- [ ] me
- [x] the sbpy developers
High-level concept
Enable arithmetic with SpectralSource.
Proposal details
synphot SpectralSources can be added together to form a new source, or scaled. sbpy's SpectralSource is based on synphot and should do the same. This would allow, e.g., creating a combined spectrum of reflected sunlight + blackbody thermal emission.
Example (pseudo-)code
S = Sun.from_builtin('E490_2014LR').source
T_grain = 300 * u.K
refl = Ap * 10**(-0.4 * Phi(phase)) * S * a**2 / (rh / u.au)**2 / delta**2
therm = BlackbodySource(T_grain) * np.pi * a**2 / delta**2
S_grain = refl + therm
This may be addressed via #291