Module Expr Str Import alias identifier Import alias Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult BinOpMult Num NameLoad BinOpSub BinOpMult Num SubscriptLoad NameLoad Slice Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call AttributeLoad NameLoad attr ListLoad Num NameLoad Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body While CompareGt NameLoad SubscriptLoad NameLoad Index NameLoad body AugAssignAdd NameStore Num Assert CompareLt NameLoad NameLoad Str Assign NameStore SubscriptLoad NameLoad Index BinOpSub NameLoad Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpDiv BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad Assert BoolOpAnd CompareGtE NameLoad Num CompareLtE NameLoad Num Str Assign NameStore SubscriptLoad NameLoad Index BinOpSub NameLoad Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd NameLoad BinOpMult NameLoad BinOpSub NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam TupleStore NameStore NameStore NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpAdd NameLoad Num Assign NameStore BinOpDiv BinOpSub NameLoad NameLoad NameLoad Assign NameStore BinOpDiv SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword TupleLoad NameLoad NameLoad Index Num NameLoad Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr BinOpMult BinOpDiv UnaryOpUSub BinOpSub NameLoad Num Num NameLoad BinOpMult BinOpDiv BinOpSub NameLoad Num Num NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMult Num BinOpPow NameLoad Num Assign NameStore BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice UnaryOpUSub NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assign NameStore SubscriptLoad NameLoad Slice NameLoad UnaryOpUSub NameLoad Assert CompareEq Call AttributeLoad NameLoad attr NameLoad NameLoad Str Return NameLoad decorator_list
N/A N/A 
Helper functions for Poisson processes
 N/A numpy np N/A logging N/A log N/A N/A logging getLogger global_log sampleInhomogeneousPoissonProc N/A N/A tt lam N/A N/A N/A 
    Sample an inhomogeneous Poisson process with rate lam and times tt using
    the time-rescaling theorem. Integrate the rate from [0,t) to get the cumulative
    rate. Spikes are uniformly drawn from this cumulative rate as in a 
    homogeneous process. The spike times in the homogeneous rate can be inverted 
    to get spikes from the inhomogeneuos rate. 
     N/A N_t N/A len tt N/A dt N/A N/A np diff tt N/A dlam N/A N/A np diff lam N/A trapLam N/A N/A 0.5 dt N/A N/A 2 N/A lam N/A 1 dlam N/A cumLam N/A N/A np ravel N/A N/A np cumsum trapLam N/A cumLam N/A N/A np hstack N/A N/A N/A np array N/A 0.0 cumLam N/A intLam N/A cumLam N/A -1 N/A N N/A N/A N/A np random poisson intLam N/A Q N/A N/A N/A np random uniform 0 intLam size N N/A Q N/A N/A np sort Q N/A S N/A N/A np zeros N N/A tt_off 0 N/A N/A n q N/A enumerate Q N/A N/A N/A q N/A cumLam N/A tt_off N/A N/A tt_off 1 N/A N/A tt_off N_t ERROR: inverted spike time exceeds time limit! N/A q_lb N/A cumLam N/A N/A tt_off 1 N/A q_ub N/A cumLam N/A tt_off N/A q_frac N/A N/A q q_lb N/A q_ub q_lb N/A N/A N/A q_frac 0.0 N/A q_frac 1.0 ERROR: invalid spike index N/A tt_lb N/A tt N/A N/A tt_off 1 N/A tt_ub N/A tt N/A tt_off N/A N/A S N/A n N/A tt_lb N/A q_frac N/A tt_ub tt_lb N/A S N/A approximateFiringRate N/A N/A S N/A T_start T_stop N_bins N/A N/A N/A 
    Approximate the firing rate of a set of spikes by binning into equispaced
    bins and dividing by the bin width. Smooth with a Gaussian kernel.
    
    TODO: This could be improved with equimass bins as opposed to equispaced bins.
     N/A bin_edges N/A N/A np linspace T_start T_stop N/A N_bins 1 N/A bin_width N/A N/A T_stop T_start N_bins N/A fr N/A N/A N/A N/A np histogram S bin_edges range N/A T_start T_stop N/A 0 bin_width N/A N_smoothing_kernel_bins 9 N/A smoothing_kernel_bin_centers N/A N/A np linspace N/A N/A N/A N/A N_smoothing_kernel_bins 1 2 bin_width N/A N/A N/A N_smoothing_kernel_bins 1 2 bin_width N_smoothing_kernel_bins N/A smoothing_kernel N/A N/A np exp N/A -0.5 N/A smoothing_kernel_bin_centers 2 N/A smoothing_kernel N/A smoothing_kernel N/A N/A np sum smoothing_kernel N/A l_pad N/A N/A np mean N/A fr N/A N_smoothing_kernel_bins N/A r_pad N/A N/A np mean N/A fr N/A N/A N_smoothing_kernel_bins N/A fr_pad N/A N/A np hstack N/A N/A l_pad N/A N/A np ones N_smoothing_kernel_bins fr N/A r_pad N/A N/A np ones N_smoothing_kernel_bins N/A fr_smooth N/A N/A np convolve fr_pad smoothing_kernel same N/A fr_smooth N/A fr_smooth N/A N_smoothing_kernel_bins N/A N_smoothing_kernel_bins N/A N/A N/A N/A np size fr_smooth N_bins ERROR: approximation returned invalid length firing rate N/A fr_smooth N/A