-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild_phangs_overrides.pro
More file actions
209 lines (157 loc) · 5.23 KB
/
build_phangs_overrides.pro
File metadata and controls
209 lines (157 loc) · 5.23 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
pro build_phangs_overrides
;
; Translate the official PHANGS orientations into an override file.
;
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
; READ THE SAMPLE TABLE
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
infile = '~/projects/phangs_sample/export/phangs_sample_table_v1p5.fits'
tab = mrdfits(infile, 1, tab_hdr)
n_tab = n_elements(tab)
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
; PRINT THE CENTERS
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
outfile = 'gal_data/override_phangs_centers.txt'
get_lun, lun
openw, lun, outfile
printf, lun, '# This is a procedurally generated file.'
printf, lun, '# Editing not recommended.'
printf, lun, '# Column 1: galaxy'
printf, lun, '# Column 2: field'
printf, lun, '# Column 3: value'
for ii = 0, n_tab-1 do begin
printf, lun, '#'
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'ra_deg'+' '
line += string(tab[ii].orient_ra, format='(F11.6)')
printf, lun, line
printf, lun, '#'
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'dec_deg'+' '
line += string(tab[ii].orient_dec, format='(F11.6)')
printf, lun, line
endfor
close, lun
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
; NOW PRINT THE ORIENTATIONS
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
outfile = 'gal_data/override_phangs_orient.txt'
helio2lsr, vhel_kms, tab.orient_vlsr $
, ra = tab.orient_ra $
, dec = tab.orient_dec $
, /reverse
get_lun, lun
openw, lun, outfile
printf, lun, '# This is a procedurally generated file.'
printf, lun, '# Editing not recommended.'
printf, lun, '# Column 1: galaxy'
printf, lun, '# Column 2: field'
printf, lun, '# Column 3: value'
for ii = 0, n_tab-1 do begin
printf, lun, '#'
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'incl_deg'+' '
line += string(tab[ii].orient_incl, format='(F5.1)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'e_incl'+' '
line += string(tab[ii].orient_incl_unc, format='(F5.1)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'ref_incl'+' '
line += tab[ii].orient_ref
printf, lun, line
printf, lun, '#'
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'posang_deg'+' '
line += string(tab[ii].orient_posang, format='(F5.1)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'e_posang'+' '
line += string(tab[ii].orient_posang_unc, format='(F5.1)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'ref_posang'+' '
line += tab[ii].orient_ref
printf, lun, line
printf, lun, '#'
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'vhel_kms'+' '
line += string(vhel_kms[ii], format='(F6.1)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'e_vhel'+' '
line += string(tab[ii].orient_vlsr_unc, format='(F6.1)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'ref_vhel'+' '
line += tab[ii].orient_vlsr_ref
printf, lun, line
endfor
close, lun
spawn, 'cat '+outfile
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
; PRINT THE DISTANCES
; &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
outfile = 'gal_data/override_phangs_dist.txt'
get_lun, lun
openw, lun, outfile
printf, lun, '# This is a procedurally generated file.'
printf, lun, '# Editing not recommended.'
printf, lun, '# Column 1: galaxy'
printf, lun, '# Column 2: field'
printf, lun, '# Column 3: value'
for ii = 0, n_tab-1 do begin
if finite(tab[ii].dist) eq 0 then $
continue
printf, lun, '#'
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'dist_mpc'+' '
line += string(tab[ii].dist, format='(F6.2)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'e_dist_dex'+' '
line += string(tab[ii].dist_unc, format='(F5.3)')
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'dist_code'+' '
this_dist_code = '4'
if strcompress(tab[ii].dist_label,/rem) eq 'TRGB' then $
this_dist_code = '1'
if strcompress(tab[ii].dist_label,/rem) eq 'Cepheid' then $
this_dist_code = '2'
if strcompress(tab[ii].dist_label,/rem) eq 'SBF' then $
this_dist_code = '2'
if strcompress(tab[ii].dist_label,/rem) eq 'TF' then $
this_dist_code = '3'
if strcompress(tab[ii].dist_label,/rem) eq 'Group' then $
this_dist_code = '3'
if tab[ii].dist_label eq 'TRGB' then $
this_dist_code = '1'
line += this_dist_code
printf, lun, line
line = ''
line += strcompress(tab[ii].name,/rem)+' '
line += 'ref_dist'+' '
line += tab[ii].dist_ref
printf, lun, line
printf, lun, '#'
endfor
close, lun
spawn, 'cat '+outfile
stop
end