Skip to content

Outputs and interpretation

Return values

velocity, intensity = LineFit(...)

Both arrays have shape (n_samples, n_lines) and dtype float32. A one-dimensional input spectrum produces (1, n_lines). The default is return_vlos_intensity=True; with False, the function has no explicit return and returns None.

The pixel argument selects sample rows. The returned arrays retain the full input sample dimension, with unprocessed rows filled with NaN.

LOS velocity

The routine uses v = c × (lambda_fit − lambda_reference) / lambda_reference, with c = 299792.458 km/s. A redshift is positive. Both wavelengths must be in nm and in the same reference convention.

The velocity zero point follows the supplied references. Calibration, observer motion, blends, and changes of line shape can affect interpretation. A profile centre does not independently identify an atmospheric height or remove non-Doppler profile changes.

Line-core intensity

The output is the intensity from the original spectrum at the nearest wavelength bin to the fitted centre. It is not the fitted profile amplitude, an integrated line intensity, or a sub-bin interpolation. Finite spectral sampling can therefore cause intensity steps even while a fitted centre changes smoothly.

Files written on request

write_csv=True and save_fitted_spectra=True write files directly in the current working directory. date_identifier and pixel help identify the outputs. Inspect the generated names before repeating runs in the same directory.

Option File pattern Contents
write_csv extracted_parameters_<date>_<selection>.csv Per-sample, per-line fitted centre, intensity, and velocity records
save_fitted_spectra fitted_spectra_<date>_<selection>.fits Fitted segments in the normalised inverted representation

FITS output is nested under the CSV-writing branch in the current implementation: set both write_csv=True and save_fitted_spectra=True to write the FITS file. A single input uses pixel_0; all rows use all_pixels; the default date identifier is data.

The fitted FITS segments are not calibrated spectra in the original intensity units. For a diagnostic plot of a selected spectrum, set pixel to its row index and plot_result=True.

Quality assessment

The public return pair does not include covariance, uncertainty, or a dedicated fit-quality flag. Inspect fits, non-finite values, bound sensitivity, and temporal behaviour, and define a validity mask appropriate to the instrument and science.

When passing a sequence into WaLSAtools, preserve its cadence and validity mask and check whether detrending or gap treatment changes the scientific question. Retain the actual times and follow the WaLSAtools documentation for method-specific input requirements.

Implementation sources

WaLSA_LineFit.py