Skip to content

Commit a36cc33

Browse files
authored
Remove the gaussian noise waveform option from nifgen_script.py to avoid errors (#1950)
* Clip the gaussian noise * paas a list to sorted * Delete noise option from nifgen_script.py
1 parent 742b30b commit a36cc33

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/nifgen/examples/nifgen_script.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import nifgen
55

66
import math
7-
import random
87
import sys
98
import time
109

@@ -21,7 +20,6 @@
2120
RAMP_DOWN = [-1.0 * x for x in RAMP_UP]
2221
SQUARE_WAVE = [1.0 if x < (NUMBER_OF_SAMPLES / 2) else -1.0 for x in range(NUMBER_OF_SAMPLES)]
2322
SAWTOOTH_WAVE = RAMP_UP[::2] + [(-1 + x) for x in RAMP_UP][::2]
24-
GAUSSIAN_NOISE = [random.gauss(0, 0.2) for x in range(NUMBER_OF_SAMPLES)]
2523

2624

2725
SCRIPT_ALL = '''
@@ -48,7 +46,6 @@
4846
end repeat
4947
repeat until scriptTrigger0
5048
generate rampdown
51-
generate noise
5249
generate rampup
5350
end repeat
5451
end script
@@ -82,12 +79,6 @@
8279
generate sawtooth
8380
end repeat
8481
end script
85-
86-
script scriptnoise
87-
repeat until scriptTrigger0
88-
generate noise
89-
end repeat
90-
end script
9182
'''
9283

9384

@@ -108,10 +99,9 @@ def example(resource_name, options, shape, channel):
10899
session.channels[channel].write_waveform('rampdown', RAMP_DOWN)
109100
session.channels[channel].write_waveform('square', SQUARE_WAVE)
110101
session.channels[channel].write_waveform('sawtooth', SAWTOOTH_WAVE)
111-
session.channels[channel].write_waveform('noise', GAUSSIAN_NOISE)
112102

113103
# 4 - Script to generate
114-
# supported shapes: SINE / SQUARE / SAWTOOTH / RAMPUP / RAMPDOWN / NOISE / MULTI
104+
# supported shapes: SINE / SQUARE / SAWTOOTH / RAMPUP / RAMPDOWN / MULTI
115105
script_name = 'script{}'.format(shape.lower())
116106
num_triggers = 6 if shape.upper() == 'MULTI' else 1 # Only multi needs multiple triggers, all others need one
117107

0 commit comments

Comments
 (0)