XLALComputePSDandNormSFTPower() normalizes input SFTs in place
@karl-wette as discussed in !1456 (merged), XLALNormalizeMultiSFTVect()
and by extension the PSD-computing functions from !1294 (merged) and !1456 (merged) modify the input SFT vector in place, which for a user just wanting a PSD is unexpected. This wasn't a problem as long as there was only the monolithic lalapps_ComputePSD
, but now that I made the SWIG-accessible function, it's inconvenient. On the other hand, computing PSDs over large data sets would become much more memory-intensive if a local copy were always made. So my suggestion would be:
- Give
XLALNormalizeMultiSFTVect()
XLALComputePSDandNormSFTPower
a new boolean argumentnormalizeSFTsInPlace
which is false by default and makes a copy of the inputs internally unless set totrue
instead. - Have
XLALComputePSDfromSFTs()
call it asfalse
, as it's intended to be an "as easy as possible, no surprises" user-friendly function. - Have
lalapps_ComputePSD
call it as true because in this case there won't be any need to reuse the inputs.
Does that sound reasonable? It'll require an API change though.
Edit 20201223: fixed function name in 1.
Edited by David Keitel