fusion-flap / flap

Fusion Library of Analysis Programs
MIT License
11 stars 5 forks source link

Trend removal fails #60

Closed thelampire closed 4 years ago

thelampire commented 4 years ago

Trend removal fails for int16 data with the following message:

File "/Users/mlampert/work/repos/flap_repos/flap/spectral_analysis.py", line 235, in _trend_removal d -= p[0]

UFuncTypeError: Cannot cast ufunc 'subtract' output from dtype('float64') to dtype('int16') with casting rule 'same_kind'

I think the same thing has happened at filtering but that resulted in over/underflow.

thelampire commented 4 years ago

I found the culprit. If one uses the d -= notation instead of d = d- then trend removal fails. Otherwise it works. I submitted the fix into thelampire-patch-2.