-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpgc_to_othername.pro
More file actions
54 lines (42 loc) · 1.22 KB
/
pgc_to_othername.pro
File metadata and controls
54 lines (42 loc) · 1.22 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
function pgc_to_othername $
, pgc_in $
, prefix=prefix $
, data_dir = data_dir
;+
;
; Get other names given some prefix and a PGC number.
;
;-
if n_elements(prefix) eq 0 then $
prefix = 'NGC'
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
; GET DATA
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
if n_elements(data_dir) eq 0 then begin
result = routine_info('pgc_to_othername', /function, /source)
progpos = stregex(result.path,'pgc_to_othername.pro')
data_dir = strmid(result.path,0,progpos)+'gal_data/'
endif
restore, data_dir+'superset_alias.idl', /v
n_pgc_in = n_elements(pgc_in)
nameout = strarr(n_pgc_in)
for ii = 0, n_pgc_in-1 do begin
pgc_ind = where(pgc_vec eq pgc_in[ii], pgc_ct)
if pgc_ct eq 0 then continue
this_name = ''
first = 1B
for jj = 0, pgc_ct-1 do begin
this_alias = alias_vec[pgc_ind[jj]]
if strpos(this_alias, prefix) ne 0 then $
continue
if first then begin
first = 0B
endif else begin
this_name += ';'
endelse
this_name += this_alias
endfor
nameout[ii] = this_name
endfor
return, nameout
end