-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_table.pro
67 lines (52 loc) · 3.12 KB
/
make_table.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
66
67
pro make_table
file = 'webbcal_spitzer_ave_phot_all_rad3_sky10_20.dat'
readcol,file,format='(A15,A6,F8.2,F8.2,F10.2,F10.2,F10.2,F10.2,F8.2,I6)', $
name,band,xpos,ypos,flux,flux_unc,sky,sky_unc,sn,num_images
openw,unit1,'webbcal_spitzer_phot.tex',/get_lun
sindxs = sort(name)
uindxs = uniq(name[sindxs])
n_uniq = n_elements(uindxs)
for i = 0,(n_uniq-1) do begin
k = sindxs[uindxs[i]]
indxs = where(name[k] EQ name,n_indxs)
printf,unit1,format='(A12,$)',name[k] + ' &'
bindx = where(band[indxs] EQ 'IRAC1',n_bindxs)
if (n_bindxs EQ 1) then begin
printf,unit1,format='(A,$)',string(flux[indxs[bindx[0]]],format='(E10.2)') + ' &'
printf,unit1,format='(A,$)',string(flux_unc[indxs[bindx[0]]],format='(E10.2)') + ' &'
; printf,unit1,format='(A,$)',string(num_images[indxs[bindx[0]]],format='(I4)') + ' &'
endif else printf,unit1,format='(A,$)',' \nodata & \nodata &'
bindx = where(band[indxs] EQ 'IRAC2',n_bindxs)
if (n_bindxs EQ 1) then begin
printf,unit1,format='(A,$)',string(flux[indxs[bindx[0]]],format='(E10.2)') + ' &'
printf,unit1,format='(A,$)',string(flux_unc[indxs[bindx[0]]],format='(E10.2)') + ' &'
; printf,unit1,format='(A,$)',string(num_images[indxs[bindx[0]]],format='(I4)') + ' &'
endif else printf,unit1,format='(A,$)',' \nodata & \nodata &'
bindx = where(band[indxs] EQ 'IRAC3',n_bindxs)
if (n_bindxs EQ 1) then begin
printf,unit1,format='(A,$)',string(flux[indxs[bindx[0]]],format='(E10.2)') + ' &'
printf,unit1,format='(A,$)',string(flux_unc[indxs[bindx[0]]],format='(E10.2)') + ' &'
; printf,unit1,format='(A,$)',string(num_images[indxs[bindx[0]]],format='(I4)') + ' &'
endif else printf,unit1,format='(A,$)',' \nodata & \nodata &'
bindx = where(band[indxs] EQ 'IRAC4',n_bindxs)
if (n_bindxs EQ 1) then begin
printf,unit1,format='(A,$)',string(flux[indxs[bindx[0]]],format='(E10.2)') + ' &'
printf,unit1,format='(A,$)',string(flux_unc[indxs[bindx[0]]],format='(E10.2)') + ' &'
; printf,unit1,format='(A,$)',string(num_images[indxs[bindx[0]]],format='(I4)') + ' &'
endif else printf,unit1,format='(A,$)',' \nodata & \nodata &'
bindx = where(band[indxs] EQ 'IRSB',n_bindxs)
if (n_bindxs EQ 1) then begin
printf,unit1,format='(A,$)',string(flux[indxs[bindx[0]]],format='(E10.2)') + ' &'
printf,unit1,format='(A,$)',string(flux_unc[indxs[bindx[0]]],format='(E10.2)') + ' &'
; printf,unit1,format='(A,$)',string(num_images[indxs[bindx[0]]],format='(I4)') + ' &'
endif else printf,unit1,format='(A,$)',' \nodata & \nodata &'
; endif else printf,unit1,format='(A,$)',' \nodata & \nodata & \nodata &'
bindx = where(band[indxs] EQ 'MIPS1',n_bindxs)
if (n_bindxs EQ 1) then begin
printf,unit1,format='(A,$)',string(flux[indxs[bindx[0]]],format='(E10.2)') + ' &'
printf,unit1,format='(A)',string(flux_unc[indxs[bindx[0]]],format='(E10.2)') + ' \\'
; printf,unit1,format='(A)',string(num_images[indxs[bindx[0]]],format='(I4)') + ' \\'
endif else printf,unit1,format='(A)',' \nodata & \nodata \\'
endfor
free_lun,unit1
end