ska-sa / astrokat

General observation framework for the MeerKAT telescope
BSD 2-Clause "Simplified" License
2 stars 4 forks source link

Noise diode implementation update #97

Closed rubyvanrooyen closed 3 years ago

rubyvanrooyen commented 3 years ago

More mature implementation suggested by Lud, see pull request #97

rubyvanrooyen commented 3 years ago

Thanks Ruby, that looks good!

I'm happy to merge, especially since I'm on holiday next week... It would be good to get this version out on Wednesday, which will solve the current issues on site (i.e. get S-band and astrokat to co-exist).

When I'm back, we can explore some ideas to get the best of both worlds (strictness + flexibility 😂 ):

Make a special "noise diode off" routine (say nd_reset) that uses 'now' timestamps. This will only be called at the beginning (and possibly end) of each script and therefore represents the main noise diode interaction. I realise that you removed 'now' timestamps to get synchronised firings but I don't think the initial reset needs to be synchronised. This removes the troubles of guessing a sufficiently long lead time for 99% of noise diode firings. Or, once we run out of time in _set_dignd, instead of skipping the rest of the diodes we can guess a better lead time by comparing the number of antennas we've done so far against the total. Rerun _set_dignd with the longer lead time, but then crash if we run out of time again. No need for infinite recursion 😆 This will ensure a completely synchronised switch that is more robust against slow diodes. So the error we are handling is really the inability of the script to set a long enough lead time, as opposed to something fundamentally wrong with the diodes. This is worth exploring because S-band diodes are coming... and they are dog slow thus far (maybe 30-40 seconds lead time for 64 dishes...). Until those diode controls are improved, it would be nice to have astrokat mostly working for commissioning to proceed.