Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions pycbc/waveform/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,10 @@ def compress_waveform(htilde, sample_points, tolerance, interpolation,
s2 = filter.sigma(htilde, psd=psd, low_frequency_cutoff=fmin)

if psd is not None:
htilde2 = htilde / (psd[:len(htilde)] * s2)
htilde2 = htilde / psd[:len(htilde)] / s2
else:
htilde2 = htilde / s2

# Do a first test to see if we are done
mismatch = 1. - abs(filter.overlap_cplx(hdecomp / s1, htilde2,
low_frequency_cutoff=fmin, normalized=False))
if mismatch > tolerance:
Expand Down Expand Up @@ -632,10 +631,12 @@ def fd_decompress(amp, phase, sample_frequencies, out=None, df=None,
delta_f=df)
else:
# check for precision compatibility
if out.precision == 'double' and precision == 'single':
amp = amp.astype(numpy.float64)
phase = phase.astype(numpy.float64)
sample_frequencies = sample_frequencies.astype(numpy.float64)
if out.precision != precision:
precision = out.precision
rtype = _real_dtypes[precision]
amp = amp.astype(rtype)
phase = phase.astype(rtype)
sample_frequencies = sample_frequencies.astype(rtype)
df = out.delta_f
hlen = len(out)
if f_lower is None:
Expand Down
Loading