[SAC-HELP] SAC_macro

pppmali pppmali at 126.com
Thu Mar 12 02:25:40 PDT 2009


Dear Sir
I have three questions about macros in the SAC:
(1)In the example, particle motion plots are produced for five different two second time windows on the same data file: READ ABC 
SETBB TIME1 0 
DO TIME2 FROM 2 TO 10 BY 2 
XLIM %TIME1 $TIME2 
TITLE 'Particle Motion from %TIME1 to $TIME2$' 
PLOTPM 
SETBB TIME1 $TIME2 
ENDDO
(Why is a dollar sign needed after TIME2 in the TITLE command?)
 
(2)In the example, we need to calculate the tangent of an angle that has already been stored in the blackboard in degrees:
u: GETBB ANGLE 
s: ANGLE = 45.0 
u: SETBB VALUE (TAN (DIVIDE (MULTIPLY (PI) %ANGLE%) 180.)) 
s: ==> SETBB VALUE 1.00000
We can rework the above example into a more natural form by intermixing regular (prefix) and embedded arithmetic functions: 

u: SETBB VALUE (TAN ((PI) * %ANGLE / 180. )) 
s: ==> SETBB VALUE 1.00000


(Why is the percent sign needed after ANGLE in the first example and is not needed in the second example?)

(3)The next example uses the SUBSTRING function to extract the month of the event and store it into a blackboard variable. 

{u:} FUNCGEN SEISMOGRAM 
{u:} SETBB MONTH (SUBSTRING 1 3 '&1,KZDATE&') 
{s:} ==> SETBB MONTH MAR
(Why are the quotes needed around the header variable KZDATE?)

I am eager to hear from you! Thanks!

                                                                   

                                                                           Sincerely  Yours
                                                                                   Ma Li


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20090312/f6f8528b/attachment.html>


More information about the sac-help mailing list