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

Crash at module INTERPOLATE with newest numpy #135

Closed
adrabent opened this issue Jul 14, 2022 · 0 comments · Fixed by #137
Closed

Crash at module INTERPOLATE with newest numpy #135

adrabent opened this issue Jul 14, 2022 · 0 comments · Fixed by #137

Comments

@adrabent
Copy link
Collaborator

Dear all,

since numpy>1.23.0 the INTERPOLATE operation in losoto fails:

2022-07-14 09:37:05 - INFO - --> Starting 'INTERPOLATE' step (operation: INTERPOLATE).
/usr/local/lib/python3.8/dist-packages/losoto/operations/interpolate.py:150: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  new_vals[selection] = np.interp(new_axisvals, orig_axisvals[unflagged],
Traceback (most recent call last):
  File "/usr/local/bin/losoto", line 155, in <module>
    returncode += ops[ op ]._run_parser( soltab, parser, step )
  File "/usr/local/lib/python3.8/dist-packages/losoto/operations/interpolate.py", line 18, in _run_parser
    return run( soltab, outSoltab, axisToRegrid, newDelta, delta, maxFlaggedWidth, log)
  File "/usr/local/lib/python3.8/dist-packages/losoto/operations/interpolate.py", line 150, in run
    new_vals[selection] = np.interp(new_axisvals, orig_axisvals[unflagged],
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Closing remaining open files:
output.h5...

This is the parset:

[INTERPOLATE]
soltab = sol000/amplitude000
operation=INTERPOLATE
axisToRegrid=freq
outSoltab=bandpass
newdelta=195.3125kHz
delta=48.82kHz
maxFlaggedWidth=30

An h5parm for testing can be found here.

Cheers,
Alex

tikk3r added a commit to tikk3r/losoto that referenced this issue Oct 19, 2022
@tikk3r tikk3r mentioned this issue Oct 20, 2022
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

Successfully merging a pull request may close this issue.

1 participant