Skip to content

Commit cf51de1

Browse files
committed
set orientation to nan for single led data
1 parent 58d46e1 commit cf51de1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/spyglass/common/common_position.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,13 @@ def calculate_position_info(
444444
# convert back to between -pi and pi
445445
orientation[~is_nan] = np.angle(np.exp(1j * orientation[~is_nan]))
446446

447+
# set orientation to NaN in single LED data
448+
if np.all(front_LED == 0) or np.all(back_LED == 0):
449+
logger.warning(
450+
"Single LED data detected. Setting orientation to NaN."
451+
)
452+
orientation = np.nans_like(orientation)
453+
447454
velocity = get_velocity(
448455
position,
449456
time=time,

0 commit comments

Comments
 (0)