added functions to downsample images#45
added functions to downsample images#45jdppthk wants to merge 2 commits intoAllenInstitute:masterfrom
Conversation
|
EC2 Default User seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
…all the stimuli at different times in a given time window with a given sampling rate
| import pandas as pd | ||
|
|
||
|
|
||
| def get_frame_at_time(time, stim_table): |
There was a problem hiding this comment.
There are a couple of oddities about this function. One is that it selects the output column by integer index rather than name, which will fail if you run into a stim table with differently-ordered or inserted columns. The other is that you are looking at start times and not end times, so if you supply a time after the bounds of the experiment, this function will happily report the last value from the dataframe (rather than throwing an error or otherwise notifying the caller).
Maybe something like this (sans error handling):
def get_frame_at_time(time, stim_table):
return stim_table.loc[(stim_table['start'] <= time) & (stim_table['end'] > time), 'frame'].values[0]
No description provided.