Skip to content

Failing nicely when cant fit the structure function #149

Description

@twshimwell

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions