psm_convert_mk2mjy.pro 1.5 KB
pro psm_convert_mk2mjy,lam,sig_mk,sig_mjy,rj=rj,cmb_th=cmb_th
; Copyright 2007 IAS

; This file is part of the Planck Sky Model. 
;
; Only the name has been changed for DustEMWrap distribution to avoid conflicts
;
; The Planck Sky Model is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; version 2 of the License.
;
; The Planck Sky Model is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY, without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with the Planck Sky Model. If not, write to the Free Software
; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

;+
;  Convert mK, either thermodynamic or Rayleigh-Jeans in MJy/sr
;
;
;  @param lam {in}{required}{type=float} wavelength in micron
;  @keyword sig_mK{in}{required}{type=float} signal in mK
;  @keyword sig_Mjy{in}{optional}{type=float} ...
;  @keyword RJ{in}{optional}{type=boolean} ...
;  @keyword CMB_TH{in}{optional}{type=boolean} ...
;
;  @history <p> Written Guilaine Lagache, 2001</p>
;-

  k=1.3806503e-23

  if keyword_set(rj) then $
     sig_mjy = sig_mk*1.e-3*2*k*1.e20/((lam*1.e-6)^2.)

  if keyword_set(cmb_th) then begin
     pvals=psm_planck_function(2.726,lam,dbdt,/mjy)
     sig_mjy=sig_mk*dbdt*1.e-3
  end

the_end:
end