xpsi-group / xpsi

X-PSI: X-ray Pulse Simulation and Inference
Other
34 stars 21 forks source link

Signal plots produce wrong figures if including channel 0 and using logarithmic y-scale #371

Open thjsal opened 6 months ago

thjsal commented 6 months ago

For example, if including channel number 0 in to the analysis, one can get a residual plot like this: residuals_original.pdf when it really should look like this (note: in this example there are no counts below channel ~20): residuals_fixed.pdf

To fix the problem one can replace lines like self._ax_resid.set_ylim([channel_edges[0], with self._ax_resid.set_ylim([_np.max([channel_edges[0],0.001]), in _residual.py. Similar fixes should probably be done in other signal plot types.

This problem was encountered by @Sidewaysgravity79 .