My IDL program

来自Shiyin's note
跳到导航 跳到搜索

天文

  • spherematch_kth
两个样本之间找到天球上第k个靠近的 文件:Spherematch kth.pro

函数

Sch_LF

  • Schechter function,微分和数值积分


Gauss_fun

  • 高斯分布函数
  • 有内禀的Gauss_pdf,Gauss_cvf,Gaussint等程序


SDSS

统计相关

小程序

  • conf_lev: 用于计算Chi^2分布中的置信区间。

binxy

  • 将x,y分bin(x上),然后显示每个bin里面的平均(或者median)的x和y的数值


subsample

a=randomn(seed,1000)
b=randomn(seed,1000)-0.5
subsample,a,b,suba,subb,0.02,count=NS,KS=ks
sdssidl_plothist,a,bin=0.2
sdssidl_plothist,b,bin=0.2,linestyle=1,/overplot
sdssidl_plothist,a[suba],bin=0.2,linestyle=1,color=cgcolor('red'),/overplot
sdssidl_plothist,b[subb],bin=0.2,linestyle=1,color=cgcolor('blue'),/overplot

文件读写

read_txt

我自己写了一个read_txt文件:Read txt.pro.txt程序,可以智能的将一个N行M列的数据文件(空格分隔)读为一个data[N,M]的flota array。

read_col

  • 读一个ascii文件的指定列。
例:读入filename文件的第2列,格式是双精度
arr=read_col('filename',2,type='dbl')
  • 文件要求空格做分隔符
  • 列的计数从1开始
  • 关键词type的默认是字符格式

my_read_csv

对read_csv程序的修改,用来读取CSV文件,可以实现header命名Tag的功能

画图

aitoff2和aitoff_grid2

  • astro_lib中的atioff,atioff_grid可以实现天球投影,中心在0。通过修改使得X坐标从0,360投影。