DP3 writes wrong h5 time axis when solint larger than number of timeslots in MS and solutions_per_direction is specified
I encountered a situation where DP3 wrote a wrong time axis to the h5 when using the solutions_per_direction option. It seems to happen when solint is larger than the number of timeslots in the MS. Solint being large is not that unusual because of how ddecal.solint
and ddecal.solutions_per_direction
are defined to work together as entries in the provided subsolutions_per_solution list should be integer divisors of solint. In my (extreme) example below the time axis had a length of 403651 which is the lowest common divisor of 899 and 449. Both the dimension and values in the time axis are wrong causing subsequent wrong solutions to be applied during imaging. I also encountered the same bug in less extreme examples and it always seems to happen when solint is larger than the number of timeslots in an MS. It appears the code gets confused about how to write a proper time axis in this situation.
solution interval: 403651
nchan: 1
direction count: 10
directions: [[MODEL_DATA_DD0],[MODEL_DATA_DD1],[MODEL_DATA_DD2],[MODEL_DATA_DD3],[MODEL_DATA_DD4],[MODEL_DATA_DD5],[MODEL_DATA_DD6],[MODEL_DATA_DD7],[MODEL_DATA_DD8],[MODEL_DATA_DD9]]
sols per direction: [899,449,899,899,899,899,899,899,899,899]