-
Notifications
You must be signed in to change notification settings - Fork 2
/
pkhandle
70 lines (60 loc) · 2.01 KB
/
pkhandle
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
; testing PKSYM in 2D, unit Hertz and PPM (using SIMUN)
; create dummy spec and peak pick
dim 2 specw 5283.0 4230. freq 600.13 600.13 600. offset 500. 500.
chsize 512 1k zero unit h
simun 1 1.0 3461 999 2.1 1.5 0. 0.
simun 1 1.0 5000 601 2.1 1.5 0. 0.
sin 0. f12 ft f12 max
minimax 5000 ($max[1]*2)
real f12 peak 0
set a = (abs($pk2d_f1f[1] - 114)<0.01)
set b = (abs($pk2d_f1f[2] - 39)<0.01)
set c = (abs($pk2d_f2f[1] - 453)<0.01)
set d = (abs($pk2d_f2f[2] - 501)<0.01)
set e = (abs($pk2d_a[1] - 9228.83)<1.0)
report ($a & $b & $c & $d & $e) "PEAK in 2D"
pksym 1 1.0
set a = (abs($pk2d_f1f[3] - 232.98 )<0.01)
set b = (abs($pk2d_f2f[3] - 155.804)<0.01)
set c = (abs($pk2d_f1f[4] - 252.196)<0.01)
set d = (abs($pk2d_f2f[4] + 31.536 )<0.01)
report ($a & $b & $c & $d) "PKSYM 2D with option add"
pkselect 1 2 3 0
pksym 0 1.0
set a = ($npk2d == 2)
set b = (abs($pk2d_f1f[1] - 114)<0.01)
set c = (abs($pk2d_f1f[2] - 232.980)<0.01)
report ($a & $b & $c) "PKSELECT - PKSYM 2D with option remove"
pkwrite /tmp/pkhandle_test.file
pkclear
report ($npk2d == 0) "PKCLEAR"
pkread /tmp/pkhandle_test.file yes
set a = ($npk2d == 2)
pkclear
transpose peak 0
pkread /tmp/pkhandle_test.file no
set b = (abs($pk2d_f1f[1] - 501)<0.01)
set c = (abs($pk2d_f1f[4] - 453.03)<0.01)
report ($a & $npk2d == 4 & $b & $c ) "PKWRITE and PKREAD"
sh "/bin/rm /tmp/pkhandle_test.file"
; testing PKPROJ in 2D, unit Hertz (using SIMUN)
dim 2 specw 5283.0 4230. freq 600.13 600.13 600. offset 500. 500.
chsize 512 1k zero unit h
simun 1 1.0 3461 999 2.1 1.5 0. 0.
simun 1 1.0 5000 601 2.1 1.5 0. 0.
sin 0. f12 ft f12 max
minimax 5000 ($max[1]*2)
real f12 peak 0
dim 1 specw 5283.0 freq 600.13 600. offset 500. chsize 256 dim 2
pkproj f2 s 1.0
set c = (abs($pk1d_f[1] - 114)<0.01)
set d = (abs($pk1d_f[2] - 39)<0.01)
report ($c & $d) "PKPROJ 2D along F2"
dim 1 specw 4230.0 freq 600.13 600. offset 500. chsize 512 dim 2
pkproj f1 s 1.0
set a = (abs($pk1d_f[1] - 453)<0.01)
set b = (abs($pk1d_f[2] - 501)<0.01)
report ($a & $b) "PKPROJ 2D along F1"
dim 1 pkclear
dim 2 pkclear
quit