When creating power spectrum, check for zero data segments
When creating a power spectrum from a HeterodynedData
object, it zero pads the full data to get a contiguous and uniformly sampled time series (as the data does not need to be contiguous and uniformly sampled, but that is required for FFTing). However, if there are periods when the data is sparse, this can mean there are actually chunks of NFFT
length that are all zeros, and this can cause the generated spectra to look odd. Therefore, it is worth checking for and removing any individual spectra that are zeros, before combining (e.g., via a median) to get the final spectrum.