Skip to content

Commit

Permalink
Update decompress_cpu.py
Browse files Browse the repository at this point in the history
This is Gareth's proposed fix. I think there are optimization improvement possibilities, but the *real* fix is not to generate compressed waveforms with different precision to what you will use when decompressing.
  • Loading branch information
spxiwh authored Dec 16, 2024
1 parent 8b7d233 commit 1e2cce7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pycbc/waveform/decompress_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ def inline_linear_interp(amp, phase, sample_frequencies, output,

rprec = real_same_precision_as(output)
cprec = complex_same_precision_as(output)
sample_frequencies = numpy.array(sample_frequencies, copy=False,
dtype=rprec)
amp = numpy.array(amp, copy=False, dtype=rprec)
phase = numpy.array(phase, copy=False, dtype=rprec)
sample_frequencies = numpy.asarray(sample_frequencies, dtype=rprec)
amp = numpy.asarray(amp, dtype=rprec)
phase = numpy.asarray(phase, dtype=rprec)
sflen = len(sample_frequencies)
h = numpy.array(output.data, copy=False, dtype=cprec)
hlen = len(output)
Expand Down

0 comments on commit 1e2cce7

Please sign in to comment.