Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janclemenslab/samplestamps
https://github.com/janclemenslab/samplestamps
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/janclemenslab/samplestamps
- Owner: janclemenslab
- License: apache-2.0
- Created: 2018-10-16T08:33:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-31T20:39:52.000Z (3 months ago)
- Last Synced: 2024-11-29T06:08:13.446Z (about 2 months ago)
- Language: Python
- Size: 625 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Samplestamps
Code for converting between time stamps and samples/frames.
## Installation
`pip install samplestamps`## Usage
```python
from samplestamps import SampStamp
ss = SampStamp(sample_times=daq_stamps[:,0],
frame_times=cam_stamps[:,0],
sample_numbers=daq_samplenumber[:,0])
ledonset_sample = 80000.0+np.argmax(daq_samples[80000:,-1]>0.05)
print(f'led onset at sample {ledonset_sample} corresponding to')
print(f' seconds: {ss.sample_time(ledonset_sample):1.3f}')
print(f' frame: {ss.frame(ledonset_sample):1.0f}.')
```