GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
224 stars 105 forks source link

Monochromatic SED #1247

Closed jmeyers314 closed 11 months ago

jmeyers314 commented 1 year ago

Just one more thing I want to get in before 2.5... It'd be nice to have some syntactic sugar for creating monochromatic SEDs. As opposed to:

sed = galsim.SED(
    galsim.LookupTable(
        [0, 621, 622, 623, np.inf],
        # [0, 621, 622, 623, 10000],
        [0, 0, 1, 0, 0],
        interpolant='linear'
    ),
    wave_type='nm',
    flux_type='fphotons'
)

Now this could simply be the above, or it could be a whole galaxy emission line interface with Gaussian/Voigt/Lorentzian/... 1-d profiles. Probably above is sufficient, but wanted to discuss briefly here before committing anything.

rmjarvis commented 1 year ago

I'd suggest a subclass. galsim.EmissionLine maybe. For now we could just have it do the above given a center wavelength, equivalent width, and maybe something to say how sharp it is. (E.g. FWHM, which could default to 1 nm as above.) If the sawtooth shape isn't good enough for some purposes, we could let people extend this later to have other line shapes, but probably no strong impetus to do anything complicated yet.

rmjarvis commented 11 months ago

Done. #1249