-
Notifications
You must be signed in to change notification settings - Fork 1
/
ana_all.pro
65 lines (51 loc) · 1.54 KB
/
ana_all.pro
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
; Performs analysis on all the files in the sub-directories of
; a given directory. Tired of running everything by hand.
;
; Hazen 3/00
;
; get directory to analyze from user
dir = "C:\Users\Ha-Myong\Documents\tir data\"
run = "asdf"
print, "name of directories to analyze"
read, run
path = dir + run
print, path
; find all the sub-directories in that directory
foo_dirs = findfile(path + '\*')
nfoo_dirs = size(foo_dirs)
nsub_dirs = 0 ; figure number of sub-directories
for i = 2, nfoo_dirs(1) - 1 do begin
if rstrpos(foo_dirs(i),'\') eq (strlen(foo_dirs(i)) - 1) then begin
nsub_dirs = nsub_dirs + 1
endif
endfor
; print, "found : ", nsub_dirs, " sub-directories, which are :"
sub_dirs = strarr(nsub_dirs)
j = 0
for i = 2, nfoo_dirs(1) - 1 do begin ; get sub-directory names
if rstrpos(foo_dirs(i),'\') eq (strlen(foo_dirs(i)) - 1) then begin
sub_dirs(j) = foo_dirs(i)
j = j + 1
endif
endfor
; now go through sub-directories finding the files to be analyzed and
; analyzing them if necessary.
for i = 0, nsub_dirs - 1 do begin
print, "Current Directory : ", sub_dirs(i)
; find all the *.pma files in the sub-directory
; analyze them if there is no currently existing .pks file
f_to_a = findfile(sub_dirs(i) + '*.pma')
nf_to_a = size(f_to_a)
for j = 0, nf_to_a(1) - 1 do begin
f_to_a(j) = strmid(f_to_a(j), 0, strlen(f_to_a(j)) - 4)
openr, 1, f_to_a(j) + ".pks", ERROR = err
close, 1
if err ne 0 then begin
print, "Working on : ", f_to_a(j)
p_nxgn1_ffp, f_to_a(j)
p_nxgn1_ap, f_to_a(j)
endif
endfor
endfor
print, "Done."
end