-
Notifications
You must be signed in to change notification settings - Fork 19
/
utilities.lyx
2711 lines (2136 loc) · 47.5 KB
/
utilities.lyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#LyX 1.4.3 created this file. For more info see http://www.lyx.org/
\lyxformat 245
\begin_document
\begin_header
\textclass book
\begin_preamble
\usepackage{hyperref}
\let\myUrl\url
\renewcommand{\url}[1]{(\myUrl{#1})}
\end_preamble
\language english
\inputencoding latin1
\fontscheme default
\graphics default
\paperfontsize 11
\spacing single
\papersize default
\use_geometry true
\use_amsmath 0
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\leftmargin 1in
\topmargin 1in
\rightmargin 1in
\bottommargin 1in
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\end_header
\begin_body
\begin_layout Chapter
\begin_inset LatexCommand \label{cha:The-Utilities-User's}
\end_inset
The Utilities User's Manual
\end_layout
\begin_layout Section
cucss2sac
\end_layout
\begin_layout Subsubsection*
\noindent
\series bold
NAME
\series default
\end_layout
\begin_layout Description
\series bold
cucss2sac
\series default
Converts CSS 3.0 waveforms to SAC binary or ASCII files
\end_layout
\begin_layout Subsubsection*
\series bold
SYNOPSIS
\series default
\end_layout
\begin_layout Standard
\series bold
cucss2sac [-a [-n]] db_name out_SAC_dir
\series default
\end_layout
\begin_layout Subsubsection*
\noindent
\series bold
OPTIONS
\series default
\end_layout
\begin_layout Description
\series bold
-a
\series default
Generate ASCII files
\end_layout
\begin_layout Description
\series bold
-n
\series default
Suppress header output in ASCII files.
Used together with
\series bold
-a
\series default
option.
\end_layout
\begin_layout Subsubsection*
\series bold
DESCRIPTION
\series default
\end_layout
\begin_layout Standard
The
\series bold
cucss2sac
\series default
utility converts a CSS 3.0
\shape italic
.wfdisc
\shape default
relation into a set of SAC binary files or ASCII files.
Output files are stored in
\series bold
out_SAC_dir
\series default
directory.
This program has been designed especially for the
\series bold
Mineos
\series default
package due to bugs in the standard IRIS
\series bold
css2sac
\series default
utility.
\series bold
cucss2sac
\series default
supports limited capabilities and is not a complete substitution of the
standard
\series bold
css2sac
\series default
utility.
For example,
\series bold
cucss2sac
\series default
only supports the CSS3.0 schema and two input CSS binary data formats:
\end_layout
\begin_layout Itemize
``t4'' (BIG_ENDIAN, single precision floating point)
\end_layout
\begin_layout Itemize
``f4'' (LOW_ENDIAN, single precision floating point)
\end_layout
\begin_layout Standard
\series bold
cucss2sac
\series default
converts CSS binary data ``as is'' without any corrections or modifications.
For the
\series bold
Mineos
\series default
package,
\series bold
cucss2sac
\series default
may be used for the conversion of Green's functions or synthetic seismograms
to binary SAC or ASCII files.
\end_layout
\begin_layout Standard
A CSS database
\series bold
db_name
\series default
must include at least one file
\family typewriter
db_name.wfdisc
\family default
file containing CSS format information about the waveforms.
It is also desirable to add to the database
\shape italic
.origin
\shape default
and
\shape italic
.site
\shape default
relation tables (files
\family typewriter
\size small
db_name.origin
\family default
\size default
and
\family typewriter
\size small
db_name.site
\family default
\size default
) to get a more complete SAC header.
Note that the
\shape italic
.origin
\shape default
relation keeps information about event location and the
\shape italic
.site
\shape default
relation keeps station locations.
If
\shape italic
.origin
\shape default
is present in the database,
\series bold
cucss2sac
\series default
uses only the first line from this file.
In the case of ASCII output, all available parameters go to the ASCII header
-- three lines in the beginning of the file.
For example, an output file for a synthetic seismogram looks as follows:
\end_layout
\begin_layout LyX-Code
\family typewriter
EVENT: 2000(014)-23:37:10.800 947893030.80000 25.3900 101.4000 33.0000
\end_layout
\begin_layout LyX-Code
\family typewriter
STATION: ALE LHE 82.5033 -62.3500 0.0000
\end_layout
\begin_layout LyX-Code
\family typewriter
DATA: 2000(014)-23:37:10.800 947893030.80000 8000 1.000000
\end_layout
\begin_layout LyX-Code
\family typewriter
0.0000000E+00 5.7025738E+00
\end_layout
\begin_layout LyX-Code
\family typewriter
1.0000000E+00 1.9508668E+00
\end_layout
\begin_layout LyX-Code
\family typewriter
2.0000000E+00 -4.1160989E+00
\end_layout
\begin_layout LyX-Code
\family typewriter
3.0000000E+00 -4.1094885E+00
\end_layout
\begin_layout LyX-Code
\family typewriter
......
\end_layout
\begin_layout LyX-Code
\family typewriter
......
\end_layout
\begin_layout LyX-Code
\family typewriter
......
\end_layout
\begin_layout LyX-Code
\family typewriter
7.9970000E+03 1.5211651E+01
\end_layout
\begin_layout LyX-Code
\family typewriter
7.9980000E+03 2.7408613E+01
\end_layout
\begin_layout LyX-Code
\family typewriter
7.9990000E+03 3.5795624E+01
\end_layout
\begin_layout Standard
where
\end_layout
\begin_layout Itemize
the
\family typewriter
EVENT
\family default
line represents event information: origin time (human and epoch), latitude
(deg), longitude (deg), and depth (km);
\end_layout
\begin_layout Itemize
the
\family typewriter
STATION
\family default
line represents station information: station code, channel name, latitude
(deg), longitude (deg), and depth = 0;
\end_layout
\begin_layout Itemize
the
\family typewriter
DATA
\family default
line represents data parameters: waveform starting time (human and epoch),
number of samples, and sampling step (sec).
\end_layout
\begin_layout Standard
The rest of the lines (the body) is a two-column table.
The first column represents relative time from the beginning of waveform
in seconds, and the second one shows waveform samples in nm, nm/s or nm/s
\begin_inset Formula $^{2}$
\end_inset
, according to the
\series bold
syndat
\series default
output format.
\end_layout
\begin_layout Standard
If the presence of the header is not desired, suppress it with option
\series bold
-n
\series default
(no header).
\end_layout
\begin_layout Standard
The output ASCII file format for the Green's functions is different.
The header is the same, but the body is a 7-column table.
The first column is relative time, as before, and the other 6 columns are
the 6-unit Green's functions (
\begin_inset Formula $G_{rr},G_{\theta\theta},G_{\varphi\varphi},G_{r\theta},G_{r\varphi},G_{\theta\varphi}$
\end_inset
) for the chosen component -- vertical or some horizontal.
The order of the components is the same as the order of the seismic moment
tensor components
\begin_inset Formula $M_{ij}$
\end_inset
defined in the
\series bold
syndat
\series default
program.
So the corresponding synthetic seismogram S (
\series bold
\color red
NOTE:
\series default
\color none
IN ACCELERATION, nm/s
\begin_inset Formula $^{2}$
\end_inset
) is given by the formula
\end_layout
\begin_layout Quote
\begin_inset Formula \[
S=10^{-18}\;\sum_{ij}G_{ij}\; M_{ij}\]
\end_inset
\end_layout
\begin_layout Standard
where
\begin_inset Formula $M_{ij}$
\end_inset
are given in dyne*cm for
\begin_inset Formula $ij=rr,\theta\theta,\varphi\varphi,r\theta,r\varphi,\theta\varphi$
\end_inset
.
\end_layout
\begin_layout Quote
NOTE: According to SAC compliance, event depth is stored in the SAC header
in meters.
\end_layout
\begin_layout Subsubsection*
\series bold
EXAMPLES
\series default
\end_layout
\begin_layout LyX-Code
\series bold
cucss2sac Syndat Syndat_SAC
\newline
cucss2sac green green_SAC
\newline
cucss2sac -a Syndat
Syndat_ASC
\newline
cucss2sac -a -n Syndat Syndat_ASC_NOHEADER
\series default
\end_layout
\begin_layout Section
eigen2asc
\end_layout
\begin_layout Subsubsection*
\noindent
\series bold
NAME
\series default
\end_layout
\begin_layout Description
\series bold
eigen2asc
\series default
Converts the
\shape italic
.eigen
\shape default
relation table to ASCII files
\end_layout
\begin_layout Subsubsection*
\series bold
SYNOPSIS
\series default
\end_layout
\begin_layout Standard
\series bold
eigen2asc [-n] nmin nmax lmin lmax db_name out_dir
\series default
\end_layout
\begin_layout Subsubsection*
\noindent
\series bold
OPTIONS
\series default
\end_layout
\begin_layout Description
\series bold
-n
\series default
Suppress header output in ASCII files.
\end_layout
\begin_layout Subsubsection*
\noindent
\series bold
DESCRIPTION
\series default
\end_layout
\begin_layout Standard
The
\series bold
eigen2asc
\series default
utility converts some part or the whole
\shape italic
.eigen
\shape default
relation into a set of ASCII files.
Program
\series bold
eigen2asc
\series default
searches in the
\family typewriter
db_name.eigen
\family default
file for all eigenfunctions with mode numbers n, l satisfying the following
conditions:
\series bold
nmin
\series default
\begin_inset Formula $\le$
\end_inset
n
\begin_inset Formula $\le$
\end_inset
\series bold
nmax
\series default
,
\series bold
lmin
\series default
\begin_inset Formula $\le$
\end_inset
l
\begin_inset Formula $\le$
\end_inset
\series bold
lmax
\series default
, and converts eigenfunctions to ASCII files.
Output files are stored in
\series bold
out_dir
\series default
.
Each output file consists of the header and the body.
The header is a single line including the first 10 fields of the
\shape italic
.eigen
\shape default
relation, see Table
\begin_inset LatexCommand \ref{tab:Relation:-eigen.-Description:}
\end_inset
.
The option
\series bold
-n
\series default
excludes the header output.
The body is a three-column (radial, toroidal modes) or seven-column (spheroidal
mode) table.
The first body column is radius in meters and the other columns contain
the eigen functions and their derivatives by radius (in the internal, normalize
d units) -- U, U', V, V', P, P' for spheroidal modes and W, W' for other
modes.
For more details, see Section 4.1.
The output file name has the form
\series bold
X.nnnnnnn.mmmmmmm.ASC
\series default
, where, letter
\series bold
X
\series default
is ``S'' for spheroidal modes or ``T'' for toroidal modes,
\series bold
nnnnnnn
\series default
is the number n, and
\series bold
mmmmmmm
\series default
is the mode number l.
\end_layout
\begin_layout Subsubsection*
\noindent
\series bold
EXAMPLES
\series default
\end_layout
\begin_layout LyX-Code
\series bold
eigen2asc 0 1 2 500 test_S Eigen_S_ASC
\end_layout
\begin_layout LyX-Code
\series bold
eigen2asc -n 0 1 2 500 test_S Eigen_S_no_headers_ASC
\series default
\end_layout
\begin_layout Section
endi
\end_layout
\begin_layout Subsubsection*
\series bold
NAME
\series default
\end_layout
\begin_layout Description
\series bold
endi
\series default
In-place file swapping with fixed width
\end_layout
\begin_layout Subsubsection*
\series bold
SYNOPSIS
\series default
\end_layout
\begin_layout Standard
\series bold
endi nw file1 [ file2 ...
filen]
\series default
\end_layout
\begin_layout Subsubsection*
\series bold
DESCRIPTION
\series default
\end_layout
\begin_layout Standard
This utility is used when you transfer binary files of
\shape italic
.wfdisc
\shape default
or
\shape italic
.eigen
\shape default
relations to a platform with a different byte order.
The utility changes the byte order from BIG_ENDIAN to LOW_ENDIAN and vice
versa.
\series bold
endi
\series default
sequentially reads the file from the list
\series bold
file1 [ file2 ...
filen]
\series default
into memory as an unsigned character string, swaps sequential groups of
\series bold
nw
\series default
bytes long starting from the beginning of the file, and stores the swapped
data into the same place as before (swapping in-place).
If the last group has a length less than
\series bold
nw
\series default
, it stays unswapped.
\end_layout
\begin_layout Subsubsection*
\series bold
EXAMPLES
\series default
\end_layout
\begin_layout Standard
In this example, w.00001 and w.00002 are the binary real*4 data files from
some
\shape italic
.wfdisc
\shape default
relation created on a PC computer.
These files have internal LOW_ENDIAN data representation created, e.g., by
a direct access FORTRAN WRITE statement.
After applying the command:
\end_layout
\begin_layout LyX-Code
\begin_inset Formula $...>$
\end_inset
\series bold
endi
\series default
4 w.00001 w.00002
\end_layout
\begin_layout Standard
we change the order of 4-byte words to BIG_ENDIAN for transferring these
files on a computer with BIG_ENDIAN byte order, e.g., a SUN Ultra machine,
where we may use a direct access READ statement to read data as real*4
variables.
\end_layout
\begin_layout Section
simpledit
\end_layout
\begin_layout Subsubsection*
\series bold
NAME
\series default
\end_layout
\begin_layout Description
\series bold
simpledit
\series default
Filter to create
\shape italic
.site
\shape default
and
\shape italic
.sitechan
\shape default
CSS relations from an input ASCII file
\end_layout
\begin_layout Subsubsection*
\series bold
SYNOPSIS
\series default
\end_layout
\begin_layout Standard
\series bold
simpledit ascii_file db_name
\series default
\end_layout
\begin_layout Subsubsection*
\series bold
DESCRIPTION
\series default
\end_layout
\begin_layout Standard
The
\series bold
simpledit
\series default
is a simple filter program.
It converts a manually created (text editor) unformatted ASCII file
\series bold
ascii_file
\series default
with station and channel information into CSS3.0
\series bold
db_name.site
\series default
and
\series bold
db_name.sitechan
\series default
relation tables (files).
The prefix
\series bold
db_name
\series default
, coming from the command line, is the database name.
In the case of real data, there is another way to create these relations.
Use the IRIS
\series bold
rdseed
\series default
program, which provides SEED volume conversion to CSS format.
Note, CSS format is strictly defined, so do not create
\shape italic
.site
\shape default
and
\shape italic
.sitechan
\shape default
tables manually.
This leads to numerous format errors and as a result can crash the
\series bold
Mineos
\series default
programs.
In case of a lot of station data, a better solution is to write a program
which creates
\series bold
ascii_file
\series default
or
\shape italic
.site
\shape default
and
\shape italic
.sitechan
\shape default
files directly.
\end_layout
\begin_layout Description
\series bold
\emph on
Description\InsetSpace ~
of\InsetSpace ~
ascii_file
\series default
\emph default
The
\series bold
ascii_file
\series default
is a set of ASCII text lines.
Each line describes a single station or a single channel.
All channel lines, placed after some station line, belong to that station.
\end_layout
\begin_layout Standard
For example, consider the following file:
\end_layout
\begin_layout LyX-Code
\family typewriter
ANMO 34.9502 -106.4602 1.6890 'Albuquerque, New Mexico, USA'
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LH1 150.0000 280.0 90.0
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LH2 150.0000 10.0 90.0
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LHZ 89.3000 0.0 0.0
\end_layout
\begin_layout LyX-Code
\family typewriter
BJT 40.0183 116.1679 0.1370 'Baijiatuan, Beijing, China'
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LHE 60.0000 90.0 90.0
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LHN 60.0000 0.0 90.0
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LHZ 60.0000 0.0 0.0
\end_layout
\begin_layout LyX-Code
\family typewriter
@ BHE 60.0000 90.0 90.0
\end_layout
\begin_layout LyX-Code
\family typewriter
@ BHN 60.0000 0.0 90.0
\end_layout
\begin_layout LyX-Code
\family typewriter
@ BHZ 60.0000 0.0 180.0
\end_layout
\begin_layout LyX-Code
\family typewriter
BILL 68.0651 166.4524 0.2990 'Bilibino, Russia'
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LHZ 0.0000 0.0 0.0
\end_layout
\begin_layout LyX-Code
\family typewriter
CCM 38.0557 -91.2446 0.1710 'Cathedral Cave, Missouri, USA'
\end_layout
\begin_layout LyX-Code
\family typewriter
@ LHE 51.0000 90.0 90.0
\end_layout
\begin_layout LyX-Code