pyNLO / PyNLO

Python package for nonlinear optics
https://pynlo.readthedocs.io/en/latest/
GNU General Public License v3.0
101 stars 55 forks source link

issue with inconsistent results #29

Closed hn-88 closed 8 years ago

hn-88 commented 8 years ago

When plotting results using the example SCG scripts at http://pynlo.readthedocs.io/en/latest/example_simple.html and https://github.com/pyNLO/PyNLO/blob/master/src/examples/Dudley_SSFM.py using pulse information given at http://www.orc.soton.ac.uk/publications/65xx/6571.pdf ( doi:10.1109/LPT.2013.2241420 ) the results don't look similar.

Even after correcting for:

  1. FWHM is specified in the simple example, while T0=FWHM/1.76 is used as pulse width in the Dudley example.
  2. Peak power is used in Dudley example, while pulse energy is used in the simple example.
hn-88 commented 8 years ago

As @DanHickstein pointed out, the two examples do not plot on the same scale. "Are the results really different? One set of plots is using wavelength and the other is plotting in frequency, so it's difficult to tell if they are the same. They are also being plotted on different colorscales, for example, see this line in SCG:

_ax2.imshow(zW, extent=extent, vmin=np.max(zW) - 60.0, vmax=np.max(zW), aspect='auto', origin='lower') _ So, it's plotting from the max down to -60 dB, while the Dudley example only goes down to -40 dB. I expect that if you plotted them both on the same x-axis with the same colormap, they would look more similar."

And indeed, once that was done, both plots look similar, as they should. The only difference is that in the simple script, the pulse energy is set with pulse.set_epp(EPP) and in the Dudley script, the SechPulse call itself sets the pulse peak power.

SCG-Head-sc.py.txt

SC-5.0-1040.txt