Reorganise LALPulsar SFT library code
Description
LALPulsar library code for handling SFTs and related objects (timestamps, catalogs, PSDs, etc.) is currently split across 2 source files (shown with line numbers):
3615 SFTfileIO.c
3259 SFTutils.c
6874 total
with matching headers. Both of these source files have become quite large over the years, and functions for different objects/tasks have got mixed together, which makes both files quite hard to navigate. It's also no longer clear what is the organisational split between "I/O" and "utilities", e.g. SFTfileIO.c contains plenty of code which is not directly related to SFT file I/O.
This MR reorganises this code as follows:
-
SFTutils.his deprecated, and its contents moved toSFTfileIO.h. (LALPulsar will still installSFTutils.hbut if#included it will raise a#warningand then just includeSFTfileIO.h.) - The source code in both
SFTfileIO.candSFTutils.cis reorganised into several new files:
92 SFTinternal.h # internal definitions and prototypes shared across all SFT code
537 FindFiles.c # XLALFindFiles()
1056 PSDtypes.c # functions for handling PSDs and noise weights
445 SFDBfileIO.c # XLALReadSFDB()
922 SFTcatalog.c # functions for handling SFT catalogs
1409 SFTfileIO.c # now just contains SFT file I/O code
364 SFTnaming.c # SFT file naming convention and related functions (e.g. looking up detector prefixes)
869 SFTtimestamps.c # functions for handling timestamps
1256 SFTtypes.c # basic functions for creating/destroying/manipulating SFT types, e.g. SFTtype, SFTVector, MultiSFTVector
6950 total
- Finally I've used
git blame -Cto try to update the copyright notices for all the new files.
The diffs for this MR probably won't be very helpful given the movement of code. Note that the overall lines of code hasn't changed much (6874 to 6950), which is hopefully a sign I haven't deleted anything important...
Aside from code reorganisation, there are a few other minor clean-ups:
- Removed the long-deprecated
PulsarSourceParamsstruct fromPulsarDataTypes.h; this struct was only used by thePulsarSignalParamsstruct inGeneratePulsarSignal.h, so I've just merged thePulsarSourceParamsstruct definition into thePulsarSignalParamsstruct. -
SFTfileIO.cuses a functioncalc_crc64()to compute the SFT check-sum; this function was originally copied from the SFT reference library, but since that code is now part of LALPulsar I've removed theSFTfileIO.cversion of the CRC function and instead pointedSFTfileIO.cto the equivalent function inSFTReferenceLibrary.c -
SFTReferenceLibrary.hdeclares a functionReferenceSFTLibraryVersion(); since this code is no longer a separate package, I've removed this function.
API Changes and Justification
Backwards Compatible Changes
-
This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions -
This change adds new classes/functions/structs/types to a public C header file or Python module
Backwards Incompatible Changes
-
This change modifies an existing class/function/struct/type definition in a public C header file or Python module -
This change removes an existing class/function/struct/type from a public C header file or Python module
Removes deprecated functions/structs in the name of general housekeeping of the LALPulsar API; unlikely to break any downstream packages.