Skip to content

transfer_function needs a default average argument

Created by: eagoetz

The gwpy.timeseries.transfer_function() method needs a default method when computing the CSD and PSD used in the transfer function calculation. Currently if one doesn't specify the method, the results are incorrect, perhaps because CSD does not define a default value (so 'mean' is used), but PSD does define a default value 'median'.

See PSD: https://gwpy.github.io/docs/latest/api/gwpy.timeseries.TimeSeries/#gwpy.timeseries.TimeSeries.psd See CSD: https://gwpy.github.io/docs/latest/api/gwpy.timeseries.TimeSeries/#gwpy.timeseries.TimeSeries.csd

And how they are used in the transfer_function method (note no average value is passed, so it uses the default from each): https://github.com/gwpy/gwpy/blob/eee114f78af4b838b927d5ba0af476e36e494880/gwpy/timeseries/timeseries.py#L1151-L1154

The simplest solution is to chose a default method for the transfer function, and then pass that to both the CSD and PSD methods