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

Shape Mismatch with INTERPOLATE #138

Open
murphp30 opened this issue Nov 22, 2022 · 1 comment
Open

Shape Mismatch with INTERPOLATE #138

murphp30 opened this issue Nov 22, 2022 · 1 comment

Comments

@murphp30
Copy link

murphp30 commented Nov 22, 2022

Hi. Apologies if this is just me not using losoto properly but I get the following error when trying to run the INTERPOLATE operation

  File "/data/mpearse/venvs/losoto/bin/losoto", line 155, in <module>
    returncode += ops[ op ]._run_parser( soltab, parser, step )
  File "/data/mpearse/venvs/losoto/lib/python3.8/site-packages/losoto/operations/interpolate.py", line 18, in _run_parser
    return run( soltab, outSoltab, axisToRegrid, newDelta, delta, maxFlaggedWidth, log)
  File "/data/mpearse/venvs/losoto/lib/python3.8/site-packages/losoto/operations/interpolate.py", line 149, in run
    new_vals[tuple(selection)] = np.interp(new_axisvals, orig_axisvals[unflagged],
ValueError: shape mismatch: value array of shape (14319,) could not be broadcast to indexing result of shape (14319,1)

Here is the associated parset

[interp_amp]
operation = INTERPOLATE
soltab = sol000/amplitude000
outsoltab = sol001/amplitude000
axisToRegrid = time
newdelta = 1s
 
[interp_phase]
operation = INTERPOLATE
soltab = sol000/phase000
outsoltab = sol001/phase000
axisToRegrid = time
newdelta = 1s

Any help is greatly appreciated,
Thanks!

@murphp30
Copy link
Author

In what I think is a related issue, when I use H5parm_interpolate.py I get the following error

(losoto) mpearse@nancep5:/data/mpearse$ H5parm_interpolator.py -V SUN-2022-10-11/CAL/instrument_SB361.h5 SUN-2022-10-11/CAL/instrument_SB361_a.h5 -a time -o SUN-2022-10-11/CAL/instrument_SB361_interp.h5
2022-11-24 12:23:07 - INFO - Working on SUN-2022-10-11/CAL/instrument_SB361.h5...
2022-11-24 12:23:07 - DEBUG - Reading from SUN-2022-10-11/CAL/instrument_SB361.h5.
2022-11-24 12:23:07 - INFO - Working on SUN-2022-10-11/CAL/instrument_SB361_a.h5...
2022-11-24 12:23:07 - DEBUG - Reading from SUN-2022-10-11/CAL/instrument_SB361_a.h5.
2022-11-24 12:23:07 - INFO - Looking for fastest axis in time...
[576, 576, 456, 456] -> 576
2022-11-24 12:23:07 - INFO - Looking for fastest axis in freq...
[64, 64, 64, 64] -> 64
2022-11-24 12:23:07 - INFO - Looking for fastest axis in ant...
[78, 78, 78, 78] -> 78
2022-11-24 12:23:07 - INFO - Looking for fastest axis in pol...
[2, 2, 2, 2] -> 2
2022-11-24 12:23:07 - DEBUG - Creating SUN-2022-10-11/CAL/instrument_SB361_interp.h5.
2022-11-24 12:23:07 - INFO - Creating a new solution-set: sol000.
2022-11-24 12:23:07 - INFO - --Creating new antenna table.
/data/mpearse/venvs/losoto/lib/python3.8/site-packages/tables/atom.py:362: FlavorWarning: support for unicode type is very limited, and only works for strings that can be cast as ascii
  warnings.warn("support for unicode type is very limited, and "
2022-11-24 12:23:07 - INFO - --Creating new source table.
2022-11-24 12:23:07 - INFO - Creating new table of type: amplitude...
Traceback (most recent call last):
  File "/data/mpearse/venvs/losoto/bin/H5parm_interpolator.py", line 130, in <module>
    shape = [len(fast_axes_vals[axis]) for axis in all_axes_names[typ]]
  File "/data/mpearse/venvs/losoto/bin/H5parm_interpolator.py", line 130, in <listcomp>
    shape = [len(fast_axes_vals[axis]) for axis in all_axes_names[typ]]
KeyError: 'dir'

I should have mentioned I'm using data from NenuFAR rather than LOFAR but as far as I know they record to MS files in the same way

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