[line_fitting] Find better initial line position
The initial position of the line has an important effect on the fitting. For instance, on the screen-shot below the Lyman α line is not found unless forcing a positive flux.
A way to avoid that is to compute the initial position (or the initial velocity) looking for the position of the peak. It's useful when fitting one line but may be problematic in area with a high density of lines, in the case of doublets, or when fitting multiple lines as they are all linked with the same velocity.
Ideas:
- Simply find the position of the maximum in the area where the line is searched for. It must be optional and used only when fitting only one line.
- Find the nearest peak to the expected line position to compute the velocity needed to put the line at this position. For the fitting, use the average of these velocities (for normal lines, resonant lines have their own) as initial value for the fit.