blase
blase copied to clipboard
Advanced lineshapes for broad lines
We will need to implement advanced lineshapes---or at least more flexible lineshapes---for Issue #9. The lines are so broad that the pseudo-Voigt and even the exact Voigt profiles are no longer accurate enough. We'll have to experiment with some more flexible functional forms.
I consulted some literature about advanced lineshapes and found papers on the "chi-factor" (papers involving Hartmann from 1989 and onwards). I got bogged down in some of the representations and instead decided on an expedient solution, loosely inspired by the Chi factor. We will simply use a sigmoid function:
modified_Lorentzian = (Lorentzian) * [1 + (exp(A) - 1)* S(B* [delta_lambda - lambda_trans] ) ]
where S(x) is the sigmoid function, A is a (possibly negative!) scale term, lambda_trans is the critical transition turnover wavelength, and B stretches out the sigmoid to exhibit a smooth transition from Lorentzian to sub- or super- Lorentzian. So this function has 3 free parameters: A, B, and lambda_trans. We assume the line is symmetric about the line center.
The functional form of this perturbation has a few benefits:
- It's smooth
- The smoothness of the transition is controlled by a tunable parameter
- It can handle either sub- or super-Lorentzian shapes
- It's roughly based on the Chi-factor and published works
- It's continuously differentiable
- In the limit of A --> zero, the lineshape becomes exactly Lorentzian
- It only requires elementary functions and is already implemented in PyTorch
- It enforces that the perturbation only produces absorption and not emission profiles.
So overall I like this functional form.
Key idea: We should use PySR for learning the best functional form of the broad lines.
This is slightly tricky because we need to censor the narrow lines that rest atop the broad line wings to isolate the effect. We'd probably want to pre-whiten the lines as well.
My guess at how to make PySR work:
- Curate an example dataset by collecting H lines from many synthetic spectra, masking sharp lines, and clipping to some number of pixels.
- Make a "feature" array,
Xwith $X \in \mathbb{R}^n$ a multi-dimensional input. What are the dimensions, you say? That's a matter of feature engineering ... We probably want $n\sim4$ dimensions:
For example, they could be the parameters of a coarsely fit Voigt profile:
- $X_0$ or
X[:, 0]Wavelength, $\lambda$ - $X_1$ or
X[:, 1]location, $\lambda_c$ - $X_2$ or
X[:, 2]Gaussian width, $\sigma$ - $X_3$ or
X[:, 3]Lorentzian, $\gamma$
Or you may want to add two more features: the starting and ending atomic energy level (n1 -> n2), albeit some of that information is encoded in the wavelength center (feature 1).
Only wavelength (feature 0) varies with each pixel, whereas all other features are static for each snippet of spectrum, like a piece-wise Vandermonde Matrix.
It may be unfamiliar to think of these attributes as "features" to be input into yet-another fitting step, but here's why it's a good idea. They represent the coarse features for which which we expect the greatest predictive power for correction terms.
Terms 2 and 3 may be a bad idea however--- they are only coarsely constrained and are partially degenerate. Instead we could hand in the Teff and logg as predictors. Those come for free and are exact, and correlate with the line widths. So I like those.
Or you could have wavelength, center, FWHM (determined empirically), then add Teff and logg after that as a fine adjustment. Some tradeoffs here to consider, but it seems possible.
I should mention that Miles Cranmer pitched a related idea at CCA last August (2022). His demo with PySR was to learn a cheaper/better functional form for the Voigt profile. I thought that was useful, but not strictly necessary since we had adequate pseudo-Voigt profiles, and the Exact Voigt appeared cheap enough (thought I should benchmark the difference to prove this claim).
I forget if we discussed the problem of Broad lines, but it wouldn't have been possible to demo it without first preprocessing the synthetic spectra anyways, which takes some work.
I should also mention that this Issue now feels like a blocker in the critical path--- in order to fit an entire A0V calibrator spectrum we want to infer the broad lines. Heuristics are inadequate because the lines are so deep and broad that they affect lots of spectrum.