Hi Rick,
Yes, you raise good points and I will take them into account. I failed to mention earlier that I wanted to add @ seed = $seed +1 and 3dDeconvolve to my command. If I run the following shorter command (see first script below), then I see the LC[0] norm. std. dev number going through 100 iterations while the process is running in the terminal. However, I have trouble integrating the iterations into a larger script that spits out the numbers for LC into a file. I would like that LC file so that I can evaluate which iteration has the lowest norm. std. dev. I hope that makes more sense now.
The following command works (further below I pasted the command that does not work):
set seed = 1234567
foreach iter (`count -digits 3 1 100`)
make_random_timing.py -num_runs 2 -run_time 240 -num_stim 2 -num_reps 15 -show_timing_stats -stim_dur 2 -max_consec 3 -min_rest 2.0 -save_3dd_cmd sample.3dd.command.${iter} -stim_labels first second -t_gran 4.0 -make_3dd_contrasts -verb 4 -seed ${seed} -prefix stim_times.${iter}.
@ seed = $seed + 1
3dDeconvolve \
-nodata 120 4.000 \
-polort 2 \
-concat '1D: 0 60' \
-num_stimts 2 \
-stim_times 1 stim_times.${iter}._01_first.1D 'BLOCK(2,1)' \
-stim_label 1 first \
-stim_times 2 stim_times.${iter}._02_second.1D 'BLOCK(2,1)' \
-stim_label 2 second \
-num_glt 1 \
-gltsym 'SYM: first -second' -glt_label 1 first-second \
-x1D X.xmat.${iter}.1D.
end
Integrating the above portion into the command below does not work (I pasted the error message to the very end):
set iterations = 100
set seed = 1234567
set outdir = stim_results
set LCfile = NSD_sums # file to store norm. std. dev. sums in # set pattern = LC # search pattern for LC[0], say
set pattern = 'norm. std.' # search pattern for normalized stdev vals
foreach iter (`count -digits 3 1 $iterations`)
# create empty LC file
echo -n "" > $LCfile
echo -n "iteration: 000"
make_random_timing.py -num_runs 2 -run_time 240 -num_stim 2 -num_reps 15 -show_timing_stats -stim_dur 2 -max_consec 3 -min_rest 2.0 -save_3dd_cmd sample.3dd.command.${iter} -stim_labels first second -t_gran 4.0 -make_3dd_contrasts -verb 4 -seed ${seed} -prefix stim_times.${iter} >& out.mrt.$iter
tcsh cmd.3dd.$iter >& out.3dD.$iter
@ seed = $seed + 1
3dDeconvolve \
-nodata 120 4.000 \
-polort 2 \
-concat '1D: 0 60' \
-num_stimts 2 \
-stim_times 1 stim_times.${iter}._01_first.1D 'BLOCK(2,1)' \
-stim_label 1 first \
-stim_times 2 stim_times.${iter}._02_second.1D 'BLOCK(2,1)' \
-stim_label 2 second \
-num_glt 1 \
-gltsym 'SYM: first -second' -glt_label 1 first-second \
-x1D X.xmat.${iter}.1D.
# save the sum of the 2 LC values
set nums = ( `awk -F= '/'"$pattern"'/ {print $2}' out.3dD.${iter}` )
# make a quick ccalc command
set sstr = $nums[1]
foreach num ( $nums[2] )
set sstr = "$sstr + $num"
end
set num_sum = `ccalc -expr "$sstr"`
echo -n "$num_sum = $sstr : " >> $LCfile
echo "iteration $iter, seed $seed" >> $LCfile
echo -n "$iter"
end
#: Command not found.
iteration: 000** FATAL ERROR: '-stim_times 1' can't read file 'stim_times.001._01_first.1D' [nopt=12]
** Program compile date = Sep 25 2015
#: Command not found.
#: Command not found.
nums: Subscript out of range.