OTFデータのリダクションは専用ソフトウェアであるNOSTARおよびCASAによって可能です。
NOSTAR
ここでは、NROの計算機でリダクションを行う手順について述べます。 リダクション環境のExport版については Export版NOSTARのページ をご参照ください。
リダクションソフト起動
解析サーバ(vc07x1)にログインし、 「nostar」とタイプしてリダクションソフトNOSTARを起動します:
yourpc{z6500hg}101: ssh -X vc07x1
z6500hg@yourpc's password:
Last login: Fri Nov 10 17:19:54 2006 from
vc07x1{z6500hg}101: nostarGroup(アカウント名)とProjectを入力して「Start」するとボタンパネルが開きます。


Split
生データには、観測に使用したすべての分光計(A1~A25)のデータがまとめて書かれています。 まず、Splitコマンドによって分光計ごとにデータを分割します。 この「分割後生データ」は /home/GROUP/PROJECT/otfdata/split 配下に生成されます。 生データのファイル名は 指示書名.天体名.観測日時.分光計使用アレイ数.N で、 分割後生データのファイル名は 指示書名.天体名.観測日時.分光計使用アレイ数.N.分光計名 (例:klotf.OriKL.20050131204055.25.N.A01)になります。
ボタンパネルの「Split」をクリックすると、図3のようなウインドウが現れます。 「Add File(s)」または「Wildcard」ボタンを使ってsplitしたい生データをリストに追加し、 「Execute」すると分割後生データが /home/GROUP/PROJECT/otfdata/split に書かれます。
- 「Add File(s)」では、ファイル選択ダイアログを使ってファイルを追加します。 複数ファイルを一度に選択するには、ダイアログ上で control または shift キーを押しながらファイル名をクリック してください。
#ただし、あまり多くのファイル(典型的には数百個)を一度に選択しようとするとフリーズすることがあります (IDLの関数DIALOG_PICKFILEで、ファイルのフルパス名の合計が32768文字に制限されているようです)。 - 「Wildcard」を使うと、ワイルドカードでファイルを選択できます (たとえば「/bin/ls /home/z6500hg/proj1/otfdata/raw/*20070416*」。findなど、他のコマンドも使用可能)。
- 「Remove」で選択したファイル一つ、「Remove All」ですべてのファイルをリストから削除できます。

Scale
FOREST, 7BEEによるデータなど、データの強度に定数(スケーリングファクター)を掛けたい場合にはタスク「Scaling」を使います。 このタスクは、分割後生データ(ベースラインを引いた後でもよい)に対して用います。 スケーリングファクターの値はデータヘッダ「MLTSCF0」に格納され、 タスク「Show Header」で確認できます。
ボタンパネルの「Scaling」をクリックすると、図4-4のようなウインドウが現れます。

「Add File(s)」または「Wildcard」で分割後生データを一つまたは複数選択します。 「Search & Add」をクリックすると、他の分光計のデータが自動的に追加されます。 「A1」-「A35」の必要な欄にスケーリングファクターの値を入れて「Execute」すると データにスケーリングファクターが適用されます。
- 「Load SF」で、スケーリングファクターをテキストファイルから読み込むことができます。 ファイルには、分光計名「An」とスケーリングファクターの値を一行に一組、 スペースかタブで区切って書きます(サンプル)。 分光計名は省略可能で、その場合には1行目から順にA1, A2, … の値であるとみなされます。
- 「mode」を「replace」とすると、与えた値でヘッダMLTSCF0が上書きされます。 「multiply」では、すでに設定されているMLTSCF0の値に、与えた値が掛けられます。
Base
分割後生データに対してBaselineを引きます。 ファイル名は 指示書名.天体名.観測日時.分光計使用アレイ数.アレイ名.base (例:klotf.OriKL.20050131204055.4.A01.base)になります。 Baselineを引く前の分割後生データは消去されます。 ベースラインの引かれていない分割後生データは マップ作成時にはスキップされます。
ボタンパネルの「Baseline」または「Base (Batch)」を使用します。
Baseline
ボタンパネルの「Baseline」をクリックすると図5のファイル選択画面が現れます。 「File」で分割後生データを一つ選択して「Load」するとGUI画面(図6)が開きます。

画面右側にデータが表示され、左側で諸パラメータを設定します。 データはスキャン1列ごとに表示されます。 上のパネルは1列を平均したラインプロファイルで、 下のパネルは横軸に速度(またはチャネル・周波数)、 縦軸にスペクトル番号をとった一種の位置-速度図です。
- 「fitting function」、「order/wave」でフィッティングの関数形を指定します。
- 「fitting range」にベースラインレンジを入力します (表示されているデータ上でのマウスクリック、または手入力)。 「clear」で入力したレンジがリセットされます。
- 「x-axis mode」、「ch binning」でx軸(速度軸)の単位 およびチャネルビニング幅を指定します。
- 「Ref freq」で参照周波数(基準とする静止周波数)を指定します。
- 「xrange」、「yrange」で速度軸および強度軸の表示範囲を指定します。 「yrange」は下のパネルのグレースケール範囲も兼ねています。
- 「Exec」で現在表示中の列に対してベースラインフィットを実行します。
- 「Next」、「Prev」でそれぞれ次の列、前の列に移動します。
- 「Till Last SP」で現在表示中の列から最後の列までに対してベースラインフィットを実行します。
- 「Revert」でファイルをオリジナルの状態に戻せます。
- 「Save & Quit」で終了します。

Base (Batch)
ボタンパネルの「Base (Batch)」をクリックすると図7の画面が現れます。 「Add File(s)」、「Search & Add」、「Wildcard」で分割後生データを追加してください。 「function type」にフィッティング関数の種別とパラメータ(多項式の次数または正弦波の波数)、 「fitting range」にベースラインレンジと単位を指定し、 「Exec」するとベースラインフィットが実行されます。

Flag
(もし必要があれば)「Flag」を使って質の悪いデータにフラグを立てます。 フラグを立てたデータは、マップ作成時にスキップされます(データ自体が消えるわけではありません)。
ボタンパネルの「Flag」をクリックすると、ファイル選択/オプション設定画面(図8)が現れます。 「File」で分割後生データを一つ選択してください(他の分光計のデータも同時に処理されます)。 このタスクではデータを時系列で(QLOOKと同様に)積分したものを表示しながら 処理を進めますが、何秒分のデータを積分するかを「Time averaging」で指定します。 「Divide each scan into」では、各スキャン列を整数個に分割します。 「Number of spectra」では、スキャン列の区切りに関わりなく、先頭から順に指定した個数ずつのデータを束ねて表示します。
「Load」を押すと、表示用の一時ファイル(拡張子”.sp”)の作成が始まり、しばらく待たされます。 過去に作成した一時ファイルが残っていれば、それを使って処理を進めます (そのため、quitしても一時ファイルは消去されません)。

一時ファイルの作成が終わると、GUI画面(図9)が開きます。 ウインドウ右側にスペクトルが表示され、フラグの立ったスペクトルには×印が付きます (積分区間の一部のみにフラグが立っている場合には斜線が表示されます)。
- 「x-axis mode」、「x smoothing」でx軸(速度軸)の単位 およびチャネルビニング幅を指定します。
- 「Ref freq」で参照周波数(基準とする静止周波数)を指定します。
- 「xrange」、「yrange」で速度軸および強度軸の表示範囲を指定します。
- 「Prev」、「Next」で前後のページに移動します。
- 「Exec」でその時点までに設定したフラグ情報をデータファイルに書き込みます。
- 「Flag All CH」、「Unflag All CH」で現在表示中のページに対して 全分光計のフラグON/OFFを行います。
- 「Quit」で終了します。変更したフラグ情報がまだファイルに書かれていない場合には 確認のダイアログ(”Force quit” or “Save & quit”)が表示されます。
- 「Flag All Data」、「Unflag All Data」で全分光計の全スペクトルに対してフラグをON/OFFします。
- 「Page #」に現在表示中のページ番号が表示されます。 数字を書き換えてReturnキーを叩くとそのページに飛びます。
スペクトルをクリックしてフラグのON/OFFを切り替えます。 スペクトル表示領域にマウスカーソルが乗っている状態では、以下のキーボードショートカットが使用可能です:
- 「b」または「p」:前のページへ
- 「f」または「n」:次のページへ
- 「q」:Quit

Map
ベースラインを引いた分割後生データにconvolutionをかけて マップ(FITSキューブ)を作成します。
ボタンパネルの「Make Map」をクリックすると図10のファイル・ディレクトリ選択画面が現れます。 「Add File/Dir」または「Wildcard」で(ベースラインを引いた後の)分割後生データ、 または分割後生データをまとめたディレクトリを追加してください (ディレクトリ指定を推奨。ディレクトリを指定するには、 ファイル選択ダイアログで目的のディレクトリまで移動した後、 何も選択しない状態で「Open」ボタンをクリックします)。 「Position map type」で表示するポジションマップの座標種別を選択後、 「Load」するとGUI画面(図11)が開きます。

- 「Coordinates」でポジションマップおよびマップ範囲の座標種別を指定します。
- 「Mapping Range」にマップのBLCおよびTRCを入力します (ポジションマップ上でのマウスクリック、または手入力)。
- 「Spatial Grid」で空間方向のグリッド間隔(Spacing [arcsec])または グリッド数(Number)を指定します。
- 「Freq axis」で速度(周波数)軸の座標種別を指定します。
- 「Range」で速度軸の範囲を指定します。
- 「F/V Grid」で速度方向のグリッド間隔(Spacing [Hz or km/s])または グリッド数(Number)を指定します。
- 「Ref freq」で参照周波数を指定します。
- 「Zoom」をクリック後ポジションマップ上でBLC, TRCをクリックすることで ポジションマップのズームが可能です。 「Unzoom」で初期状態に復帰します。
- 「Convolution func」でConvolution関数とパラメータを指定します。
- 「Load .his」で過去にMapを実行した際の履歴ファイル(拡張子”.his”)から パラメータを読み込むことができます。
- 出力FITSファイル名を指定して「Exec」で実行します。

Make Mapを実行すると、出力FITSファイルhoge.fitsのほかに 一時ファイル hoge.fits.grid、 履歴ファイル hoge.fits.his、 マップの各グリッドのrms値が書かれた2次元FITS hoge.fits.rms.fits が作成されます。 ただしhoge.fits.rms.fitsに書かれた値はあくまで目安で (実際より小さめの値を出す傾向があります)、 最終的にはデータの質の判断は出力FITSキューブ自身から行ってください。 一時ファイル”.grid”は(現時点では)使い道のないファイルですので 消去してかまいません。
Basket-Weave
Scanning effectを除去するため、 (ほぼ)直交する2方向のスキャンからそれぞれ作成したFITSキューブを Emerson & Gräve (1988)の方法 (マップをフーリエ変換してscanning effectにマスクをかけ、 重み付き平均して逆フーリエ変換) で処理します。 二つの入力FITSファイルの座標軸は、まったく同じでなければならない (すなわち、NAXISi, CRVALi, CRPIXi, CDELTi, and CROTAi の値が同じでなければならない)ことにご注意ください。
ボタンパネルの「Basket-Weave」をクリックすると図12のようなウインドウが現れます。
- 「Image 1」と「Image 2」のそれぞれについて、
- 「File」をクリックして入力FITSを与えます。
- 「Scan dir」にはスキャンの向きを与えます。 X方向のスキャンから作成したマップであれば90、 Y方向のスキャンから作成したマップであれば0とします。
- 「RMS」にはそれぞれのマップのノイズレベル(の相対値)を与えます。 この値の2乗の逆数が重みとして使われます。
- 「Clip」では、データの質が悪い領域にブランク値を代入することができます。
- 「intensity」に強度の最小値と最大値を与えます。強度がこの範囲外のピクセルはブランクになります。
- 「RMS value」にRMSの最小値を与えます。RMSマップ hoge.fits.rms.fits に書かれたRMS値がこれより大きなピクセルはブランクになります。
- 「Option」で フーリエ変換したマップにかけるマスクの幅を指定します。
- 「Preview」の3つの欄には、 表示する温度スケールの最小・最大値、Z(速度ないし周波数)平面を指定します。 「Show」でプレビューを表示します。 プレビュー画面には、処理前後のイメージと、それらのフーリエ変換が表示されます。
- 「Output」に出力FITSファイル名を指定して、「Exec」で実行します。

コマンドラインによるリダクション
所外からネットワーク越しに接続する場合など、 以下のようにしてコマンドラインでリダクションを行うことができます。 リダクションには、名前が「otf_」で始まるコマンド群を使用します。 コマンドの所在は/home0/otf/bin/ です。 解析サーバ(vc07x1)に リモートログインしてから実行してください。
Split
otf_split 生データ
とするとSplitが実行されます。 分割後生データの出力先は環境変数SPLIT_DATA_HOMEで規定されます。 この環境変数が未定義だと /home/GROUP/PROJ/otfdata/split/ が使われます。出力先ディレクトリが存在しないとエラーとなるので、なければあらかじめmkdirしておいてください。
(例) otf_split /home/z6500hg/proj1/otfdata/raw/klotf.OriKL.20050131204055.4.N
Scale
otf_scale 分割後生データ スケーリングファクター モード
とします。 モードは”r”か”m”のいずれかです。 r (replaceの略)とすると与えたスケーリングファクターの値でヘッダ “MLTSCF0” が上書きされます。 m (multiplyの略)とすると与えたファクターが現在設定されている”MLTSCF0″の値に掛けられます。
(例) otf_scale /home/z6500hg/proj1/otfdata/split/klotf.OriKL.20050131204055.4.N.A01 1.42 r
Base
otf_base 分割後生データ 開始SP# 終了SP# フィッティング関数種別 範囲1開始チャネル 範囲1終了チャネル 範囲2開始チャネル 範囲2終了チャネル 範囲3開始チャネル 範囲3終了チャネル 範囲4開始チャネル 範囲4終了チャネル 範囲5開始チャネル 範囲5終了チャネル 範囲6開始チャネル 範囲6終了チャネル 多項式の次数または正弦波の波数
とします。 フィッティング関数種別には”polynomial”または”sincos”を指定します。 “sincos”の場合、波数には複数の値をスペース区切りで指定できます。 ベースライン範囲の指定はチャネル単位でしかできないことにご注意ください。 出力先ディレクトリは環境変数OTF_BASE_DIROで規定されます。 この環境変数が未定義だとエラーとなるので、
setenv OTF_BASE_DIRO /home/GROUP/PROJ/otfdata/split
としておいてください。
(例1) otf_base /home/z6500hg/proj1/otfdata/split/klotf.OriKL.20050131204055.4.N.A01 1 9000 polynomial 150 250 750 850 0 0 0 0 0 0 0 0 1
(例2) otf_base /home/z6500hg/proj1/otfdata/split/klotf.OriKL.20050131204055.4.N.A01 1 9000 sincos 150 250 750 850 0 0 0 0 0 0 0 0 2.3 3.1 4.2
Map
otf_map 座標系 投影法 投影中心座標X 投影中心座標Y BLC座標X BLC座標Y TRC座標X TRC座標Y Z軸種別 Z軸開始点 Z軸終了点 X軸グリッド数 Y軸グリッド数 X軸グリッド間隔 Y軸グリッド間隔 Z軸グリッド数 Z軸グリッド間隔 SearchingRadius 最小データ数 Convolution関数種別 = 関数パラメータ = 参照周波数 出力ファイル名 入力ファイルまたはディレクトリ名
とします。 出力先のディレクトリが存在しないとエラーになります。 各パラメータの意味および書式は次のとおりです:
- 座標系 RADEC, GLGB, XY のいずれか
- 投影法 GLS, ARC のいずれか
- 投影中心座標X 書式は hh:mm:ss.ss (RADECの場合)またはdd:mm:ss.ss。 文字列 DEFAULT を指定するとsource tableで指定した座標が使われる
- 投影中心座標Y dd:mm:ss.ss または DEFAULT
- BLC座標X 書式は hh:mm:ss.ss (RADECの場合)、dd:mm:ss.ss (GLGB)、ssss.ss (XY)
- BLC座標Y 書式は dd:mm:ss.ss (RADEC, GLGBの場合)、ssss.ss (XY)
- TRC座標X 書式は hh:mm:ss.ss (RADECの場合)、dd:mm:ss.ss (GLGB)、ssss.ss (XY)
- TRC座標Y 書式は dd:mm:ss.ss (RADEC, GLGBの場合)、ssss.ss (XY)
- Z軸種別 v (速度), f (周波数) のいずれか
- Z軸開始点 単位は km/s (速度), Hz (周波数)
- Z軸終了点 単位は km/s (速度), Hz (周波数)
- X軸グリッド数 0を指定するとグリッド間隔が優先される
- Y軸グリッド数 0を指定するとグリッド間隔が優先される
- X軸グリッド間隔 単位はarcsec。0を指定するとグリッド数が優先される
- Y軸グリッド間隔 単位はarcsec。0を指定するとグリッド数が優先される
- Z軸グリッド数 0を指定するとグリッド間隔が優先される
- Z軸グリッド間隔 単位は km/s (速度), Hz (周波数)。0を指定するとグリッド数が優先される
- SearchingRadius 単位はarcsec。グリッド点からの距離がこれより小さいスペクトルがConvolutionに使われる
- 最小データ数 Convolutionに使われたスペクトルの数がこれより小さいとマップにブランクが代入される
- Convolution関数種別 BG (Bessel*Gauss), SG (Sinc*Gauss), G (Gaussian), PB (Pillbox), SF (Spheroidal関数) のいずれか
- 関数パラメータ 関数種別によって意味が異なる。パラメータが複数の場合はspaceで区切る。 「=」とパラメータの間にもspace区切りが必要
- BG, SG パラメータa, bを指定する。 ただし単位はpixelsではなくarcsec。 a=グリッド間隔×1.55/π, b=グリッド間隔×2.52 とするのがデフォルト
- G パラメータaを指定する。ただし単位はpixelsではなくarcsec。 a=グリッド間隔 とするのがデフォルト
- PB Pillbox関数はパラメータを持たないが、ダミーとして0を指定する
- SF Schwab (1984)のパラメータm, αを指定する
- 参照周波数 単位はHz。0を指定するとヘッダの値が使われる
- 出力ファイル名 ファイル名を指定
- 入力ファイルまたはディレクトリ名 ファイル名またはディレクトリ名を指定。 複数指定可、ワイルドカード使用可。 ただしシェルでワイルドカード展開された後のコマンド行が10240文字を超えないようにすること。ファイル数が多くなる時は、専用ディレクトリを作って、ディレクトリ名指定にすると便利。
(例) otf_map RADEC GLS DEFAULT DEFAULT 05:35:00.0 -05:40:00.0 5:25:00.0 -05:10:00.0 v -100.0 100.0 0 0 6.0 6.0 0 1.0 18.0 1 BG = 2.96 15.12 = 0 /home/z6500hg/proj1/map/klotf.fits /home/z6500hg/proj1/otfdata/split/klotf.OriKL.*.A01.base /home/z6500hg/proj1/otfdata/split/directoryOfBaselinedFiles
注1:NOSTAR及びNewStarではnobsで設定された’Velocity’ (tracking velocity)
が’Ref frequency(参照周波数)に対応するように周波数が定義されているが、
CASAでは視線速度ゼロが参照周波数に対応するように定義されている。
注2:NOSTARで作成したFITSがCASAに読み込めるように、変換ソフトが用意されています: convert Nobeyama Image FITS to CASA
Nobeyama Pipeline Users Guide
2021-10 Nobeyama Pipeline Team
Overview
The Nobeyama Pipeline is an automated end-to-end data reduction software for the data taken by Nobeyama 45m Radio Telescope (NRO45m). This document describes what is Nobeyama Pipeline, how to use it, and how to examine its products.
Current version of the Nobeyama Pipeline supports On-the-Fly (OTF) observing mode. In particular, the Pipeline is optimized to the OTF observation with FOREST. Download uncalibrated MeasurementSets (MS) from the Nobeyama Science Data Archive if you want to process data by Nobeyama Pipeline by yourself. The Nobeyama Science Data Archive also provides users with the pipeline products, which is a set of output files of the pipeline execution. Pipeline product stored in the archive is the one obtained by running Nobeyama Pipeline with the default parameter setting. To obtain the pipeline product, users may download it from the archive or process uncalibrated MS with Nobeyama Pipeline. Users might want to process the data with Nobeyama Pipeline when result obtained from the archive is not satisfactory so that parameters need to be tweaked, or when there are multiple data that should be processed at once.
The Nobeyama Pipeline has been developed based on the ALMA Pipeline, which is built on top of Common Astronomy Software Applications (CASA). Therefore, ALMA Pipeline Users Guide should be the best material to understand the Nobeyama Pipeline. ALMA Pipeline Users Guide can be downloaded from ALMA Science Portal.
The Nobeyama Pipeline shares most of the code with ALMA Pipeline. Major difference is in their “recipes” which are the sequence of pipeline processing steps (“stages”). Nobeyama Pipeline has its own “importdata” and “exportdata” stages because their implementations are strongly dependent on the observatory. Also, some stages that are not suitable to NRO45m are skipped in the Nobeyama Pipeline. The hsd_k2jycal stage is skipped because it is ALMA-specific while the hsd_flagdata stage is skipped as flagging metrics implemented in this stage are not appropriate to Nobeyama Pipeline.
Pipeline Products
Products are a set of files generated by the pipeline processing. Standard products are listed as follows:
- FITS images for science target
- FITS images for imaging weights associated with each target images
- calibration tables and flagversions files
- instruction to restore calibrated MS
- weblog (
weblog.tgz) - template script for pipeline execution (
casa_pipescript.py) - template script for restoration of calibrated MS (
casa_piperestorescript.py) - casa task execution log (
casa_commands.log) - quality assurance report (
pipeline_aquareport.xml) - pipeline products list (
pipeline_manifest.xml)
There are additional products in the Nobeyama Pipeline.
- per-beam FITS images
- template file for relative gain correction (
nroscalefile.csv) - template file for manual reduction script (
rebase_and_image.py) - (6.1.1 only) supplemental template file for manual reduction script (
rebase_and_image_config.py)
Additional template files listed above are necessary for restoredata process. The rebase_and_image scripts are the template for manual data reduction subsequent to restoredata process. Details of restoredata process are described in Restoring Calibrated MS. Weblogs are slightly different between the ALMA Pipeline and the Nobeyama Pipeline. The differences are described in the next section.
!!IMPORTANT NOTE!! Unlike ALMA, quality assurance was not performed for the products. Therefore, users may need to run the Nobeyama Pipeline with tweaked parameters by themselves when quality of the products is not satisfactory.
Examining Weblog
WebLog is a collection of html files and plots that summarizes data processing by pipeline. It is always a good practice to examine WebLog after downloading pipeline products and running pipeline to inspect the quality of data reduction. You can open and browse WebLog using a web browser, e.g., Firefox. See appendix for solutions of known WebLog display problem. You should read sections 9 and 11 of ALMA Pipeline Users Guide for the latest version to understand contents and structure of pipeline weblog in general.
Here, major differences between ALMA Pipeline and Nobeyama Pipeline are described.
MeasurementSet Overview Pages
In the weblog generated by Nobeyama Pipeline, PWV plots and “Antenna Positions” plots are omitted. The former is due to the lack of necessary data to produce the plot while the latter is dropped because it is meaningless for single dish antenna.
!!IMPORTANT NOTE!! Beams of the multi-beam receivers such as FOREST are treated as antennas in the Nobeyama Pipeline as well as in CASA. That is because “beams” are translated into “antennas” when the data are converted into MS.
By Task Summary Page
According to the difference of recipe, hsd_flagdata and hsd_k2jycal stages are not listed in the weblog generated by the Nobeyama Pipeline. QA scores listed in this page is optimized to ALMA Pipeline. Therefore, some scores may be misleading for Nobeyama Pipeline. For example, QA score for hsd_imaging stage is quite sensitive to the number of masked pixels whose imaging weights are too low (say, less than 10% of median weight). This is because the grid spacings of the OTF observation for ALMA are strictly fixed depending on observing frequency. On the other hand, observing setup for the NRO45m is so flexible that there may be the observing projects that intentionally set sparse spacings for the OTF observation. Such observation could produce coarse images that lead to imaging QA score to be almost zero.
hsd_imaging
In the Nobeyama Pipeline, the “Detailed Profile Map” is not created to shorten execution duration. Therefore, links to these plots located in the task execution summary page for hsd_imaging stage are not available.
Processing Data with Nobeyama Pipeline
In this section, several ways to execute the Nobeyama Pipeline are described.
Preparation
CASA
First of all, you must have the correct version of CASA to run the Nobeyama Pipeline. The CASA releases for ALMA “Cycle 7 reprise” or later, i.e. CASA 6.1.1-15 or higher, are compatible with Nobeyama Pipeline. The latest version is recommended. Please see ALMA Science Portal to obtain the latest version of CASA for Nobeyama Pipeline. You can download CASA from either of the following sites:
Choose appropriate distribution according to your data reduction environment, and follow installation instruction for tar-ball distribution. You might want to set PATH environment variable to launch CASA by simply typing casa.
# for bash, please update directory name depending on your CASA verison
$ export PATH=/path/to/casa-6.1.1-15-pipeline-2020.1.0.40/bin:$PATHDirectory Structure
The instruction described in the following sections assumes fixed directory structure shown below. You should prepare two directories named rawdata and working in your working directory. The rawdata directory is intended to place uncalibrated data in MS format while the working directory is the place to run the Nobeyama Pipeline. You should have the script nropipe.py, which can be downloaded from here, at the working directory or somewhere else you can access. Note that, due to the security restriction, filename of the script is nropipe.txt on the web server. Please rename the file to nropipe.py after you download it. Initial state of your working directory should look like below:
$ tree -L 2 .
.
├── rawdata
│ └── nro-20180305JST102524-v200811.ms
└── working
└── nropipe.pyThe archived data, which has extra suffix .tgz, is also acceptable as input data. After the execution of the Nobeyama Pipeline, you will find the new directory named products in your working directory. This is the directory that stores all the products of the Nobeyama Pipeline.
Running nropipe.py
The most convenient way is to run nropipe.py.
$ cd working
$ casa --nologger --nogui --agg -c nropipe.pyIf you are working on a remote server, it is safe to combine pipeline execution with xvfb-run and/or nohup.
# login to remote server without X11 forwarding
$ ssh -x yourname@remoteserver
$ cd /path/to/working
$ nohup xvfb-run -d casa --nologger --nogui --agg -c nropipe.py &
# you can safely logout from the server without interrupting pipeline execution
$ exitEditing and Running casa_pipescript.py
The casa_pipescript.py is one of the products of the Nobeyama Pipeline. This is a script that can be executed by -c option of CASA. You must set --pipeline option when you run the script. You may need to change the path to MS file to run the script (adding ../rawdata/ before MS name). With casa_pipescript.py, you may optionally modify parameters and customize behavior of each pipeline stage, which is defined as a CASA task. Full list of options for each task can be found in the Pipeline Reference Manual which is available on ALMA Science Portal. After updating data path and modifying the script, it can be executed by, e.g.,
$ casa --nologger --nogui —pipeline -c casa_pipescript.pyContents of casa_pipescript.py look like below.
__rethrow_casa_exceptions = True
context = h_init()
context.set_state('ProjectSummary', 'observatory', 'Nobeyama Radio Observatory')
context.set_state('ProjectSummary', 'telescope', 'NRO')
context.set_state('ProjectStructure', 'recipe_name', 'hsdn_calimage')
try:
hsdn_importdata(vis=['nro-20180305JST102524-v200811.ms'], session=['default'])
h_tsyscal(pipelinemode="automatic")
hsd_tsysflag(pipelinemode="automatic")
hsd_skycal(pipelinemode="automatic")
hsd_applycal(pipelinemode="automatic")
hsd_baseline(pipelinemode="automatic")
hsd_blflag(pipelinemode="automatic")
hsd_baseline(pipelinemode="automatic")
hsd_blflag(pipelinemode="automatic")
hsd_imaging(pipelinemode="automatic")
finally:
h_save()Restoring Calibrated MS
WARNING Please make sure that your products are based on CASA 6.2.1 or higher when you try the restore procedures described below. The restore procedures does not work for the CASA 6.1.1 release.
In addition to casa_pipescript.py, you will also have another script casa_piperestorescript.py in pipeline products. It is a template file to restore calibrated MS from uncalibrated MS. In order to run restore script, both uncalibrated MS and all pipeline products should be obtained. Pipeline products can be obtained from Nobeyama Science Data Archive. Alternatively, it can be generated from uncalibrated MS by running Nobeyama Pipeline. Please make sure that the products were created by CASA version 6.2.1 or higher. You can check the version in the WebLog overview page. Please look at the “Pipeline Summary” section (see figure below), and check “CASA Version” row to find out the CASA version that the products are based on. The overview page is included in the WebLog digest PDF appeared the search result of Nobeyama Science Data Archive. So, you should be able to check the CASA version before you download the products.
==ここに画像(Pipeline Summary)==
CASA version information in the WebLog overview page. This is part of the pipeline WebLog and will be located at the upper right side of the overview page.
An example of casa_piperestorescript.py is shown below.
__rethrow_casa_exceptions = True
context = h_init()
context.set_state('ProjectSummary', 'observatory', 'Nobeyama Radio Observatory')
context.set_state('ProjectSummary', 'telescope', 'NRO')
context.set_state('ProjectStructure', 'recipe_name', 'hsdn_calimage')
try:
hsdn_restoredata(vis=['nro-20180305JST102524-v200811.ms'], reffile='./nroscalefile.csv')
finally:
h_save()Again, the script can be run with -c option, with the --pipeline option to import pipeline during startup. By default, the script searches specified MS for ../rawdata. If you locate the MS in another directory, path to the MS needs to be updated. The script accepts raw content of the Archive, which is compressed MS with suffix .tgz as well. You need to append the suffix if you wish to process compressed MS directly. Do not locate the MS in the working directory. This will cause unexpected error. Pipeline products need to be downloaded from the Archive. You can add a parameter, products_dir, in hsdn_restoredata to specify the location of the Pipeline products.
One advantage of the restore procedure with casa_piperestoresctipt.py over the pipeline processing using casa_pipescript.py is a capability to apply scaling factors for multi-beam receivers such as FOREST to compensate for the variation of receiver gain among beams. You can update nroscalefile.csv according to the measurement of relative gain correction factor. As shown in the example contents of casa_piperestorescript.py above, the hsdn_restoredata has the parameter reffile to accept the file name for the scaling. By default, the script assumes that nroscalefile.csv is placed in the working directory. You should locate nroscalefile.csv at the working directory or update reffile according to the name or the location of the scaling file. Example contents of the nroscalefile.csv is shown below. See description in header of nroscalefile.csv about the file format and how to modify scaling factors.
#MS,Beam,Spwid,Polarization,Factor
mg2-20170525142607-180419.ms,NRO-BEAM0,0,XX,1.0
mg2-20170525142607-180419.ms,NRO-BEAM0,0,YY,1.0
mg2-20170525142607-180419.ms,NRO-BEAM0,1,XX,1.0
mg2-20170525142607-180419.ms,NRO-BEAM0,1,YY,1.0
mg2-20170525142607-180419.ms,NRO-BEAM1,0,XX,1.0
mg2-20170525142607-180419.ms,NRO-BEAM1,0,YY,1.0
mg2-20170525142607-180419.ms,NRO-BEAM1,1,XX,1.0
mg2-20170525142607-180419.ms,NRO-BEAM1,1,YY,1.0
mg2-20170525142607-180419.ms,NRO-BEAM2,1,XX,1.0
mg2-20170525142607-180419.ms,NRO-BEAM2,1,YY,1.0
mg2-20170525142607-180419.ms,NRO-BEAM3,0,XX,1.0
mg2-20170525142607-180419.ms,NRO-BEAM3,0,YY,1.0
mg2-20170525142607-180419.ms,NRO-BEAM3,1,XX,1.0
mg2-20170525142607-180419.ms,NRO-BEAM3,1,YY,1.0After restoration, you can proceed subsequent data reduction steps by either (1) running pipeline tasks by combining restore script with casa_pipescript.py or (2) running casa tasks with the help of template reduction script rebase_and_image, which is also part of pipeline products. For the case (1), since hsdn_restoredata task does the processing corresponding to the stages up to hsd_applycal, combined script will look like below.
__rethrow_casa_exceptions = True
context = h_init()
context.set_state('ProjectSummary', 'observatory', 'Nobeyama Radio Observatory')
context.set_state('ProjectSummary', 'telescope', 'NRO')
context.set_state('ProjectStructure', 'recipe_name', 'hsdn_calimage')
try:
hsdn_restoredata(vis=['nro-20180305JST102524-v200811.ms'], reffile='./nroscalefile.csv')
hsd_baseline(pipelinemode="automatic")
hsd_blflag(pipelinemode="automatic")
hsd_baseline(pipelinemode="automatic")
hsd_blflag(pipelinemode="automatic")
hsd_imaging(pipelinemode="automatic")
finally:
h_save()In the case (2), the rebase_and_image script performs baseline subtraction and imaging by using sdbaseline and sdimaging directly rather than executing pipeline tasks. It means that the processing is simpler and faster than the case (1) because the rebase_and_image is a deterministic script and it skips heuristics to optimize the processing parameter at runtime. The rebase_and_image script can be run with -c option as well. Below is the example to restore calibrated data with casa_piperestorescript.py and then further process the data with rebase_and_image script. The rebase_and_image script will output all the files to ../rebase. Note that rebase_and_image.py is a template script that implements minimal processing steps. You can edit the script according to your needs.
# you are now in "restore" directory
$ pwd
/path/to/restore
# copy nroscalefile.csv from "products" directory
# and edit the contents accordingly
$ cp ../products/nroscalefile.csv .
# copy casa_piperestorescript.py from "products" directory
$ cp ../products/casa_piperestorescript.py .
# run casa_piperestorescript.py
$ casa --pipeline -c casa_piprestorescript.py
# run rebase_and_image script
# output files will be found in ../rebase
$ casa -c ../products/rebase_and_image.pyAppendix: Solutions of Known Weblog Display Problem
Solution 1: Launch http server
When you encounter a problem when opening the weblog, you should consider launching http server at localhost. If you have python or CASA the following command launches http server.
python3 -m http.server --bind localhost 8000By default, the current directory, where the above command is executed, will become the root path so that, if the weblog is located at ./relative/path/to/weblog/html/index.html, you can access the weblog with http://localhost:8000/relative/path/to/weblog/html/index.html. If current directory is not preferable, you can specify the root path via --directory option.
Alternatively, Pipeline task, h_weblog, does above for you. Invoke casa with --pipeline option at working directory and execute the task as shown below.
h_weblog(relpath=‘pipeline-*****/html’)Solution 2: Lower browser security
Otherwise, you need to change the browser setting as described below. Note that these settings lower the browser security so you may need to revert the setting when you access external website.
Firefox
Navigate to about:config and search for the privacy.file_unique_origin preference. Change the preference value to false.
Safari
Open Safari preferences, navigate to Advanced tab and check the Show Develop in menu bar option. From the new Develop menu option now visible at the top of the screen, select Disable Local File Restriction.
Chrome
The --disable-web-security and --user-data-dir command line arguments must passed to Chrome via the command line. For example, on MacOS start Chrome like this:
/Applications/Chrome.app/Contents/MacOS/Chrome --disable-web-security --user-data-dir=~/tmp
