-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathresample_spectra.class
50 lines (42 loc) · 1.12 KB
/
resample_spectra.class
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
! 1. To resample a list of spectra using the first spectrum as the template
! 2. To resample a list of spectra with user-defined parameters
! Done: First preliminary prototype code
! USAGE: rsp yes
! rsp no 100 50 0 2.5
!
! TODO: user defined output
! -- pre-request:
! -- All spectra should be found
!
! written by Zhiyu Zhang
! pmozhang@gmail.com
! last update 15 Nov. 2018
define char*50 resample_logic
define double N I0 V0 Dv F0 N_out I0_out V0_out Dv_out
sic dele resampled.30m
file out resampled.30m m
say "USE the first spectrum in the list as the template? [Y/N]"
let resample_logic &1
get f
if (resample_logic.eq."Y").or.(resample_logic.eq."y").or.(resample_logic.eq."YES").or.(resample_logic.eq."yes") then
let N channels
let I0 reference
let V0 velocity
let Dv velo_step
let F0 frequency
else
let F0 frequency
Say "Please input your own configurations (in velocity) [N I0 V0 Dv]"
let N &2
let I0 &3
let V0 &4
let Dv &5
endif
for i 1 to found
get idx%num[i]
modify frequency F0
resample N I0 v0 Dv velocity
write i
next
file in resampled.30m
find