Skip to content

Commit 75e02b5

Browse files
committed
add school2025
1 parent c9b8799 commit 75e02b5

File tree

15 files changed

+3195
-0
lines changed

15 files changed

+3195
-0
lines changed

book/rsf/school2025/Fig/fig1.pdf

57.9 KB
Binary file not shown.

book/rsf/school2025/SConstruct

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from rsf.tex import *
2+
3+
Paper('school2025','school2025',
4+
lclass='IEEEtran',
5+
options='journal,twoside',
6+
use='''amsmath,amsfonts algorithmic array
7+
[caption=false,font=normalsize,labelfont=sf,textfont=sf]subfig
8+
textcomp stfloats url verbatim graphicx balance
9+
'''.split(),
10+
include=r'''\hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore}
11+
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
12+
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}''')
13+
14+
End()
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
from rsf.proj import *
2+
3+
# Make dependencies
4+
SConscript('../src/SConstruct')
5+
6+
# Single graph
7+
Flow('sin', None,
8+
'''
9+
math n1=41 o1=-4 d1=0.2 output='0.5*x1-sin(x1)'
10+
''')
11+
12+
Result('sin1','sin',
13+
'''
14+
graph title="0.5x-sin(x)" min1=-4 max1=4
15+
''')
16+
Result('sin2','sin',
17+
'''
18+
graph title="0.5x-sin(x)" min1=-4 max1=4
19+
symbol=o symbolsz=12 grid=y
20+
''')
21+
22+
# Sigmoid model
23+
Flow('model',None,
24+
'''
25+
sigmoid n1=200 n2=200 d1=.004 d2=.008 |
26+
smooth rect1=3 diff1=1 | smooth rect1=3 |
27+
put label2=Distance title='"Sigmoid Model"'
28+
''')
29+
30+
# Time-frequency spectrum
31+
Flow('ltft','model',
32+
'''
33+
ltft niter=10 rect=5 |
34+
cabs
35+
''')
36+
37+
# Plot using madagascar
38+
Result('model',
39+
'''
40+
grey title="Sigmoid Model"
41+
''')
42+
Result('modelw','model',
43+
'''
44+
wiggle transp=y yreverse=y poly=y
45+
title="Sigmoid Model"
46+
''')
47+
Result('ltft','ltft',
48+
'''
49+
byte bar=bar.rsf allpos=y clip=2e-4 |
50+
grey3 title="Time-Frequency Spectra" color=j
51+
frame1=100 frame2=25 frame3=100 flat=n
52+
bar=bar.rsf scalebar=y
53+
''')
54+
55+
# Figure combinations
56+
Plot('subfig1','model','grey')
57+
Plot('subfig2','model','wiggle transp=y yreverse=y poly=y')
58+
59+
Result('combined','subfig1 subfig2','TwoRows')
60+
61+
# Plot using sfmatplotlib
62+
63+
Result('model1','model',
64+
'''
65+
transp |
66+
sfmatplotlib imshow cmap=gray origin=upper format=pdf
67+
title="Sigmoid Model" xlabel="Distance (sample)" ylabel="Time (sample)"
68+
''', suffix='.pdf')
69+
70+
# Plot using python script
71+
## grey-scale
72+
mypyscript = '../src/greytest.exe'
73+
# Or
74+
# mypyscript = '../src/greytest.py'
75+
# and use `python ../src/greytest.py`
76+
77+
Result('mygrey',['model', mypyscript], # Make your script dependent
78+
'''
79+
${SOURCES[1]}
80+
''', suffix='.pdf')
81+
82+
## wiggle provided by ChatGPT
83+
gptscript = '../src/wigtest.exe'
84+
Result('gptwig',['model', gptscript],
85+
'''
86+
${SOURCES[1]}
87+
''', suffix='.pdf')
88+
89+
## grey3 by python
90+
grey3script = '../src/grey3test.exe'
91+
Result('pygrey3',['ltft', grey3script],
92+
'''
93+
${SOURCES[1]} frame1=100 frame2=25 frame3=100
94+
point1=0.8 point2=0.4 clip=2e-4 flat=n scalebar=y
95+
title="Time-Frequency Spectra" allpos=y color=jet
96+
''', suffix='.pdf')
97+
98+
# Plot using matlab/octave script (grey-scale)
99+
matlab = WhereIs('matlab')
100+
octave = WhereIs('octave')
101+
matscript = '../src/matgrey1.m'
102+
funcname = 'matgrey1'
103+
104+
if matlab:
105+
Result('matgrey',['model', matscript],
106+
'''
107+
%s -batch "addpath('../src/'); %s('${SOURCES[0]}', '${TARGETS[0]}', 'Sigmoid Model')"
108+
'''%(matlab, funcname), suffix='.pdf', stdin=0, stdout=-1)
109+
110+
if octave:
111+
Result('octgrey',['model', matscript],
112+
'''
113+
%s --eval "addpath('../src/'); %s('${SOURCES[0]}', '${TARGETS[0]}', 'Sigmoid Model'); exit;"
114+
'''%(octave, funcname), suffix='.pdf', stdin=0, stdout=-1)
115+
116+
# Try GMT
117+
gmt = WhereIs('gmt')
118+
if gmt:
119+
gmtscript1 = '../src/gmt-1.sh'
120+
gmtscript2 = '../src/gmt-2.sh'
121+
Result('gmt1', gmtscript1,'bash ${SOURCES[0]} ${TARGETS[0]}', suffix='.pdf', stdin=0, stdout=-1)
122+
Result('gmt2', gmtscript2,'bash ${SOURCES[0]} ${TARGETS[0]}', suffix='.pdf', stdin=0, stdout=-1)
123+
124+
# GMT Wiggle
125+
126+
## Need T-X Grid
127+
Flow('model1','model','dd form=ascii line=1 --out=${TARGETS[0]}', stdout=0)
128+
Flow('tgrid','model','math output="x1" | dd form=ascii line=1 --out=${TARGETS[0]}', stdout=0)
129+
Flow('xgrid','model','math output="x2" | dd form=ascii line=1 --out=${TARGETS[0]}', stdout=0)
130+
Flow('gmtmodel','tgrid xgrid model1', ' paste ${SOURCES[0:3]} ')
131+
Result('gmt3', ['gmtmodel'],
132+
'''
133+
gmt wiggle -R0/0.8/0/1.6 -JX5i/5i -BWSne+t"Sigmoid Model" -B -Z0.1i -Gred+p -Gblue+n -Wdefault -gy0.001 -By+l"Distance (km)" -Bx+l"Time (s)" -pdf Fig/gmt3
134+
''', suffix='.pdf', stdout=-1, rsfflow=0)
135+
136+
# Try fetch
137+
Fetch('Txx.HH','septour')
138+
Result('txx','Txx.HH','wiggle')
139+
Flow('windowed','Txx.HH','window n2=10 min1=0.4 max1=0.8')
140+
plotpar = \
141+
'''
142+
transp=y poly=y yreverse=y pclip=100 nc=100 allpos=n
143+
'''
144+
for plot in ('wiggle','contour','grey'):
145+
Result(plot,'windowed',plot + plotpar)
146+
147+
148+
End()

book/rsf/school2025/school2025.bib

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@Article{Abma05,
2+
author = {R[] Abma and N[] Kabir},
3+
title = {Comparisons of interpolation methods},
4+
journal = {The Leading Edge},
5+
year = 2005,
6+
volume = 24,
7+
pages = {984-989}
8+
}
9+
@Article{Naghizadeh09,
10+
author = {M[ostafa] Naghizadeh and M[auricio] D[] Sacchi},
11+
title = {f-x adaptive seismic-trace interpolation},
12+
journal = {Geophysics},
13+
year = 2009,
14+
volume = 74,
15+
pages = {V9-V16}
16+
}
17+
@Article{m8r,
18+
author = {S. Fomel and P. Sava and I. Vlad and Y. Liu and
19+
V. Bashkardin},
20+
title = {Madagascar: open-source software project for
21+
multidimensional data analysis and reproducible
22+
computational experiments},
23+
journal = {Journal of Open Research Software},
24+
year = 2013,
25+
volume = 1,
26+
number = 1,
27+
pages = {e8},
28+
doi = {http://dx.doi.org/10.5334/jors.ag}
29+
}
30+
31+
@Article{Lee85,
32+
author = {Y[] H[] Lee and S[] A[] Kassam},
33+
title = {Generalized median filtering and related nonlinear filtering techniques},
34+
journal = {IEEE Transactions on Acoustics, Speech, and Signal Processing},
35+
year = 1985,
36+
volume = {ASSP-33},
37+
pages = {672-683}
38+
}
39+
40+
@Article{Wu91,
41+
author = {W[] L[] Wu and A[] Kundu},
42+
title = {New type of modified trimmed mean filter},
43+
journal = {Proceedings of Spie the International Society for Optical Engineering},
44+
year = 1991,
45+
volume = 1451,
46+
pages = {13-23}
47+
}

0 commit comments

Comments
 (0)