Skip to content

Workaround (on_pointing_axis_tracking): Take a minimum of 2 timesteps to prevent axes loss to ravels#10

Open
David-McKenna wants to merge 1 commit into2baOrNot2ba:masterfrom
David-McKenna:nrTimestepsMin
Open

Workaround (on_pointing_axis_tracking): Take a minimum of 2 timesteps to prevent axes loss to ravels#10
David-McKenna wants to merge 1 commit into2baOrNot2ba:masterfrom
David-McKenna:nrTimestepsMin

Conversation

@David-McKenna
Copy link
Contributor

Hey Tobia,

Ran into a lovely bug in on_pointing_axis_tracking where by if some floating point math causes the observation duration to fall below the observation integration value, dreamBeam exits as a result of the time axes being deleted in a squeeze on a working array.

This PR is a workaround for the issue, by requiring at least 2 timesteps be generated for every input, preventing the axes loss and runtime error as a result. I attempted to follow through the code path and see if I could, for example, swap the wildcard indices on jones.py:220 for elipses, but that just caused worse issues later on (0-dim arrays).

A better solution would likely be to manually delete/index axes at jones.py:309 and jones.py:429, but from a brief inspection I wasn't sure which axes you were attempting to get rid of there, leading to this interim patch.

Cheers,
David

Here's the full stack of the original error:

  File "/mnt/ucc4_data3/data/David/scripts/genericFuncs.py", line 118, in cachedAxisLookup
    return on_pointing_axis_tracking(telescopename = tele, stnid = stn, band = antennaSet, antmodel = mdl, obstimebeg = Time(time).datetime, obsdur = dur, obstimestp = integ, pointingdir = pnt, do_parallactic_rot
=do_parallactic_rot)
  File "/usr/local/lib/python3.6/dist-packages/dreambeam/rime/scenarios.py", line 131, in on_pointing_axis_tracking
    pjonesOfSrc = pjones.op(srcfld)
  File "/usr/local/lib/python3.6/dist-packages/dreambeam/rime/jones.py", line 38, in op
    self.computeJonesRes()
  File "/usr/local/lib/python3.6/dist-packages/dreambeam/rime/jones.py", line 108, in computeJonesRes
    self.computeJonesRes_overfield()
  File "/usr/local/lib/python3.6/dist-packages/dreambeam/rime/jones.py", line 220, in computeJonesRes_overfield
    jonesrbasis_from[idxi, idxj, :, :],
IndexError: too many indices for array: array is 2-dimensional, but 4 were indexed

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 this pull request may close these issues.

1 participant