IRAF

 

  

. 做數據處理的基本流程

- Dark current -

照相之前, 要先照一張曝光時間等長的暗電流照片, ,例如要拍五分鐘的目標, 則先拍好一張五分鐘的暗電流影像, 然後數據處理時把暗電流減掉, 用的運算是

- Flat -

平場的校正要找均勻的光源來照相, 若每個畫素的感光能力一樣, 則照出來應該也是均勻影像, 但事實上照出來並不均勻, 照出來的不均勻代表的是每個畫素的感光能力之比(ratio), 所以數據處理時要除這張平場, 用的運算是

- Bias -

這是CCD的元件特性 偏壓(bias), CCD感光時, 感光時間越長, 每個畫素的讀數越大, 那麼倒推回去, 感光時間越短, 則讀數越小., 然後感光時間為零, 則讀數也應該是零, 因為沒有感光嘛

但以上是理論, 實際上的CCD即使在曝光時間為零的情況下仍有讀數, 這是因為CCD的每個畫素就像是一個位能井, 這些位能井想抓住光子, 自己也必須先有一個小小的偏壓, 此偏壓在沒有光子的情況下仍會存在, 並且變成電子訊號, 因此我們也要記得減掉這部分的數值

 

IRAF基本功

環境設定

在有安裝IRAF的電腦下, 先鍵入指令mkiraf

astro21~$mkiraf [Enter]

IRAF就會先建立一個你個人的log, 此外會詢問你的的終端機型態, 例如xgterm, 這要依照你常用的終端機程式去設定, 不知道我在說什麼的請打xgterm

log檔案的的名稱是login.cl, 典型的 login.cl如下

# LOGIN.CL -- User login file for the IRAF command language.

# Identify login.cl version (checked in images.cl).

if (defpar ("logver"))

    logver = "IRAF V2.12.2 January 2004"

set     home            = "/home/hank/"

set     imdir           = "/d0/imdirs/hank/"

set     uparm           = "home$uparm/"

set     userid          = "hank"

現在要先修改一些設定, IRAF才能順利啟動,

1.home的部分請改成你自己喜好的目錄, imdir也是, 改成你喜歡的, 但是自己要記得放在哪裡, 那是IRAFpixel檔案的地方.

2.跳到大約27行左右, 有個stdimage = im800, 這個im800是預設值, 意思是I RAF秀出影像時的邊界, 請把它調大, 不然你最大只能看 800*800的影像, 調多大? 看你要處理的對象囉

 改完這三個基本上就OK, 其他的參數看得懂的可以自己調整

 

初步使用

然後就可以準備使用IRAF, 請鍵入指令cl

astro21~$cl

接著就會進IRAF主要介面,

     NOAO PC-IRAF Revision 2.12.2-EXPORT Sun Jan 25 16:09:03 MST 2004

    This is the EXPORT version of PC-IRAF V2.12 supporting most PC systems.

    Welcome to IRAF.  To list the available commands, type ? or ??.  To get

    detailed information about a command, type `help command'.   To  run  a

    command  or  load  a  package,  type  its name.   Type  `bye' to exit a

    package, or `logout' to get out of the CL.   Type `news'  to  find  out

    what is new in the version of the system you are using.   The following

    commands or packages are currently defined:

                                                                               

      dataio.     images.     noao.       proto.      utilities.

      dbms.      language.   obsolete.   softools.

      guiapps.    lists.      plot.       system.

cl>_

 

現在….請注意歡迎畫面下方這些選項包括images noao等等的選項, 這些是IRAF功能的分類選項, IRAF的各種功能被歸納為好幾大類

 

images這個分類為例, images分類下面還有好多個子分類, imfilter.  imgeom. imutil. 等等每個分類的名稱後面都會加上一個英文的句點”.”, 子分類imutil下面則有眾多功能chpixtype imdelete imheader imslice listpixels…等等, 而這些功能的名稱後面就沒有句點了

 

想進入分類就是鍵入那個分類的名稱, 離開那個分類請用指令bye

cl>images[Enter] -> 進入images這個分類

im>bye [Enter] -> 跳出分類

 

想要使用某個功能, 最基本是鍵入該功能的名稱例如chpixtype, 但這往往不夠, 因為我們經常要自行調整很多參數, 所以請進入指令epar chpixtype, IRAF會出現細部選項供調整

im> epar chpixtype [Enter]

                                   I R A F

                    Image Reduction and Analysis Facility

PACKAGE = imutil

   TASK = chpixtype

 

input   =  _                    Input images

output  =                       Output images

newpixty=                       Output pixel type

(oldpixt=                  all) Input pixel type

(verbose=                  yes) Verbose mode

(mode   =                   ql)

                                                             ESC-? for HELP

 

一開始的游標會停在最上格, 在這個例子裡就是停在input = 的位置, 現在請依序輸入你的參數後按下Enter, 游標就會不斷的向下移動, 直到所有參數都輸入, 接著請鍵入冒號, 沒錯Shift+分號, 螢幕左下方將出現一個小冒號, 這時候請鍵入指令go, 大功告成!!

:go [Enter]

 

也可以放棄, 指令是q

:q [Enter]

 

離開IRAF請在最上層的分類中鍵入logout

cl>logout

 

這是基本的介面操作

 

三、 IRAF做Data Reduction 範例

 

noao.imred.ccdred
cc> epar zerocombine

                                  I R A F
                   Image Reduction and Analysis Facility
PACKAGE = ccdred
  TASK = zerocombine

input   =                @bias  List of zero level images to combine
(output =            Bias.fits) Output zero level name
(combine=              average) Type of combine operation
(reject =               minmax) Type of rejection
(ccdtype=                 zero) CCD image type to combine
(process=                  yes) Process images before combining?
(delete =                   no) Delete input images after combining?
(clobber=                   no) Clobber existing output image?
(scale  =                 none) Image scaling
(statsec=                     ) Image section for computing statistics
(nlow   =                    0) minmax: Number of low pixels to reject
(nhigh  =                    1) minmax: Number of high pixels to reject
(nkeep  =                    1) Minimum to keep (pos) or maximum to reject (neg)
(mclip  =                  yes) Use median in sigma clipping algorithms?
(lsigma =                   3.) Lower sigma clipping factor
(hsigma =                   3.) Upper sigma clipping factor
(rdnoise=                   0.) ccdclip: CCD readout noise (electrons)
(gain   =                   1.) ccdclip: CCD gain (electrons/DN)
(snoise =                   0.) ccdclip: Sensitivity noise (fraction)
(pclip  =                 -0.5) pclip: Percentile clipping parameter
(blank  =                   0.) Value if there are no pixels
(mode   =                   ql)
:wq

cc> epar ccdproc
                                  I R A F
                   Image Reduction and Analysis Facility
PACKAGE = ccdred
  TASK = ccdproc

images  =                @bias  List of CCD images to correct
(output =            Bias.fits) List of output CCD images
(ccdtype=                     ) CCD image type to correct
(max_cac=                    0) Maximum image caching memory (in Mbytes)
(noproc =                   no) List processing steps only?

(fixpix =                   no) Fix bad CCD lines and columns?
(oversca=                   no) Apply overscan strip correction?
(trim   =                   no) Trim the image?
(zerocor=                   no) Apply zero level correction?
(darkcor=                   no) Apply dark count correction?
(flatcor=                   no) Apply flat field correction?
(illumco=                   no) Apply illumination correction?
(fringec=                   no) Apply fringe correction?
(readcor=                   no) Convert zero level image to readout correction?
(scancor=                   no) Convert flat field image to scan correction?

(readaxi=                 line) Read out axis (column|line)
(fixfile=                     ) File describing the bad lines and columns
(biassec=                     ) Overscan strip image section
(trimsec=                     ) Trim data section
(zero   =                     ) Zero level calibration image
(dark   =                     ) Dark count calibration image
(flat   =                     ) Flat field images
(illum  =                     ) Illumination correction images
(fringe =                     ) Fringe correction images
(minrepl=                   1.) Minimum flat field value
(scantyp=            shortscan) Scan type (shortscan|longscan)
(nscan  =                    1) Number of short scan lines

(interac=                   no) Fit overscan interactively?
(functio=             legendre) Fitting function
(order  =                    1) Number of polynomial terms or spline pieces
(sample =                    *) Sample points to fit
(naverag=                    1) Number of sample points to combine
(niterat=                    1) Number of rejection iterations
(low_rej=                   3.) Low sigma rejection factor
(high_re=                   3.) High sigma rejection factor
(grow   =                   0.) Rejection growing radius
(mode   =                   ql)
:wq

cc> zerocombine

cc> epar darkcombine

                                  I R A F
                  Image Reduction and Analysis Facility
PACKAGE = ccdred
 TASK = darkcombine

input   =                @dark  List of dark images to combine
(output =            Dark.fits) Output dark image root name
(combine=              average) Type of combine operation
(reject =               minmax) Type of rejection
(ccdtype=                 dark) CCD image type to combine
(process=                  yes) Process images before combining?
(delete =                   no) Delete input images after combining?
(clobber=                   no) Clobber existing output image?
(scale  =             exposure) Image scaling
(statsec=                     ) Image section for computing statistics
(nlow   =                    0) minmax: Number of low pixels to reject
(nhigh  =                    1) minmax: Number of high pixels to reject
(nkeep  =                    1) Minimum to keep (pos) or maximum to reject (neg)
(mclip  =                  yes) Use median in sigma clipping algorithms?
(lsigma =                   3.) Lower sigma clipping factor
(hsigma =                   3.) Upper sigma clipping factor
(rdnoise=                   0.) ccdclip: CCD readout noise (electrons)
(gain   =                   1.) ccdclip: CCD gain (electrons/DN)
(snoise =                   0.) ccdclip: Sensitivity noise (fraction)
(pclip  =                 -0.5) pclip: Percentile clipping parameter
(blank  =                   0.) Value if there are no pixels
(mode   =                   ql)
:wq

cc> epar ccdproc
                                 I R A F
                  Image Reduction and Analysis Facility
PACKAGE = ccdred
 TASK = ccdproc

images  =                @dark  List of CCD images to correct
(output =            Dark.fits) List of output CCD images
(ccdtype=                     ) CCD image type to correct
(max_cac=                    0) Maximum image caching memory (in Mbytes)
(noproc =                   no) List processing steps only?

(fixpix =                   no) Fix bad CCD lines and columns?
(oversca=                   no) Apply overscan strip correction?
(trim   =                   no) Trim the image?
(zerocor=                  yes) Apply zero level correction?
(darkcor=                   no) Apply dark count correction?
(flatcor=                   no) Apply flat field correction?
(illumco=                   no) Apply illumination correction?
(fringec=                   no) Apply fringe correction?
(readcor=                   no) Convert zero level image to readout correction?
(scancor=                   no) Convert flat field image to scan correction?

(readaxi=                 line) Read out axis (column|line)
(fixfile=                     ) File describing the bad lines and columns
(biassec=                     ) Overscan strip image section
(trimsec=                     ) Trim data section
(zero   =            Bias.fits) Zero level calibration image
(dark   =                     ) Dark count calibration image
(flat   =                     ) Flat field images
(illum  =                     ) Illumination correction images
(fringe =                     ) Fringe correction images
(minrepl=                   1.) Minimum flat field value
(scantyp=            shortscan) Scan type (shortscan|longscan)
(nscan  =                    1) Number of short scan lines

(interac=                   no) Fit overscan interactively?
(functio=             legendre) Fitting function
(order  =                    1) Number of polynomial terms or spline pieces
(sample =                    *) Sample points to fit
(naverag=                    1) Number of sample points to combine
(niterat=                    1) Number of rejection iterations
(low_rej=                   3.) Low sigma rejection factor
(high_re=                   3.) High sigma rejection factor
(grow   =                   0.) Rejection growing radius
(mode   =                   ql)
:wq

cc> darkcombine

cc> epar flatcombine

                                  I R A F
                   Image Reduction and Analysis Facility
PACKAGE = ccdred
  TASK = flatcombine

input   =                @flat  List of flat field images to combine
(output =            Flat.fits) Output flat field root name
(combine=               median) Type of combine operation
(reject =            avsigclip) Type of rejection
(ccdtype=                     ) CCD image type to combine
(process=                  yes) Process images before combining?
(subsets=                   no) Combine images by subset parameter?
(delete =                   no) Delete input images after combining?
(clobber=                   no) Clobber existing output image?
(scale  =                 mode) Image scaling
(statsec=                     ) Image section for computing statistics
(nlow   =                    1) minmax: Number of low pixels to reject
(nhigh  =                    1) minmax: Number of high pixels to reject
(nkeep  =                    1) Minimum to keep (pos) or maximum to reject (neg)
(mclip  =                  yes) Use median in sigma clipping algorithms?
(lsigma =                   3.) Lower sigma clipping factor
(hsigma =                   3.) Upper sigma clipping factor
(rdnoise=                   0.) ccdclip: CCD readout noise (electrons)
(gain   =                   1.) ccdclip: CCD gain (electrons/DN)
(snoise =                   0.) ccdclip: Sensitivity noise (fraction)
(pclip  =                 -0.5) pclip: Percentile clipping parameter
(blank  =                   1.) Value if there are no pixels
(mode   =                   ql)
:wq

cc> epar ccdproc

                                  I R A F
                   Image Reduction and Analysis Facility
PACKAGE = ccdred
  TASK = ccdproc

images  =                @flat  List of CCD images to correct
(output =                 Flat) List of output CCD images
(ccdtype=                     ) CCD image type to correct
(max_cac=                    0) Maximum image caching memory (in Mbytes)
(noproc =                   no) List processing steps only?

(fixpix =                   no) Fix bad CCD lines and columns?
(oversca=                   no) Apply overscan strip correction?
(trim   =                   no) Trim the image?
(zerocor=                  yes) Apply zero level correction?
(darkcor=                  yes) Apply dark count correction?
(flatcor=                   no) Apply flat field correction?
(illumco=                   no) Apply illumination correction?
(fringec=                   no) Apply fringe correction?
(readcor=                   no) Convert zero level image to readout correction?
(scancor=                   no) Convert flat field image to scan correction?

(readaxi=                 line) Read out axis (column|line)
(fixfile=                     ) File describing the bad lines and columns
(biassec=                     ) Overscan strip image section
(trimsec=                     ) Trim data section
(zero   =            Bias.fits) Zero level calibration image
(dark   =            Dark.fits) Dark count calibration image
(flat   =                     ) Flat field images
(illum  =                     ) Illumination correction images
(fringe =                     ) Fringe correction images
(minrepl=                   1.) Minimum flat field value
(scantyp=            shortscan) Scan type (shortscan|longscan)
(nscan  =                    1) Number of short scan lines

(interac=                   no) Fit overscan interactively?
(functio=             legendre) Fitting function
(order  =                    1) Number of polynomial terms or spline pieces
(sample =                    *) Sample points to fit
(naverag=                    1) Number of sample points to combine
(niterat=                    1) Number of rejection iterations
(low_rej=                   3.) Low sigma rejection factor
(high_re=                   3.) High sigma rejection factor
(grow   =                   0.) Rejection growing radius
(mode   =                   ql)
:wq

cc> flatcombine

cc> epar ccdproc

                                  I R A F
                   Image Reduction and Analysis Facility
PACKAGE = ccdred
  TASK = ccdproc

images  =              @source  List of CCD images to correct
(output =               @final) List of output CCD images
(ccdtype=                     ) CCD image type to correct
(max_cac=                    0) Maximum image caching memory (in Mbytes)
(noproc =                   no) List processing steps only?

(fixpix =                   no) Fix bad CCD lines and columns?
(oversca=                   no) Apply overscan strip correction?
(trim   =                   no) Trim the image?
(zerocor=                  yes) Apply zero level correction?
(darkcor=                  yes) Apply dark count correction?
(flatcor=                  yes) Apply flat field correction?
(illumco=                   no) Apply illumination correction?
(fringec=                   no) Apply fringe correction?
(readcor=                   no) Convert zero level image to readout correction?
(scancor=                   no) Convert flat field image to scan correction?

(readaxi=                 line) Read out axis (column|line)
(fixfile=                     ) File describing the bad lines and columns
(biassec=                     ) Overscan strip image section
(trimsec=                     ) Trim data section
(zero   =            Bias.fits) Zero level calibration image
(dark   =            Dark.fits) Dark count calibration image
(flat   =            Flat.fits) Flat field images
(illum  =                     ) Illumination correction images
(fringe =                     ) Fringe correction images
(minrepl=                   1.) Minimum flat field value
(scantyp=            shortscan) Scan type (shortscan|longscan)
(nscan  =                    1) Number of short scan lines

(interac=                   no) Fit overscan interactively?
(functio=             legendre) Fitting function
(order  =                    1) Number of polynomial terms or spline pieces
(sample =                    *) Sample points to fit
(naverag=                    1) Number of sample points to combine
(niterat=                    1) Number of rejection iterations
(low_rej=                   3.) Low sigma rejection factor
(high_re=                   3.) High sigma rejection factor
(grow   =                   0.) Rejection growing radius
(mode   =                   ql)
:g