engram.episodic package

Submodules

engram.episodic.classic module

engram.episodic.classic.analog_signal(x=None, y=None)[source]
engram.episodic.classic.spectrum(x=None, y=None, z=None, voltage_units='mV', resIncrease=8, clims=(-5, 5))[source]

engram.episodic.graphics module

engram.episodic.shaders module

class engram.episodic.shaders.Galaxy(n=20000)[source]

Bases: object

Galaxy simulation using the density wave theory

eccentricity(r)[source]
reset(rad, radCore, deltaAng, ex1, ex2, sigma, velInner, velOuter)[source]
update(timestep=100000)[source]

Update simulation

engram.episodic.shaders.atom()[source]
engram.episodic.shaders.bb_spectrum(wavelength, bbTemp=5000)[source]

Calculate, by Planck’s radiation law, the emittance of a black body of temperature bbTemp at the given wavelength (in metres). */

engram.episodic.shaders.boids()[source]

Demonstration of boids simulation. Boids is an artificial life program, developed by Craig Reynolds in 1986, which simulates the flocking behaviour of birds. Based on code from glumpy by Nicolas Rougier.

engram.episodic.shaders.brain()[source]

3D brain mesh viewer.

engram.episodic.shaders.constrain_rgb(r, g, b)[source]

If the requested RGB shade contains a negative weight for one of the primaries, it lies outside the colour gamut accessible from the given triple of primaries. Desaturate it by adding white, equal quantities of R, G, and B, enough to make RGB all positive. The function returns 1 if the components were modified, zero otherwise.

engram.episodic.shaders.engram(regions, spikes, assignments)[source]
engram.episodic.shaders.fireworks()[source]

Example demonstrating simulation of fireworks using point sprites. (adapted from the “OpenGL ES 2.0 Programming Guide”)

This example demonstrates a series of explosions that last one second. The visualization during the explosion is highly optimized using a Vertex Buffer Object (VBO). After each explosion, vertex data for the next explosion are calculated, such that each explostion is unique.

engram.episodic.shaders.fluid()[source]
engram.episodic.shaders.fun()[source]
engram.episodic.shaders.galaxy()[source]
engram.episodic.shaders.gamma_correct(cs, c)[source]

Transform linear RGB values to nonlinear RGB values. Rec. 709 is ITU-R Recommendation BT. 709 (1990) ``Basic Parameter Values for the HDTV Standard for the Studio and for International Programme Exchange’‘, formerly CCIR Rec. 709. For details see

engram.episodic.shaders.gamma_correct_rgb(cs, r, g, b)[source]
engram.episodic.shaders.graph()[source]

Plot clusters of data points and a graph of connections

engram.episodic.shaders.inside_gamut(r, g, b)[source]

Test whether a requested colour is within the gamut achievable with the primaries of the current colour system. This amounts simply to testing whether all the primary weights are non-negative. */

engram.episodic.shaders.interact()[source]

Test the fps capability of Vispy with meshdata primitive

engram.episodic.shaders.norm_rgb(r, g, b)[source]

Normalise RGB components so the most intense (unless all are zero) has a value of 1.

engram.episodic.shaders.oscilloscope()[source]

An oscilloscope, spectrum analyzer, and spectrogram.

This demo uses pyaudio to record data from the microphone. If pyaudio is not available, then a signal will be generated instead.

engram.episodic.shaders.realtimesignals()[source]

Multiple real-time digital signals with GLSL-based clipping.

engram.episodic.shaders.sandbox()[source]

A GLSL sandbox application based on the spinning cube. Requires PySide or PyQt5.

engram.episodic.shaders.select(shader='atom', regions=None, data=None, assignments=None)[source]
engram.episodic.shaders.shadertoy()[source]
engram.episodic.shaders.spectrogram(data, settings)[source]
engram.episodic.shaders.spectrum_to_xyz(spec_intens, temp)[source]

Calculate the CIE X, Y, and Z coordinates corresponding to a light source with spectral distribution given by the function SPEC_INTENS, which is called with a series of wavelengths between 380 and 780 nm (the argument is expressed in meters), which returns emittance at that wavelength in arbitrary units. The chromaticity coordinates of the spectrum are returned in the x, y, and z arguments which respect the identity:

x + y + z = 1.

CIE colour matching functions xBar, yBar, and zBar for wavelengths from 380 through 780 nanometers, every 5 nanometers. For a wavelength lambda in this range:

cie_colour_match[(lambda - 380) / 5][0] = xBar
cie_colour_match[(lambda - 380) / 5][1] = yBar
cie_colour_match[(lambda - 380) / 5][2] = zBar

AH Note 2011: This next bit is kind of irrelevant on modern hardware. Unless you are desperate for speed. In which case don’t use the Python version!

To save memory, this table can be declared as floats rather than doubles; (IEEE) float has enough significant bits to represent the values. It’s declared as a double here to avoid warnings about “conversion between floating-point types” from certain persnickety compilers.

engram.episodic.shaders.upvp_to_xy(up, vp)[source]
engram.episodic.shaders.xy_toupvp(xc, yc)[source]
engram.episodic.shaders.xyz_to_rgb(cs, xc, yc, zc)[source]

Given an additive tricolour system CS, defined by the CIE x and y chromaticities of its three primaries (z is derived trivially as 1-(x+y)), and a desired chromaticity (XC, YC, ZC) in CIE space, determine the contribution of each primary in a linear combination which sums to the desired chromaticity. If the requested chromaticity falls outside the Maxwell triangle (colour gamut) formed by the three primaries, one of the r, g, or b weights will be negative.

Caller can use constrain_rgb() to desaturate an outside-gamut colour to the closest representation within the available gamut and/or norm_rgb to normalise the RGB components so the largest nonzero component has value 1.

engram.episodic.terminal module

engram.episodic.terminal.endProgress()[source]
engram.episodic.terminal.progress(x)[source]
engram.episodic.terminal.startProgress(title)[source]

Module contents

:mod:’engram.episodic’ provides functions for visualizing Engrams