questplus icon indicating copy to clipboard operation
questplus copied to clipboard

bug: 'linear' stimScale does not work with negative numbers (xarray RuntimeWarning)

Open dominikue opened this issue 2 years ago • 2 comments

Hi, thanks for this package! I am using it in psychopy :) unfortunately the 'linear' stimScale does not behave as expected for negative intensityVals/thresholdVals as it results in a RuntimeWarning. Maybe it's just my code, but "linear" with positive values works great and using "log10" with negative intensity values also gives a good estimate.

Please let me know if you need more information to debug or decide if this is a bug. Thank you!

[/lib/python3.8/site-packages/xarray/core/computation.py:771](/lib/python3.8/site-packages/xarray/core/computation.py:771): RuntimeWarning: invalid value encountered in log result_data = func(*input_data)

Example using 'linear'-scale and negative intensity values: image image

dominikue avatar Nov 11 '23 10:11 dominikue

Hello! Thanks for reporting this issue! Could you perhaps provide a reproducible example? Thank you!

hoechenberger avatar Nov 11 '23 10:11 hoechenberger

Hi, sorry it took me a while to find the time to create a clean example: https://gist.github.com/dominikue/9a750e9cfffad7f0b572ccfddf85e59d I hope this helps to find the reason for this issue. Maybe it's just my parameters. Please let me know if you have any questions about the example!

br, Dominik

dominikue avatar Jan 08 '24 10:01 dominikue