OxWearables/biobankAccelerometerAnalysis

ValueError: zero-size array to reduction operation maximum which has no identity

johnpark12 opened this issue · 1 comments

I'm getting an error when I attempt to the program with the command: "accProcess test2.csv --csvTimeFormat 'MM/dd/yyyy HH:mm:ss:SSS' --csvTimeXYZTempColsIndex 0,1,2,3"

/opt/homebrew/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3474: RuntimeWarning: Mean of empty slice. return _methods._mean(a, axis=axis, dtype=dtype, /opt/homebrew/lib/python3.9/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) Traceback (most recent call last): File "/opt/homebrew/bin/accProcess", line 8, in <module> sys.exit(main()) File "/opt/homebrew/lib/python3.9/site-packages/accelerometer/accProcess.py", line 305, in main accelerometer.device.processInputFileToEpoch( File "/opt/homebrew/lib/python3.9/site-packages/accelerometer/device.py", line 126, in processInputFileToEpoch getCalibrationCoefs(stationaryFile, summary) File "/opt/homebrew/lib/python3.9/site-packages/accelerometer/device.py", line 270, in getCalibrationCoefs if (np.max(xyz, axis=0) < CALIB_CUBE).any() \ File "<__array_function__ internals>", line 180, in amax File "/opt/homebrew/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 2791, in amax return _wrapreduction(a, np.maximum, 'max', axis, None, out, File "/opt/homebrew/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) ValueError: zero-size array to reduction operation maximum which has no identity

This is a small sample the header and some of the rows in my own file:

time x y z
07/28/2022 04:26:54:860 -8.83669376373291 3.999603033065800 1.5206388235092200
07/28/2022 04:26:55:062 -8.828319549560550 3.9421753883361800 1.3639088869094800
07/28/2022 04:26:55:262 -8.914461135864260 3.94815731048584 1.404586911201480
07/28/2022 04:26:55:464 -8.930013656616210 3.923032760620120 1.4333007335662800

Hi @johnpark12
Can you try with --skipCalibration True ?
The sample rate of your file seems to be about 5Hz, is that right?