The actual normalization of the 1d spectrum takes place in the second step.
The script 1d_ascii_Normalization.py (download here) reads the spectrum (ASCII file). The ASCII-file must have 2 columns with the column headings ‚WAVE‘ and ‚FLUX‘. The separation character is determined automatically with guess=True. It is asked for the number of points, which were determined before with the script 1d_ascii_generate_normalization_points.py (use of the diagram produced and stored with it), By the entered points (as float, the numbers must exist in the column ‚WAVE‘ of the 1d-spectrum also !) a fourth degree polynomial (or other degree polynomial adapt the script for it) is calculated (least-squares). With the polynomial the normalization function and the normalized spectrum are calculated for all wavelengths in the spectrum and everything is plotted in two diagrams. Finally, the normalized spectrum is saved as csv-file. The original identifier of the file to be normalized is supplemented with „_norm“.
If the normalization function does not meet the requirements, the degree of the polynomial can be changed in the script. If this is not sufficient, new points have to be created.