sbpy icon indicating copy to clipboard operation
sbpy copied to clipboard

Enable arithmetic with SpectralSource

Open mkelley opened this issue 4 years ago • 1 comments

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

mkelley avatar Mar 09 '21 15:03 mkelley

This may be addressed via #291

mkelley avatar Jan 25 '22 21:01 mkelley