sunpy / sunkit-spex

:construction: Under Development :construction: A package for solar X-ray spectroscopy
BSD 3-Clause "New" or "Revised" License
22 stars 26 forks source link

Implement `f_3pow` function #123

Open wtbarnes opened 11 months ago

wtbarnes commented 11 months ago

f_3pow is a function in the xray IDL package that provides a triple broken power law function. The complete code is here: https://soho.nascom.nasa.gov/solarsoft/packages/xray/idl/f_3pow.pro. This function is presumably useful either when forward modeling or fitting observed spectra.

Another approach would be to implement a function that models a power-law with $N$ breaks such that a separate function isn't needed for each kind of power-law.

settwi commented 11 months ago

Sure, we can probably modify the existing photon power law to support N breaks. We would need to think about normalization but that shouldn't be too bad.

How is it normalized in IDL? I like making the user pick a normalization energy and then setting the flux normalization there. Otherwise it can be confusing if we have a magic fixed energy like IDL does sometimes.