I am using the_decimator to downsample a 32-bit filterbank file to 8-bit. I've noticed that in the process, the az and za are being reset.
I traced this to line 273 in sigproc/SigProcObservation.C, but I had little luck in understanding how the global variables are being obtained/set to start a pull-request.
It would appear as though the SigProcObsevation class was never configured to correctly compute these parameters when unloading a SigProc Filterbank file. This information is generally redundant, but it could be added reasonably easily, by making use of the sky_coord, telescope and start MJD in the dsp::Observation base class. I can look at doing this soon.
Wael, the global variables are defined in Kernel/Formats/sigproc/filterbank.h (this is how the sigproc library works unfortunatley). These are defined within the scope of the SigProcObservation class, so when the unload_global method is called, all of these variables are set, and then the call to filterbank_header() is made, it writes these to the FILE ptr.
Hi AJ,
The fix might be easier as the input filterbank file has already the right za/az angles. i.e. there is no need to recompute the angles, for my case at least.
When writing a filterbank file, the SigProcObservation class doesn't (and shouldn't) make any assumptions about what type of input was used to generate the file. So having the more generalised approach will mean that it should work in most use cases.
Perhaps this is not so straight forward. Sigproc] defines az_start and za_start as the telescope angle at the start of the observation. And so this means it could be different from the source position - e.g. your pulsar/source might not be in the centre of the your antenna or beam pointing...
For this reason I think it would be unwise for the_decimator to re-write the Az and Za, and that is perhaps why the original author of this code reset these parameters to zero upon unloading. The more correct solution would be for dspsr to be able to read these parameters, store them correctly and unload them separately
Wael, I've checked in a new commit to the SigProcObservation which will set the az_start and za_start header parameters based on the source position on MJD start of the observation. Could you please pull the this commit from DSPSR and test it out?