Python implementation of the Intensity Conserving Spectral Fitting procedure (ICSF) developed by Klimchuk et al. (2016).
Clone the repository (or download the sources), and install with pip:
git clone https://github.com/gpelouze/pyicsf
cd pyicsf
pip install .
The ICSF procedure is implemented by the pyicsf.icsf() function, which takes
four arguments:
wvl(1D array): wavelength positions.I_obs(1D array, same shape aswvl): observed intensities at thewvlpositions.min_err=1e-5(float, optional): minimum error [F^i_avg − I_avg] at which the iteration stops.max_iter=100(int, optional): maximum number of iterations after which an exception is raised if the optimization has not converged.
This module also contains pyicsf.bin_function(), which integrates a function
within bins. It is used by pyicsf.icsf(), but can also generate synthetic
profiles from a known source function to test the procedure.
Very basic example:
import pyicsf
# generate a spectrum
wvl = np.linspace(-5.2, 4.8, 20)
I_obs = np.exp(-wvl**2)
# apply the ICSF procedure
I_corr = pyicsf.icsf(wvl, I_obs)More detailed example: see example.py, which was used to
generate the following plot:
This package is released under a MIT open source licence. See
LICENSE.txt.
