For a while ipole has had two copies of some fits e.g. the Dexter fits for rotation coefficients, two codepaths for polarized vs unpolarized coefficients, and a lot of hard-to-maintain code surrounding use of the fitting functions.
This tries to eliminate the cruft in order to make debugging and fixing limitations of the coefficient fits easier, as well as make ipole faster in the process.
The most noticeable/controversial change is to the calling convention of jar_calc -- this is optional and not that related to other changes. It prevents a second call to obtain the four-vectors from the model, which is very slow for GRMHD-based models which must interpolate the relevant primitives and construct the four-vectors from them.
Otherwise, it acts primarily to centralize all fits into the symphony/ directory, and clean up their calling convention to be less verbose and more flexible (and also likely faster, due to fewer temporary allocations). Dexter and Leung '12 fits are not yet added back, but there is a clear path and place to do so alongside the existing Pandya fits -- not to mention that the results can be ported cleanly back to Symphony! Note that this will make it fail the automatic tests for a bit, before the equivalent coefficients can be supported.
This branch also standardizes somewhat the various places that emission coefficients can be set -- when coefficients are quashed by the model, or emission is quashed by e.g. nturns or counterjet studies, this is done in ipolarray.c exclusively, whereas checks on coefficient values are done in model_radiation.c, and the fits themselves and numerical stability are handled in the files in symphony/.
Finally, this commit adds some debugging output for NaN coefficients. Currently only present in debug builds but could be globally enabled.
For a while ipole has had two copies of some fits e.g. the Dexter fits for rotation coefficients, two codepaths for polarized vs unpolarized coefficients, and a lot of hard-to-maintain code surrounding use of the fitting functions.
This tries to eliminate the cruft in order to make debugging and fixing limitations of the coefficient fits easier, as well as make ipole faster in the process.
The most noticeable/controversial change is to the calling convention of jar_calc -- this is optional and not that related to other changes. It prevents a second call to obtain the four-vectors from the model, which is very slow for GRMHD-based models which must interpolate the relevant primitives and construct the four-vectors from them.
Otherwise, it acts primarily to centralize all fits into the symphony/ directory, and clean up their calling convention to be less verbose and more flexible (and also likely faster, due to fewer temporary allocations). Dexter and Leung '12 fits are not yet added back, but there is a clear path and place to do so alongside the existing Pandya fits -- not to mention that the results can be ported cleanly back to Symphony! Note that this will make it fail the automatic tests for a bit, before the equivalent coefficients can be supported.
This branch also standardizes somewhat the various places that emission coefficients can be set -- when coefficients are quashed by the model, or emission is quashed by e.g. nturns or counterjet studies, this is done in ipolarray.c exclusively, whereas checks on coefficient values are done in model_radiation.c, and the fits themselves and numerical stability are handled in the files in symphony/.
Finally, this commit adds some debugging output for NaN coefficients. Currently only present in debug builds but could be globally enabled.