[ Japanese | English ]

Data Reduction

Here we describe how to reduce OTF data on NRO servers. See Export version of NOSTAR to reduce the data on your own computer.

Startup the Reduction Software

Login to NRO's server (vc06x1) and type "nostar" to startup the reduction software.

yourpc{z6500hg}101: ssh -X vc06x1 
z6500hg@vc06x1's password: 
Last login: Fri Nov 10 17:19:54 2006 from mz01u
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   October 2001
vc06x1{z6500hg}101: nostar

Input Group (user ID) and Project and push "Start", then the Button Panel appears.

Fig. 4-1: Startup screen
Fig. 4-1: Startup window of the reduction software.

Fig. 4-2: Button panel
Fig. 4-2: the Button Panel of the software.


The raw data contains spectra from all the used spectrometers (A1--A25). At first, the raw data should be split into "Split raw data" files, each file contains spectra from a single spectrometer. The "Split raw data" is written in a directory /home/GROUP/PROJECT/otfdata/split . The raw data file is named as TableName.ObjectName.ObservationDate.NumberOfSpectrometers.N, and the split raw data is TableName.ObjectName.ObservationDate.NumberOfSpectrometers.N.NameOfSpectrometer (e.g., klotf.OriKL.20050131204055.25.N.A01).

By clicking "Split" button in the Button Panel, GUI for "Split" like Fig. 4-3 appears. Add raw data file(s) to be split using "Add File(s)" or "Wildcard" button. Click "Execute", then the split raw data files are written in /home/GROUP/PROJECT/otfdata/split .

Fig. 4-3: Split
Fig. 4-3: Split.


If you want to scale the data (e.g., you are dealing with data taken with BEARS), use a task "Scaling". This task should be used for split raw data files (no matter whether baselines have been subtracted or not). The values of scaling factors are stored in a header item "MLTSCF0". You can ascertain them using a task "Show Header".

By clicking "Scaling" button in the Button Panel, a window like Fig. 4-4 appears.

Fig. 4-4: Scale
Fig. 4-4: Scaling.

Select split raw data file(s) by clicking "Add File(s)" or "Wildcard" button. Click "Search & Add" to automatically add data taken with other spectrometers. Input scaling factors for spectrometers "A1"--"A35" and click "Execute" then the factors are applied to the data.


Fit and subtract spectral baselines from the split raw data. The file after baseline subtraction is named as TableName.ObjectName.ObservationDate.NumberOfSpectrometers.NameOfSpectrometer.base (e.g., klotf.OriKL.20050131204055.4.A01.base). The original split raw data file is deleted. Split raw data, for which baselines are not subtracted, are skipped in "Make Map".

Use "Baseline" or "Base (Batch)" in the Button Panel.


File selection dialog (Fig. 4-5) appears by clicking "Baseline" button in the Button Panel. Click "File" to pick a split raw data file, and click "Load" to open GUI window (Fig. 4-6).

Fig. 4-5: Baseline
Fig. 4-5: File selection dialog for Baseline.

The data are displayed in the right-hand side of the window, while parameters are set in the left-hand side. Data display and baseline fitting are done for each scan row. The upper panel of the data display is an averaged line profile of the scan row. The lower panel shows a kind of position-velocity diagram: horizontal axis shows the velocity (or channel, frequency), and vertical axis represents the spectrum number.

Fig. 4-6: Baseline
Fig. 4-6: Baseline GUI.

Base (Batch)

A window like Fig. 4-7 appears by clicking "Base (Batch)" button on the Button Panel. Add split raw data file(s) to the file list using "Add File(s)", "Search & Add" or "Wildcard". Specify the type and parameters (polynomial order or sinusoidal wave number) of baseline-fitting function in "function type", range and unit in "fitting range" and the fit is executed when "Exec" is clicked.

Fig. 4-7: Base (Batch)
Fig. 4-7: Base (Batch) GUI.


(If necessary) use "Flag" to flag out bad data. The flagged data are not used in "Make Map" (flagged data are not removed, but only flagged).

File selection and option setting window (Fig. 4-8) appears when you click "Flag" on the button panel. Select a split raw data file (the data taken with other spectrometers will be simulataneously processed). In this task time-averaged spectra are shown (like the QLOOK). The time span for averaging is specified in "Time averaging" option. For "Divide each scan into", each scan rows are divided into the specified number. For "Number of spectra" the data are binned by the specified numbers from the beginning of the data.

When you click "Load" the program begins to make temporary files (with extension ".sp"). Please wait for a while. If previously-made ".sp" files are found, the program uses them instead (therefore ".sp" files are not erased when quitting the task).

Fig. 4-8: Flag
Fig. 4-8: File selection dialog for Flag.

GUI window (Fig. 4-9) will appear when all the ".sp" files are made. Spectra are shown in the right-hand side of the window. "Cross" marks are drawn on flagged spectra (when only a portion of the data within the averaging span is flagged, a slanting line is drawn instead).

Clicking on a spectrum toggles the flag. The following keyboard shortcuts are available when the mouse cursor is on the spectra:

Fig. 4-9: Flag
Fig. 4-9: Flag GUI.


Finally a map (FITS cube) is created from baseline-subtracted split raw data files using convolution and regridding (see Introduction).

A file/directory selection window (Fig. 4-10) appears by clicking "Make Map" on the Button Panel. Use "Add File/Dir" or "Wildcard" to add split raw data files, or directories in which split raw data files exist (we recommend to use directories. To pick a directory on the file selection dialog box, move into the directory, and click "Open" button without selecting any file). Specify the coordinate system with "Position map type", and "Load" opens a GUI window (Fig. 4-11).

Fig. 4-10: Make Map
Fig. 4-10: File/directory selection window of "Make Map" task.

Fig. 4-11: Make Map
Fig. 4-11: Make Map GUI window.

When you execute "Make Map", in addition to output FITS cube hoge.fits, the following 3 files are created: a temporary file hoge.fits.grid, a history file hoge.fits.his, and a 2-D FITS hoge.fits.rms.fits in which rms value of each grid point of the map is written. Attention: rms values written in hoge.fits.rms.fits are rough estimates (smaller values than actual rms tend to be written), thus you have to judge the data quality using the output FITS cube itself.


Two FITS images (cubes) are combined using the algorithm described by Emerson & Gräve (1988) (Fourier-transform the maps, mask the scanning noise in Fourier domain for each map, weighted-mean them, and inverse Fourier-transform) in order to remove the "scanning effect". The two input FITS files must have the same coordinate axes (i.e., the same NAXISi, CRVALi, CRPIXi, CDELTi, and CROTAi).

By clicking "Basket-Weave" in the Button Panel, a window like Fig. 4-12 appears.

Fig. 4-12: Basket-Weave
Fig. 4-12: Basket-Weave GUI window.

Command-Line Reduction

In case such as you would like to reduce the data from your institute through the network, command-line reduction can be made as follows. You use commands, whose names begin with "otf_", installed in /home0/otf/bin/ . You have to run the commands on a CPU server (vc06x1).



otf_split RawData

to execute Split. The split raw data are written in a directory defined by an environment variable OTF_BASE_DIRO. If it is undefined, /home/GROUP/PROJ/otfdata/split/ is used. An error occurs if the destination directory does not exist, thus you should mkdir it in advance.

(e.g.) otf_split /home/45m/u6500hg/proj1/otfdata/raw/klotf.OriKL.20050131204055.4.N



otf_scale SplitRawData ScalingFactor Mode

to execute scaling. Mode is "r" or "m". When it is set to "r", the header item "MLTSCF0" is overwritten by the given scaling factor. When "m", the given factor is multiplied to the currently-set "MLTSCF0"

(e.g.) otf_scale /home/z6500hg/proj1/otfdata/split/klotf.OriKL.20050131204055.4.N.A01 1.42 r



otf_base SplitRawData StartSpNumber EndSpNumber FunctionType Range1StartChannel Range1EndChannel Range2StartChannel Range2EndChannel Range3StartChannel Range3EndChannel Range4StartChannel Range4EndChannel Range5StartChannel Range5EndChannel Range6StartChannel Range6EndChannel OrderOfPolynomial_or_WaveNumberOfSinusoid

to execute baseline. FunctionType is "polynomial" or "sincos". For "sincos", multiple wave numbers can be specified (as the last arguments) separated by spaces. Baseline ranges should be specified in channel, not velocity or frequency. The output file is written in a directory defined by an environment variable OTF_BASE_DIRO. Type

setenv OTF_BASE_DIRO /home/GROUP/PROJ/otfdata/split

in advance, otherwise you will meet an error.

(e.g.) 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
(e.g.) 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



otf_map CoordinateSystem Projection ProjectCenterPositionX ProjectCenterPositionY BLCPositionX BLCPositionY TRCPositionX TRCPositionY ZaxisType ZaxisStartPoint ZaxisEndPoint XaxisGridNumber YaxisGridNumber XaxisGridSpacing YaxisGridSpacing ZaxisGridNumber ZaxisGridSpacing SearchingRadius MinumumNumberOfData ConvolutionFunctionType = ParametersOfFunction = ReferenceFrequency OutputFileName InputFileOrDirectoryName

to execute map. If the output directory does not exist, an error will occur. Meanings and formats of arguments are as follows:

(e.g.) 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

2008-06-12 nro45mrt @ NRO