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

博文

计算光谱的4000埃break(IDL程序)

已有 3856 次阅读 2013-2-3 00:26 |个人分类:编程笔记|系统分类:科研笔记| wave, result, frame, 4000

Function dn4000a,wave,flux,select=select

;+
;NAME:
;     dn4000a
;PURPOSE:
;     compute 4000A break
;CALLING SEQUENCE:
;     result=dn4000a(wave,flux,select=select)
;INPUT:
;     wave --- rest frame wavelength in Unit:A
;     flux --- flux
;OUTPUT:
;     dn_4000 --- 4000A break
;REVISION HISTORY:
;     Original by DL.Wang,Dec-05-2007
;-

if not keyword_set(select) then begin
   print,'wavelength limit select:'
   print,'--------------------------------------------'
   print,'    1: Bruzual 1983'
   print,'    2: Balogh 1999'
   print,'--------------------------------------------'
   read,select
endif

case select of
   1:wavelimit=[3750.0, 3950.0, 4050.0, 4250.0]
   2:wavelimit=[3850.0, 3950.0, 4000.0, 4100.0]
endcase

wave_blue=where(wave ge wavelimit[0] and wave le wavelimit[1],blue)
wave_red=where(wave ge wavelimit[2] and wave le wavelimit[3],red)
if blue gt 0 and red gt 0 then begin
   flux_blue=int_tabulated(wave[wave_blue],flux[wave_blue]*wave[wave_blue]*wave[wave_blue])
   flux_blue_mean=flux_blue/(wavelimit[1]-wavelimit[0])

   flux_red=int_tabulated(wave[wave_red],flux[wave_red]*wave[wave_red]*wave[wave_red])
   flux_red_mean=flux_red/(wavelimit[3]-wavelimit[2])

   dn_4000=flux_red_mean/flux_blue_mean
endif else begin
   dn_4000=-999.9
endelse

return,dn_4000

End



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

上一篇:计算BPT图上的y轴偏离角(IDL程序)
下一篇:Linux系统下处理Chandra卫星的X射线数据ACIS(IDL程序)
收藏 IP: 123.86.145.*| 热度|

0

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

数据加载中...

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

GMT+8, 2024-11-23 18:54

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部