pyfim.analysis.binary_phases

pyfim.analysis.binary_phases(x, mode='ON', min_len=1)

Low-level function: Extracts phases from binary indicators such as “go_phase” or “is_coiled”.

Parameters:
  • x ((list, np.ndarray, pd.Series)) – Must be consist of True/False or 0/1. E.g. [0,0,0,1,1,1,0,1,1]
  • mode ({'ON','OFF','ALL'}, optional) –
    Phases to return. For above example:
    • ’ON’, will return [(3,6),(7,9)]
    • ’OFF’, will return [(0,3),(6,7)]
    • ’ALL’ will return [(0,3),(3,6),(6,7),(7,9)]
  • min_len (int, optional) –
Returns:

Return type:

Indices of phases