Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing nicely when cant fit the structure function #149

Open
twshimwell opened this issue Oct 23, 2023 · 0 comments
Open

Failing nicely when cant fit the structure function #149

twshimwell opened this issue Oct 23, 2023 · 0 comments

Comments

@twshimwell
Copy link

Presently when losoto tries to derive the structure function but cant find a good solution it doesnt fail in a very friendly way. This causes some issues for LINC (see ticket https://git.astron.nl/RD/LINC/-/issues/37) which produces the following error when trying to run the structure function sometimes.

usr/local/lib/python3.8/dist-packages/losoto/operations/structure.py:125: RuntimeWarning: divide by zero encountered in log10
par = np.linalg.lstsq( A.T, np.log10(variance[myselect][~mask]) )[0]
/usr/local/lib/python3.8/dist-packages/losoto/operations/structure.py:125: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M a
nd N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1.
par = np.linalg.lstsq( A.T, np.log10(variance[myselect][~mask]) )[0]
/usr/local/lib/python3.8/dist-packages/losoto/operations/structure.py:165: UserWarning: Attempted to set non-positive bottom ylim on a log-scaled axis.
Invalid limit will be ignored.
ax.set_ylim(ymin,ymax)
/usr/local/lib/python3.8/dist-packages/losoto/operations/structure.py:166: RuntimeWarning: divide by zero encountered in log10
ax1.set_ylim(np.log10(ymin),np.log10(ymax))
Traceback (most recent call last):
File "/usr/local/bin/losoto", line 154, in
returncode += ops[ op ]._run_parser( soltab, parser, step )
File "/usr/local/lib/python3.8/dist-packages/losoto/operations/structure.py", line 16, in _run_parser
return run(soltab, doUnwrap, refAnt, plotName, ndiv)
File "/usr/local/lib/python3.8/dist-packages/losoto/operations/structure.py", line 166, in run
ax1.set_ylim(np.log10(ymin),np.log10(ymax))
File "/usr/local/lib/python3.8/dist-packages/matplotlib/axes/_base.py", line 4027, in set_ylim
bottom = self._validate_converted_limits(bottom, self.convert_yunits)
File "/usr/local/lib/python3.8/dist-packages/matplotlib/axes/_base.py", line 3614, in _validate_converted_limits
raise ValueError("Axis limits cannot be NaN or Inf")
ValueError: Axis limits cannot be NaN or Inf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant