deliangwang的个人博客分享 http://blog.sciencenet.cn/u/deliangwang

博文

用相对星等计算绝对星等(IDL程序)

已有 4161 次阅读 2013-2-2 19:39 |个人分类:编程笔记|系统分类:科研笔记| 程序, result, relative, absolute

Function absmag, mag, z, extinction=extinction, powindex=powindex, $
                 h0=h0, k=k, Omega_M=Omega_M, Lambda0=Lambda0, q0=q0, $
                 Silent = silent

;+
;NAME:
;     absmag
;PURPOSE:
;     Calculate the absolute magitude from the relative magitude
;CALLING SEQUENCE:
;     result=absmag(mag,z)
;INPUT:
;     mag ---  the relative magitude
;     z   ---  redshift
;OPTIONAL KEYWORD INPUT:
;     H0  ---  Hubble parameter  in km/s/Mpc, default is 70
;     k   ---  curvature constant, normalized to the closure density.
;              Default is 0, indicating a flat universe
;     Omega_m ---  Matter density, normalized to the closure density, 
;                  default is 0.3.   Must be non-negative
;     Lambda0 ---  Cosmological constant, normalized to the closure
;                  density,default is 0.7
;     q0      ---  Deceleration parameter, 
;                  numeric scalar = -R*(R'')/(R')^2,
;                  default is -0.55
;
;OUTPUT:
;     absmag  ---  the absolute magitude
;PROCESS:
;    lumindist(),  alog10()
;REVISION HISTORY:
;    Original by DL.Wang,Jul-26-2007
;-

     if not keyword_set(extinction) then extinction=0.0
     if not keyword_set(powindex) then powindex=1.0

     cosmo_param,Omega_m,Lambda0,k,q0

     if N_elements(H0) EQ 0 then H0 = 70

     if not keyword_set(silent) then $
     print,'LUMDIST: H0:', h0, ' Omega_m:', omega_m, ' Lambda0',lambda0, $
        ' q0: ',q0, ' k: ', k, f='(A,I3,A,f5.2,A,f5.2,A,f5.2,A,F5.2)' 

     Kcorrection=2.5D0*(-1.0D0-powindex)*alog10(1.0D0+z)

     dL=lumdist(z,h0=h0,k=k,Omega_M=Omega_M,Lambda0=Lambda0,q0=q0)

     absmag=mag-extinction-Kcorrection-5.0D0*alog10(dL)-25.0

     return, absmag

End



https://blog.sciencenet.cn/blog-456360-658874.html

上一篇:图解钱穆先生的《中国历代政治得失》(二)
下一篇:能谱指数相互转化(IDL程序)
收藏 IP: 123.86.145.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-27 11:07

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部