Blame view

LabTools/IRAP/AH/phangs_get_galaxy_distance.pro 708 Bytes
b32e9e6d   Annie Hughes   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function phangs_get_galaxy_distance,galaxy,file=file
  use_file=!dustem_wrap_soft_dir+'LabTools/IRAP/AH/phangs_sample_table_v1p6.fits'
  if keyword_set(file) then use_file=file
  ngals_in=n_elements(galaxy)
  str=phangs_read_sample_table(file=use_file)
  match,strtrim(strupcase(galaxy),2), strtrim(strupcase(str.name),2),inidx,galidx,count=found
  if found eq 0 and ngals_in eq 1 then begin
     message,'Galaxy: '+galaxy+' not found.',/info
     stop
  end
  if found eq 0 and ngals_in gt 1 then begin
     message,'No galaxies found.',/info
     stop
  end
  one_str={name:'',dist:-1.}
  dstr=replicate(one_str,found)
  dstr.name=str[galidx].name
  dstr.dist=str[galidx].dist
  return,dstr
  the_end:
end