I'm really not happy with how the transfer functions are currently defined and used. Since the integration domain is over $g$ when calculating the line profiles anyway, the conversion to $g^\ast$ is really inconvenient, as it introduces a number of numerical issues when calculating the transfer functions themselves. Consider the definition
$$
f := \frac{g}{\pi r} \sqrt{g^\ast (1 - g^\ast)} \left\lvert \frac{\partial(\alpha \beta}{\partial(r, g^\ast)} \right\rvert,
$$
which is then used to find the flux through
$$
\text{d}F = g^2 I \frac{\pi r}{ \sqrt{g^\ast (1 - g^\ast)} } f \text{d}r \text{d} g^\ast.
$$
This is itself used in the integral
$$
F = \int_{r=r_0}^{r=r_\text{max}}\int_{g^\ast=0}^{g^\ast=1} \text{d}F.
$$
It's pretty obvious that most of the terms cancel. Care when integrating comes from the regions where $g^\ast \rightarrow { 0,1 }$, but that is because by the transfer functions go to zero at those points, but $\text{d}F \rightarrow \infty$ numerically, even though there is an analytic value. The prescription is then to have a buffer $h > 0$, where special edge integrations are performed instead.
The transfer functions could far more conveniently be defined
$$
f := g\left\lvert \frac{\partial(\alpha \beta}{\partial(r, g)} \right\rvert,
$$
such that
$$
\text{d}F = g^2 I f \text{d}r \text{d} g,
$$
and the integration is then performed directly over $g$ instead of $g^\ast$, which also then elides the need for a $g \rightarrow g^\ast$ Jacobian.
Possible gripes can easily be fixed in this formalism too:
- With $g^\ast$ we can integrate over the full energy. So too with $g$, since we need to rebin anyway when extracting the line profiles, so we just integrate over the limits of the bins.
- How would one know when to use which transfer function? Easy, simply set $f=0$ everywhere except $g_\text{min} \leq g \leq g_\text{max}$. Infact, one can even simplify the total integral this way too, by adding the transfer functions all together for different radi, and then integrating over $g$.
It seems the transfer functions could be so much easier to use when defined this way.