jkrogager / VoigtFit

Python code to fit absorption lines semi-interactively
http://voigtfit.readthedocs.io/
MIT License
28 stars 12 forks source link

Attempting to mask raises ValueError #17

Closed clochhaas closed 6 years ago

clochhaas commented 6 years ago

When I put the keyword mask in the parameter file and run VoigtFit, I get the following error:

Traceback (most recent call last): File "/usr/current/anaconda/bin/VoigtFit", line 11, in <module> sys.exit(main()) File "/usr/custom/Anaconda/lib/python2.7/site-packages/VoigtFit/VoigtFit.py", line 522, in main dataset.mask_line(line_tag, reset=False) File "/usr/custom/Anaconda/lib/python2.7/site-packages/VoigtFit/dataset.py", line 628, in mask_line region.define_mask(z=self.redshift, dataset=self, telluric=telluric) File "/usr/custom/Anaconda/lib/python2.7/site-packages/VoigtFit/regions.py", line 283, in define_mask plt.plot(wl_T, (flux_T/flux_T.max() + 1.2)*cont, color='orange', alpha=0.7, lw=0.5) File "/usr/custom/Anaconda/lib/python2.7/site-packages/numpy/core/_methods.py", line 26, in _amax return umr_maximum(a, axis, None, out, keepdims) ValueError: zero-size array to reduction operation maximum which has no identity

If I run VoigtFit without attempting to mask, it works fine.

jkrogager commented 6 years ago

Hi, sorry for the late reply. What line (or lines) are you trying to fit? And at what redshift?

jkrogager commented 6 years ago

The bug has been fixed in the latest version of the code.