Created
February 2, 2020 12:15
-
-
Save MShirazAhmad/50a168e59278ae98d7a0bc6cb56bc7e6 to your computer and use it in GitHub Desktop.
Finding indices and time stamps of raw data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def indices(CH, time): | |
| k = 0 | |
| i = 0 | |
| T = [] | |
| while i < (len(CH) - 2): | |
| if CH[i] == 0 and CH[i + 1] == 1 and CH[i + 2] == 1: | |
| T.append(time[i + 1]) | |
| k = k + 1 | |
| if CH[i] == 1 and CH[i + 1] == 0 and CH[i + 2] == 0: | |
| T.append(time[i]) | |
| k = k + 1 | |
| i = i + 1 | |
| return T |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment