PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
18 stars 26 forks source link

Convert Gauss1D, Drude1D to Area-Gauss/Drude-1D #181

Open els1 opened 2 years ago

els1 commented 2 years ago

Instead of using astropy's Gauss1D/Drude1D, use Area-Gauss/Drude-1D for the modelling (i.e. based on integrated strength).

jdtsmith commented 2 years ago

What do you think about Power instead of Area? That better conveys the integrated intensity of an f_nu shape.

karllark commented 2 years ago

Hummm...I prefer Area as that conveys what we are doing to my brain. But maybe I'm not understanding or in a minority. Just integration = area under the curve in a math sense.

jdtsmith commented 2 years ago

I think if you're going to contribute them back to astropy then yeah Area does make more sense. Power = area of f_nu curve. We can just refer to it as power in PAHFIT. BTW, you could certainly imagine an AreaBlackbody1D being useful, so that you could tie 2 of the BB integrated intensities together. But probably not the entire [0,infinity] area. For now Drude, ModAsymDrude, and Gaussian make the most sense, even if fitting a feature that "falls off the spectrum".

els1 commented 2 years ago

See also #155

ThomasSYLai commented 2 years ago

It's good we pass area (power) to the fitter so that different features can be tied easily during the fit. But it'd be useful to keep a function that can directly output heights (amplitudes) of the PAH and line features (if needed) for training purposes. A lot of times it's easy and straightforward to see the height of a feature in the spectrum but less intuitive for an area.

jdtsmith commented 2 years ago

Yeah I've thought the same thing. Like for the "guess" stage of the fit, it's easy to "guess" amplitude by eye, not so easy with power. In my new model context I have function for Drude/Gaussian that can take either power of amplitude. I also internally use "scaled power", which is a little easier to reason about, and takes care of the "big exponent" problem:

  Scaled Power is power scaled into the flux density units of the
    input spectrum (e.g. mJy, MJy/sr, etc.):

      SP = P lam_0/c

    An interpretation of scaled power: if a feature has a FWHM similar
    to its central wavelength, the scaled power is approximately the
    feature's peak amplitude.  Scaled power is used internally for
    fitting, so as to avoid large mismatch in numeric scale between
    powers and feature amplitudes.