-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathget_pgc.pro
More file actions
55 lines (43 loc) · 1.37 KB
/
get_pgc.pro
File metadata and controls
55 lines (43 loc) · 1.37 KB
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
function get_pgc $
, alias_in $
, data_dir = data_dir
;+
;
; Ge the list of PGC numbers corresponding to some set of aliases.
;
;-
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
; GET DATA
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
if n_elements(data_dir) eq 0 then begin
result = routine_info('get_pgc', /function, /source)
progpos = stregex(result.path,'get_pgc.pro')
data_dir = strmid(result.path,0,progpos)+'gal_data/'
endif
restore, data_dir+'superset_alias.idl', /v
n_alias = n_elements(alias_vec)
n = n_elements(alias_in)
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
; GET THE PGC NUMBER
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
pgc_out = lonarr(n)*0L - 1L
sorted_alias = strcompress(strupcase(alias_in), /rem)
sort_ind = sort(sorted_alias)
sorted_alias = sorted_alias[sort_ind]
sorted_pgc = pgc_out[sort_ind]
min_to_check = 0L
for ii = 0L, n-1 do begin
for jj = min_to_check, n_alias-1 do begin
min_to_check = jj
if sorted_alias[ii] eq alias_vec[jj] then begin
sorted_pgc[ii] = pgc_vec[jj]
break
endif
if sorted_alias[ii] lt alias_vec[jj] then begin
break
endif
endfor
endfor
pgc_out[sort_ind] = sorted_pgc
return, pgc_out
end