A big cleanup of spec_avg.c code
Description
The code for lalapps_spec_avg
was very long in the tooth and needing some cleanup, similar to the way I had cleaned up the lalapps_spec_avg_long
code. This code, lalapps_spec_avg
is specifically used when generating Fscans. @gregory.mendell had noted to me separately, that the current Fscans use code dated back to 2012, presumably because of some issues. I hope that this code cleanup and bug-fixes resolve some of those issues. I note the general summary of what I've cleaned up and fixed below:
- Removed a lot of commented out code, cleaned up the code for readability, and clarified comments
- Fixed a serious bug that the SFTs were being normalized twice; this is probably not intended behaviour
- Fixed a bug (or apparent bug) in the handling of gaps between SFT files for the spectrograms
- Fixed a bug for the resolution of multiple bins averaged together for the sepctrograms
- Code cleanup fixed some weird choices like a for loop not covering the last frequency bins of the SFT when making spectrograms (I suspect poor understanding from the last person editing the code)
- Removed old Crab code that is not compiled anyway, and I suspect is no longer needed
- Fixed a memory leak on program finish
- Added test code for
lalapps_spec_avg
, though note that the test won't work on the previous version of the code because of several bugs that are fixed in this update. I'd like to consult with @gregory.mendell before this code is approved/merged
API Changes and Justification
Backwards Compatible Changes
-
This change introduces no API changes -
This change adds new API calls
Backwards Incompatible Changes
-
This change modifies an existing API -
This change removes an existing API
If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.
Review Status
I'd like to discuss with @gregory.mendell before proceeding to any review and then Greg, or @karl-wette / @david-keitel could provide some helpful checks.