.. Time-stamp: <2016-03-24 00:02 ycopin@lyonovae03.in2p3.fr> Testing script on simulation `Sim5` =================================== Line-fitting tests on `Sim5 `_ simulation dataset from M. Moresco (see `README.dat`). The dataset is reorganized the following way:: Sim5/ +-- Data/ | +-- s-1-0.dat.bz2 | +-- [...] +-- input.dat +-- README.dat and is pointed to by the environment variable `SIM5PATH=/path/to/Sim5/`. .. literalinclude:: ../scripts/test_sim5.py :linenos: Single-line fit --------------- Single-line fit to `s-1-*.dat` spectra, with flux bounded to positive values:: Time to fit 4356 spectra: 156.091279 s = 35.83 ms/spec Fit result saved in output-s-1.dat Fail rate: 161/4356 = 3.70% Redshift offset: 4195 elements Mean: +0.00017 Median: +0.00009 RMS: +0.00262 wRMS: +0.00036 Min: -0.02530 for s-1-607 Max: +0.02312 for s-1-1823 Flux error: 4195 elements Mean: +0.01703 Median: -0.00875 RMS: +0.30877 wRMS: +0.04795 Min: -0.94139 for s-1-1276 Max: +3.15683 for s-1-1539 .. figure:: ../scripts/output-s-1.png :align: center :width: 60% :alt: Single-line fit result. **Figure:** redshift offset (*top*) and Hα flux relative error (*bottom*) as function of input Hα flux, for the single-line fit. Spectra with a failed fit (convergence issue or singular covariant matrix) are marked in *red*. Complex [NII]+Hα fit -------------------- Complex [NII]+Hα fit to `s-2-*.dat` spectra, including a constraint on the [NII]/Hα intensity ratio and intensity bounded to positive values:: Time to fit 4356 spectra: 488.914332 s = 112.24 ms/spec Fit result saved in output-s-2_tied.dat Fail rate: 135/4356 = 3.10% Redshift offset: 4221 elements Mean: +0.00008 Median: +0.00004 RMS: +0.00210 wRMS: +0.00151 Min: -0.01238 for s-2-351 Max: +0.02454 for s-2-797 Flux error: 4221 elements Mean: +0.04272 Median: +0.00896 RMS: +0.22717 wRMS: +0.04380 Min: -0.59672 for s-2-1671 Max: +1.76076 for s-2-1803 .. figure:: ../scripts/output-s-2_tied.png :align: center :width: 60% :alt: Complex [NII]+Hα fit result. **Figure:** same as above, for the complex [NII]+Hα fit, including a constraint on the [NII]/Hα intensity ratio. .. Todo:: convert to Notebook.