2011/12/05

Surface brightness of the Galactic diffuse X-ray emission

系内、特に銀河面付近のソースを扱うX線屋さんが避けて通れない背景拡散放射 (GDXE)。
その輝度の見積もりがむずかしくbackground estimationで苦労することもしばしば。

すざくの良質なスペクトルを元にH. Uchiyamaさんがその表面輝度をモデル化しています。
H. Uchiyama PhD (2010) PDFはこちら

Sgr A*を中心とする2つの2-D exponentialの和を用いたモデル (eq.4.2) は特に便利なので、
銀河座標を放り込むと表面輝度を表示するかんたんなスクリプトを書きました。
座標を2セットいれると2領域間での輝度の比を表示します。
無駄にnumpyつかってるのはご愛嬌。。

※初期版にひどいバグ:
l0, b0で絶対値とるの忘れてました!
12/5に参照した方は修正した下記をご覧下さい。

#!/usr/bin/env python

'''
The model expression and the parameters are respectively 
taken from eq.4.2 and table 4.11 of H. Uchiyama 2010, PhD Thesis
http://repository.tksc.jaxa.jp/pl/dr/IS8000028000/en
The parameters were measured with the K-alpha lines from FeXXV 
and FeXXVI and the 5-10 keV continuum bands.
The unit of surface brightness is 1e-7 ph/s/cm2/am2 for 
Fe Ka lines and 1e-13 erg/s/cm2/am2 for 5-10keV continuum.
'''

import numpy as np

gpos_SgrAs = np.array([-0.056, -0.046])

a1 = (26.3, 10.0, 3.4)
a2 = (1.6, 0.25, 0.20)

hl1 = (0.47, 0.51, 0.48)
hb1 = (0.22, 0.22, 0.19)

hl2 = (30, 47, 55)
hb2 = (1.7, 17, 2.5)

band2colnum = {
    'FeXXV':0,
    'FeXXVI':1,
    'hard':2
    }

def calc_sb(l, b, band):

    i = band2colnum[band]

    l0, b0 = np.abs(np.array([l, b]) - gpos_SgrAs)
    sb1 = a1[i] * np.exp(-l0/hl1[i]) * np.exp(-b0/hb1[i])
    sb2 = a2[i] * np.exp(-l0/hl2[i]) * np.exp(-b0/hb2[i])
    sb = sb1 + sb2

    return(sb)

def calc_ratio(l1,b1, l2,b2, band):

    sb1 = calc_sb(l1, b1, band)
    sb2 = calc_sb(l2, b2, band)
    ratio = sb1 / sb2

    return(ratio)

if __name__ == '__main__':

    import sys

    argvs = sys.argv

    try:
        l, b, band = argvs[1:4]
        cnum = band2colnum[band]
        sb = calc_sb(float(l), float(b), band)
        print(sb)
    except:
        try:
            l1, b1, l2, b2, band = argvs[1:6]
            cnum = band2colnum[band]
            rt = calc_ratio(float(l1), float(b1), float(l2), float(b2), band)
            print(rt)
        except:
            print('Usage1 calc sb : calcgdxe.py l b band')
            print('Usage2 calc sb ratio : calcgdxe.py l1 b1 l2 b2 band')
            print('band should be selected from FeXXV, FeXXVI, or hard')
            exit()


追記。

標準で入ってないないnumpyというライブラリを使っているので、
import numpyでこける場合は以下の3点を修正すれば動くと思います。
めんどくさいので動作みかくにん。

1)
import numpy as np
gpos_SgrAs = np.array([-0.056, -0.046])
↓
import math
l_SgrAs = -0.056
b_SgrAs = -0.046

2)
l0, b0 = np.abs(np.array([l, b]) - gpos_SgrAs)
↓
l0 = abs(l - l_SgrAs)
b0 = abs(b - b_SgrAs)

3)
np.exp()
↓
math.exp()

2011/11/17

All sky map in various wavelengths

  • Longer wavelengths: LAMBDA Foreground
    • FITS images http://lambda.gsfc.nasa.gov/product/foreground/f_products.cfm
    • PNG images http://lambda.gsfc.nasa.gov/product/foreground/f_images.cfm
    • Contents: 
      • Composite H-alpha 
      • Haslam 408MHz
      • N(HI) 
      • LAB HI survey
      • Predicted dust emission at 94GHz
      • Derived E(B-V)
      • W(CO) at 115GHz
      • IRAS/ISSA at 12, 25, 60, and 100um
  • X-rays
    • ROSAT All Sky Survey 
      • Ref: http://iopscience.iop.org/0004-637X/485/1/125/35274.text.html
    • MAXI
  • Fermi LAT map http://astrometry.fas.harvard.edu/skymaps/fermi/


Plotting All-Sky Map with matplotlib+pywcsgrid2
http://leejjoon.github.com/matplotlib_astronomy_gallery/allsky/allsky.html

2011/09/09

理研 基礎科学特別研究員 選考結果

採用内定いただきました。正直、非常に精神的に楽になりました。
書類や面接の指導をしてくださった方々(面接練習には実に3回も
つきあって頂きました。。)、twitterなどで応援の言葉をかけて
くださった方々に、深くお礼申し上げます。

結果として内定をいただきましたが、反省点は山のようにあります。
ところで学振とちがって、評点などは教えてもらえないみたい??
参考にしたかったのだけれど。

いずれにしても、、

つぎはD論!

さわだ

Troubleshooting the installation of AtomDB in the HEASoft 6.11 source-code package [updated]

※revised on 2011/09/09 10:00 pm (JST)
※日本語版が下にあります。

I met a trouble on the installation of HEASoft-6.11. The trouble is related to apec/AtomDB data loaded in Xspec and divided into two different factors:
  • AtomDB v.2.0.0 has a serious bug. (http://www.atomdb.org/bug_201.php)
  • The corrected version of AtomDB (v.2.0.1) is not included in the source-code package of HEASoft until yesterday (2011/09/08 JST).

I've discussed with Bryan K. Irby, the HEASoft developer.
The problem and solution seem to be different depending on the download date of the package.

  • 2011/06/29 -- 2011/09/08 (yesterday)
    • The package does not include the corrected version of AtomDB (2.0.1) thus you will see an error message when you load apec in Xspec. 
    • Download a patch file and install it from http://heasarc.nasa.gov/docs/software/lheasoft/bugs.html . 
    • Never use the older AtomDB v.2.0.0 files included in the package (at ${HEADAS}/Xspec/src/spectral/modelData ) because it has a serious bug. See http://www.atomdb.org/bug_201.phpfor for detail.
      • NOTE: Until now (2011/09/09 JST), the HEASoft bug list page does not have any information of the lacking AtomDB v.2.0.1 in the source-code package downloaded during 2011/06/29--2011/09/08. 
      • Thanks to Bryan's quick response, we are now able to get sufficient information to deal with the problem on this version of the HEASoft source-code distribution. 
      • The updated information is available at http://heasarc.nasa.gov/docs/software/lheasoft/bugs.html .
  • 2011/09/09 (today) --
    • Bryan has revised the source-code package.
    • The package correctly includes the latest AtomDB (v.2.0.1) and users can load it in Xspec without installing any patch. (I confirmed this by downloading/installing the source-code package for the MacOSX 10.6.)
---

HEASoft-6.11に入っているAtomDB v.2とそのインストールが少し面倒なことになっているのでまとめます。

問題は以下の2点。

  • v.2.0.0にバグがある
  • v.2.0.1が最近まで出回ってたsource-code packageに含まれてない

Bryan K. Irbyとやりとりをした結果、状況が整理できました。
Packageをdownloadした時期によって問題と取るべき対応が異なります。

  • -- 2011/06/28
    • バグがある2.0.0が入ってた。パッチをあてましょう。
  • 2011/06/29 -- 2011/09/08 (昨日)
    • バグがある2.0.0はのぞいた。でも、修正版2.0.1を入れるの忘れた。
    • よって、やっぱりパッチをあてましょう (上のリンク参照) 。
      • ** これに関する情報がいま現在もHeasoftの頁に無いせいでだいぶ混乱。
      • ** 実際京都だけじゃなくて多くの人が状況を理解できなくて
      • ** わざわざv.2.0.0をひっぱってきて使ってた模様。
      • ** Bryanにwebpageの修正を要求中。
      • その後Bryanがそっこーでwebpageを修正してくれました。
      • http://heasarc.nasa.gov/docs/software/lheasoft/bugs.html を参照ください。
  • 2011/09/09 (今日) --
    • Bryanが直してくれました。
    • ちゃんと2.0.1が入ってます。ふつうにインストールすれば
    • そのままつかえます。(さわだcheck済み)
--- 

さわだ%言ってみるもんだ



2011/08/28

海外学振結果

不採用Aでした。

項目別評価は、
①研究業績 3.67
②研究計画 3.50
③外国の機関で研究することの意義 3.67
④総合評価 3.34
総合評価のTスコアは3.156。

特別な弱点も長所もなく、全体的に点が足りないということですね。
個人的には、乏しい研究業績(*)よりも研究計画の評価が低かったのは意外だったので、見直して今後に活かさなければなりません。といっても今年度の主だった書類はすでに申請ずみなのですが。

(*)=主著3報(PASJ×2, NIM A×1)+共著2報(ApJ 2nd×1, PASJ 3rd×1)+国際会議口頭×1+その他

2011/08/22

simxのinstallのtrouble shooting

1. fortranコンパイラをみつけられない問題

=configureで以下のwarningが出るとき。
configure: WARNING: cfitsio: == No acceptable f77 found in $PATH
configure: WARNING: cfitsio: == Cfitsio will be built without Fortran wrapper su


simx-1.1.2/configureの中で実行されるsimx-1.1.2/libsrc/cfitsio/configureはg77を探す。
おそらく多くのMac userはfortranコンパイラを持っていないか、HEASoftのコンパイルのために持っていたとしてもg77ではなくgfortran。てっとり早い対処はgfortranをg77として使わせること。
参考: http://monteboo.blogspot.com/2007/12/cfitsio-fortran-wrap.html
1-0. gfortranを入手。
1-0-1. finkを入れる。

    • Must be installed from source code at this time (2010/04)
    • After downloading a tarball,
      •    $ cd ~/Download
           $ tar -xvf fink-0.29.10.tar
           $ cd fink-0.29.10/
           $ ./bootstrap   
      • Choose [1: Default (mostly 32bit)], [1: Use sudo], [/sw] in the bootstrap.
      • Choose defaults for the others
    • After installation, add source /sw/bin/init.csh to .cshrc
    • and do $ sudo fink selfupdate once

          (なぜか外から閲覧できなくなってる?wikiから転載: http://byakko.scphys.kyoto-u.ac.jp:8830/MSworklog/iMacSetUpLog#General)

1-0-2. sudo fink install gcc4.4でgfortran4.4.1を入れる。
1-1. $PATHに/sw/lib/gcc4.4/lib追加
1-2. sudo ln -s /sw/bin/gfortran /sw/bin/g77
1-3. sudo ln -s /Users/sawada/Downloads/simx-1.1.2/libsrc/cfitsio/* /sw/lib/gcc4.4/lib
(1-3.が必須かどうか未確認。)

2. src/libsimx.a のtableができない問題

=makeで以下のerrorが出るとき。
ld: in ../src/libsimx.a, archive has no table of contents
collect2: ld returned 1 exit status
make[1]: *** [simx] Error 1
make: *** [all] Error 2


2-a. arのoptionを変更する
/Users/sawada/Downloads/simx-1.1.2/src/MakefileのL33を
$(AR) rv $@ $(OBJS)
から
$(AR) srv $@ $(OBJS)
に修正
参考: http://hidemon-memo.blogspot.com/2009/01/mac-os-ar-commandmode.html
2-b. (未試行) Randollの示した対処法
"cd src ; ranlib libsimx.a ; cd .."
参考: http://hea-www.harvard.edu/simx/install.html の末尾

2011/08/09

SPEX cie codeで計算に含まれる元素

SPEXのプラズマモデルはZ=1-30までの元素について組成比をパラメータとして持っていますが、実際のところCr, Mnなどは組成をどれだけ増やしてもHe-like Kα輝線とかが出てくることはありません。なぜならパラメータがあるだけで計算してないから!組成や電離度をちゃんと計算している元素がどれかは、ascdumpコマンドを叩けばわかります。

SPEX> com cie
 You have defined    1 component.
SPEX> calc
SPEX> ascd term 1 1 abund
 number of layer lines :        4076           0
 Atomic   Element  Abundance      Abundance     Average charge
 number   name     (solar units)  (absolute)
 -------------------------------------------------------------
  1        H       1.000          1.000             1.000
  2        He      1.000         9.7051E-02         2.000
  6        C       1.000         2.7733E-04         5.999
  7        N       1.000         8.1658E-05         6.996
  8        O       1.000         6.0534E-04         7.988
 10        Ne      1.000         1.2677E-04         9.923
 11        Na      1.000         2.2233E-06         10.82
 12        Mg      1.000         3.9719E-05         11.60
 13        Al      1.000         3.2584E-06         12.25
 14        Si      1.000         3.8548E-05         12.81
 16        S       1.000         1.6218E-05         14.21
 18        Ar      1.000         3.5727E-06         15.99
 20        Ca      1.000         2.3281E-06         17.87
 26        Fe      1.000         3.2659E-05         20.60
 28        Ni      1.000         1.8880E-06         22.38
てことで、N, Na, Alをのぞくodd Zの元素 (含 Mn)、Be, Ti, Crは計算してくれませんのでお気をつけを。

ちなみにlast columnのAverage chargeは楽しいですね。rtとか変えればもちろん値が変わっていきます。