Exemple #1
0
    def spawn_pandas(port=5005, freq_max=101):
        tex_size = (1024, 1024)
        freqs = np.arange(freq_max)

        input_textures = {
            'freq': {},
            'blank': textures.BlankTexXY(texture_size=tex_size)
        }
        for f in freqs:
            input_textures['freq'][f] = textures.GratingGrayTexXY(
                texture_size=tex_size, spatial_frequency=f)

        stimulation = stimuli.ClosedLoopStimChoice(textures=input_textures,
                                                   gui=True)

        sub = utils.Subscriber(topic="stim", port=port)
        monitor = utils.MonitorDataPass(sub)
        stimulation.run()
Exemple #2
0
    duration = 7
    stat_time = 18

    df.loc[:, 'stationary_time'] = stat_time
    df.loc[:, 'duration'] = duration
    return df

svepath = 'temp1.txt'

tex_size = (1024, 1024)
freqs = np.arange(101)

input_textures = {'freq': {}, 'blank': textures.BlankTexXY(texture_size=tex_size)}
for f in freqs:
    input_textures['freq'][f] = textures.GratingGrayTexXY(texture_size=tex_size, spatial_frequency=f)



def stims(port="5005"):
    stimulation = stimuli.ClosedLoopStimChoice(textures=input_textures, save_path=svepath)

    sub = utils.Subscriber(topic="stim", port=port)
    monitor = utils.MonitorDataPass(sub)
    stimulation.run()


if __name__ == '__main__':
    port1 = utils.port_provider()
    stims_proc = mp.Process(target=stims, args=(port1,))
    sequencer = mp.Process(target=utils.sequence_runner, args=(create_prot(), port1))
from pandastim import stimuli, textures
import pandas as pd

save_path = None

# df = pd.read_hdf(r'C:\Soft_Kitty\Anaconda3\envs\clean_pstim\Lib\site-packages\pandastim\experiments\imaging.hdf')

df = pd.read_hdf(r'D:\autumnal_luzps_no_tex.hdf')

df = df.loc[1:]

df.loc[:, 'texture_0'] = textures.GratingGrayTexXY(texture_size=(1024, 1024),
                                                   spatial_frequency=60)
df.loc[:, 'texture_1'] = textures.GratingGrayTexXY(texture_size=(1024, 1024),
                                                   spatial_frequency=60)

df.loc[:, 'stationary_time'] = df.stat_time.values
# df.loc[:, 'duration'] = df.duration.values + df.stationary_time.values

df = pd.concat([df] * 10)
df.reset_index(inplace=True)

stims = stimuli.OpenLoopStimulus(df)
stims.run()
Exemple #4
0
from pandastim import textures, stimuli

# this loads in your default parameters
p = r'C:\Users\matt_analysis\Documents\def_pstim_params.txt'
with open(p) as json_file:
    pstim_params = json.load(json_file)

# make a cute little stim dict
t_size = (512, 512)
fwd = {
    'stim_type': 's',
    'velocity': 0.02,
    'angle': 0,
    'stationary_time': 1,
    'duration': 3,
    'texture': textures.GratingGrayTexXY(texture_size=t_size,
                                         spatial_frequency=20)
}
right = {
    'stim_type':
    'b',
    'velocity': [0.02, -0.02],
    'angle': [90, 25],
    'duration': [5, 2],
    'texture': [
        textures.GratingGrayTexXY(texture_size=t_size, spatial_frequency=20),
        textures.GratingGrayTexXY(texture_size=t_size, spatial_frequency=20)
    ]
}
left = {
    'stim_type': 's',
    'velocity': 0.02,