API Reference

This is the classes and functions reference of expyfun. Functions are grouped by hardware control type.

Experiment control

Experiment control functions.

ExperimentController(exp_name[, ...])

Interface for hardware control (audio, buttonbox, eye tracker, etc.)

EyelinkController(ec[, link, fs, verbose])

Eyelink communication and control methods.

ParallelTrigger([mode, address, ...])

Parallel port and dummy triggering support.

SoundCardController(params, stim_fs[, ...])

Use a sound card.

TDTController(tdt_params, ec)

Interface for TDT audio output, stamping, and responses.

assert_version(version)

Assert that a specific version of expyfun is imported

binary_to_decimals(binary, n_bits)

Convert a sequence of binary numbers to a sequence of decimal numbers.

check_units(units)

Ensure user passed valid units type

decimals_to_binary(decimals, n_bits)

Convert a sequence of decimal numbers to a sequence of binary numbers.

download_version([version, dest_dir])

Download specific expyfun version

get_config([key, default, raise_error])

Read expyfun preference from env, then expyfun config

get_config_path()

Get path to standard expyfun config file.

get_keyboard_input(prompt[, default, ...])

Get keyboard input of a specific type

known_config_types

Built-in immutable sequence.

set_log_level([verbose, return_old_level])

Convenience function for setting the logging level

set_config(key, value)

Set expyfun preference in config

Sound stimulus design

Experiment sound stimulus functions.

CRMPreload(fs[, ref_rms, ramp_dur, stereo, path])

Store the CRM corpus in memory for fast access.

TrackerBinom(callback, alpha, chance, max_trials)

Binomial hypothesis testing tracker

TrackerDealer(callback, trackers[, max_lag, ...])

Class for selecting and pacing independent simultaneous trackers

TrackerUD(callback, up, down, step_size_up, ...)

Up-down adaptive tracker

TrackerMHW(callback, x_min, x_max[, ...])

Up-down adaptive tracker for the modified Hughson-Westlake Procedure

convolve_hrtf(data, fs, angle[, source, interp])

Convolve a signal with a head-related transfer function

compute_mls_impulse_response(response, mls, ...)

Compute the impulse response from data obtained using MLS

crm_info()

Get allowable options for CRM stimuli.

crm_prepare_corpus(fs[, path_out, ...])

Prepare the CRM corpus for a given sampling rate and convert to wav

crm_response_menu(ec[, colors, numbers, ...])

Create a mouse-driven CRM response menu.

crm_sentence(fs, sex, talker_num, callsign, ...)

Get a specific sentence from the hard drive.

get_tdt_rates()

Get the TDT sample rates.

play_sound(sound[, fs, norm, wait, backend])

Play a sound

repeated_mls(n_samp, n_repeats)

Generate a repeated MLS 0/1 signal for finding an impulse response

rms(data[, axis, keepdims])

Calculate the RMS of a signal

texture_ERB([n_freqs, n_coh, rho, seq, fs, ...])

Create ERB texture stimulus

vocode(data, fs[, n_bands, freq_lims, ...])

Vocode stimuli using a variety of methods

window_edges(sig, fs[, dur, axis, window, edges])

Window the edges of a signal (e.g., to prevent "pops")

File I/O

File reading and writing routines.

read_hdf5(fname)

Read python object from HDF5 format using h5io/h5py

read_tab_raw(fname[, return_params])

Read .tab file from expyfun output without segmenting into trials.

read_tab(fname[, group_start, group_end, ...])

Read .tab file from expyfun output and segment into trials.

read_wav(fname[, verbose])

Read in a WAV file

write_hdf5(fname, data[, overwrite, compression])

Write python object to HDF5 format using h5io/h5py

write_wav(fname, data, fs[, dtype, ...])

Write a WAV file

reconstruct_tracker(fname)

Reconstruct TrackerUD, TrackerBinom, TrackerMHW objects from .tab files.

reconstruct_dealer(fname)

Reconstruct TrackerDealer object from .tab files.

Circle(ec[, radius, pos, units, n_edges, ...])

A circle or ellipse.

ConcentricCircles(ec[, radii, pos, units, ...])

A set of filled concentric circles drawn without edges.

Diamond(ec, pos[, units, fill_color, ...])

A diamond.

FixationDot(ec[, colors])

A reasonable centered fixation dot.

Line(ec, coords[, units, line_color, ...])

A connected set of line segments

ProgressBar(ec, pos[, units, colors])

A progress bar that can be displayed between sections.

RawImage(ec, image_buffer[, pos, scale, units])

Create image from array for on-screen display.

Rectangle(ec, pos[, units, fill_color, ...])

A rectangle.

Text(ec, text[, pos, color, font_name, ...])

A text object.

Triangle(ec, coords[, units, fill_color, ...])

A triangle

Video(ec, file_name[, pos, units, scale, ...])

Read video file and draw it to the screen.

Code blocks

Basic building blocks for standard experimental protocols.

find_pupil_dynamic_range(ec, el[, prompt, ...])

Find pupil dynamic range

find_pupil_tone_impulse_response(ec, el, ...)

Find pupil impulse response using responses to tones

expyfun.analyze:

Analysis

Tools for data analysis.

barplot(h[, axis, ylim, err_bars, lines, ...])

Makes barplots w/ optional line overlays, grouping, & signif.

box_off(ax)

Remove the top and right edges of a plot frame, and point ticks outward.

dprime(hmfc[, zero_correction, return_bias, ...])

Estimate d′ and bias.

fit_sigmoid(x, y[, p0, fixed])

Fit a sigmoid to summary data

format_pval(pval[, latex, scheme])

Format a p-value using one of several schemes.

logit(prop[, max_events])

Convert proportion (expressed in the range [0, 1]) to logit.

plot_screen(screen[, ax])

Plot a captured screenshot

press_times_to_hmfc(presses, targets, foils, ...)

Convert press times to hits/misses/FA/CR and reaction times

restore_values(correct, other, idx)

Restore missing values from one sequence using another

rt_chisq(x[, axis, warn])

Chi square fit for reaction times (a better summary statistic than mean)

sigmoid(x[, lower, upper, midpt, slope])

Calculate sigmoidal values along the x-axis