-
Notifications
You must be signed in to change notification settings - Fork 1
/
mag2fluxjy.pro
43 lines (32 loc) · 875 Bytes
/
mag2fluxjy.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
FUNCTION mag2fluxjy, bands, mags
;band 1 =J
;band2 = H
;band3 = K_S
;RETURNS FLUX IN mJy
; All based on Appendix of Spitzer Observer's Manual
; Checked with online calculator:
; http://ssc.spitzer.caltech.edu/tools/magtojy/
;written April, 2007
IF N_params() lt 1 then begin
print,'Syntax - J_jy=MAG2FLUXJY([bands], [magnitudes])'
print,' Returns flux in mJy'
print,' bands:'
print,' J=1'
print,' H=2'
print,' K_S=3'
return,0
ENDIF
;zero points from Appendix A of Spitzer Cookbook and
;http://www.ipac.caltech.edu/2mass/releases/allsky/doc/sec6_4a.html
;CASE band OF
; 1: zpt_jy=1594
; 2: zpt_jy=1024
; 3: zpt_jy=666.7
;ENDCASE
zpt_jy=[1594,1024,666.7]
zpts=zpt_jy[bands-1]
flux=zpts * 10^(-mags/2.5) ; in Jy
;see Appendix of Spitzer Observer's Manual
;print, flux*1e3
return,flux*1e3 ; return flux in mJy
END