Thread: Macro correlation produces segmentation fault

Started: 2011-05-03 21:49:13
Last activity: 2011-05-03 21:49:13
Topics: SAC Help
Elkins, Bailey E
2011-05-03 21:49:13
Hi all,

I'm trying to run a macro that will produce correlations for all possible station pairs from a file list. I'm attempting to do this with a blackboard variable and a while loop. Each time I run the macro, it works fine for the first iteration of the while loop. The second iteration produces a segmentation fault after the correlate command is executed, but before it changes to my write directory.

I have experienced this problem while running SAC 101.4 on 2 RedHat Linux workstations and a Mac OS X 10.6.7 system.

$Keys day nfiles
setbb acor 1
setbb stop $nfiles


echo on
cd Processed
while %acor LE %stop
read ./Normalized/day$day$/*
correlate master %acor%
cd ./Correlated/day$day$
mkdir %acor
cd %acor
write kstcmp
setbb acor (%acor% + 1)
cd ..
cd ..
cd ..
enddo

echo off
Message "Correlation complete"


As a side note, is there a way to make a directory from the KSTNM header field for the file in the file list that corresponds to "acor" ? I've made this work if I input "&3,kstnm&" but if acor=3 and I input &%acor%,kstnm& it returns "3ERROR". This is not critical, more of a curiosity.

Thanks for your help everyone! There aren't many users of SAC at my institution to ask questions of.

Best,

Bailey Elkins

18:27:39 v.22510d55