NASA-Planetary-Science / sbpy

A Python package for small bodies research
https://sbpy.org/
Other
68 stars 34 forks source link

Enable arithmetic with SpectralSource #272

Open mkelley opened 3 years ago

mkelley commented 3 years ago

This is a request for

The requested changes will be implemented by

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
mkelley commented 2 years ago

This may be addressed via #291