Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.8 Build 235
News FAQ
Search Home


next up previous contents
Next: 5. ATCA reduction Up: Volume 3 - Telescope Specific Processing Previous: 3. GBT Continuum Single dish Imaging

Subsections



4. GBT Spectral Line Reduction using UNI-jr

Jim Braatz


4.1 Sample Data Reduction Session

This section shows an example data reduction session using UNI-jr. It is intended to give the reader a feel for the look of UNI-jr commands.

% ssh etamin
% cd /home/etamin/scratch
% mkdir myname
% cd myname
% . /home/aips++/gbt/aipsinit.sh
% aips++ -l uni2.g
- import('/home/gbtdata/tigerTeam_02','tiger.ms',startscan=20,stopscan=33)
- lscans()
[20 21 22 23 24 25 26 27 28 29 30 31 32 33]
- reference(20)
- signal(21)
- temp()
- show()
- nfit(5)
# Use the plotter to set the x-axis units to pixels (channel number)
- nregion(0,3600,4100,8200)
- bshape()                   # to show the fit
- baseline()                 # to subtract the baseline
- show()
- uscale(2.3)                                                           
- setYUnit('Jy')
- show()
- bdrop(2500)
- edrop(2500)
- show()
- sclear()
- getc(26)
- show()
- stats(bchan=1000,echan=2000)
- accum()
- getc(28)
- show()
- accum()
- stats(bchan=1000,echan=2000)
- ave()
- show()
- stats(bchan=1000,echan=2000)


4.2 Introduction

This document describes how to reduce and analyze GBT spectral line data. To ease the learning curve involved for users new to AIPS++, a set of functions has been developed which allow GBT data reduction using the UNIPOPS model. These functions are not an exact emulator of UNIPOPS, but are intended to resemble its data reduction philosophy. The command names are alike, where possible. As of June 2002, the UNI-jr code continues to be under development.


4.3 Prerequisites

You should have AIPS++ stable version 1.7 Build 257 (or later) installed on your system. The AIPS++ version is printed on the screen when the initialization script is executed. A sample data set, taken during the AIPS++ ``Tiger Team'' session, is available and valid as a test data set. Data taken with the GBT during or after November 2001 may also be viable. It is strongly recommended that GBT data be reduced in Green Bank. Reducing the data at one of the other NRAO sites is also an option. Contact Jim Braatz, Joe McMullin or Bob Garwood if you have troubles.

If you are in Green Bank, use the computer etamin, naiad or thalassa and its local disks. These will dramatically improve performance. Do so as follows:

ssh etamin
cd /home/etamin/scratch
mkdir myname
cd myname


4.4 About the Sample Data

The tigerTeam_02 data in the examples used throughout this document were taken with the GBT on 11 October 2001. The L-band receiver (1.15-1.73 GHz) was used with the intent to observe the HI profiles of an assortment of galaxies. The backend was the GBT spectrometer. The ``OffOn'' procedure in GO was used to drive the position-switched observations. Signal and reference data are recorded in separate, adjacent scans of equal duration.


4.5 Starting UNI-jr

Prior to running AIPS++, various environment variable must be set. If you are running the bash shell, do this:

. /home/aips++/stable/aipsinit.sh
and if you run csh, do this:
source /home/aips++/stable/aipsinit.csh

In Green Bank there is a link which points to the best AIPS++ version for reducing GBT data. This may be more recent than stable. It is recommended you source it instead, if in GB:

. /home/aips++/gbt/aipsinit.sh

Then start AIPS++ and UNI-jr as follows:

aips++ -l uni2.g

You will see the Glish prompt when the system is ready.


4.6 Processing GBT Scans

The first step in processing data is to identify the input data file. The technique for doing so differs depending on if the data are in the raw GBT FITS format, or have been previously filled into the AIPS++ MeasurementSet format. To import data from FITS files, use the import command:

- import('/home/gbtdata/tigerTeam_02','tiger.ms',startscan=20,stopscan=33)
This command creates a MeasurementSet called tiger.ms. If the desired MeasurementSet already exists on disk, use the dopen command to load the data:
- dopen('/home/aips++/data/demo/dishdemo/tiger.ms')

These data sets are specific to the Green Bank installation. For other sites, consult the AIPS++ system administrator to see how to access this data.

List the scans available in your new data set:

- lscans()
[20 21 22 23 24 25 26 27 28 29 30 31 32 33]

Calibrate a Sig/Ref pair as follows:

- reference(20)
- signal(21)
- temp()
- show()

You can also use the UNI-jr ``get'' function to retrieve and calibrate scans. It works as long as the header information associated with the scan is correct. For the position switched example above, the command sequence is:

- get(20)
- get(21)
- temp()
- show()

To calibrate and retrieve a frequency switched scan, only a single get is required:

# This example does not work with the sample data provided, but shows the 
# sequence required for freq switched data.
- get(2005)
- show()

The red and green plots represent the two polarizations. These are currently handled together, but a developing enhancement to UNI-jr will allow the polarizations to be handled separately as they are in UNIPOPS. Currently you can show an individual polarization with the show1 function, and you can average to two polarizations using the avgFeeds function.

The spectrum is initially shown with GHz units for the x-axis. These units can be changed using the button on the plotter labeled ``GHz''. Regions of the plot may be zoomed using the middle mouse button, and unzoomed using the unzoom button on the plotter.

To fit a baseline to the data, you must specify a range of the spectrum to use for the fit and the order of the polynomial. In this example we will describe the fit region using channel numbers, so first plot the spectrum against channel number (select the option labeled pix on the plotter x-axis selector button). Then, similar to UNIPOPS, use the following procedure:

- nfit(5)
- nregion(0,3600,4100,8200)
- bshape()                   # to show the fit
- baseline()                 # to subtract the baseline
- show()                     # to show the baseline-subtracted data

The UNI-jr function setregion() can be used in place of the nregion function to enter the baseline region interactively using the mouse cursor.

If a calibration scaling factor is known, it can be applied:

- uscale(2.3)                                                           
- setYUnit('Jy')
- show()

The UNIPOPS-familiar bdrop and edrop parameters may be utilized in the plots:

- bdrop(2500)
- edrop(2500)
- show()

To recall the value of a UNIPOPS-type adverb, simply call the function with no value, as follows:

- bdrop()
2500 
- nfit()
5

To fit a gaussian function to the data, use the ``G fit'' button on the plotter. Prior to fitting, an initial guess to the line shape must be given. This can be done automatically by pressing the green ``Estimate'' button, or interactively by pressing the gray ``Inter'' button under the ``Estimates'' title. Choose the latter for the sample data and follow the directions on the message line in the Profile Fitter GUI. Then press the green ``Fit profile'' button the do the actual fitting.


4.7 Averaging Scans

UNI-jr uses the UNIPOPs model for averaging scans. Data is stored away to the accumulator, and can then be averaged. First clear the accumulator:

- sclear()

then retrieve scans using (for example) get, getc, signal/reference/temp, getfs, or some other calibration and retrieval command, and accumulate them:

- getc(26)
- accum()
- getc(28)
- accum()

and finally average and show the result:

- ave()
- show()


4.8 Statistics and Other Analysis

The stats function will return statistics over a given channel range:

- stats(bchan=500,echan=1500)

The equivalent to the UNIPOPS moment command can be run as follows:

- bmoment(3900)
- emoment(4100)
- moment()


4.9 A Short UNI-jr Reference

This section lists the commands currently available in the UNI-jr package. Each function's parameters are listed with it. If the parameter does not have an assignment (e.g. the scan parameter in the signal function) then it must be supplied when the function is called. If the parameter does have an assignment, then the assigned value shown here is the default, but it can be overridden by specifying a new value when the function is called.

The functions can either be called with parameters listed in order and no parameter name specified, or they can be called with parameter names specified and in any order. The following two calls are equivalent:

stats(F,2,1000,2000)
stats(bchan=1000,echan=2000,feed=2)


Loading data:
------------
import(projdir,outms=F,outmsdir=F,startscan=F,stopscan=F,backend=F) 
                                        : Import (fill) data from GBT FITS files
dopen(filename)                         : Open an already filled data set
files()                                 : Show input and output file settings
dsummary()                              : List some scan info (source, time)
ls()                                    : List files in directory

Retrieving and Calibrating Scans:
---------------------------------
lscans()                                : List available scans
dgetscan(scan,nphase)                   : Return an individual phase
getir(scan,phase)                       : Get an individual phase to memory
get(scan)                               : General purpose scan retrieval
signal(scan,tcal_in=unset,pctTsys=0.01,verbose=F)
                                        : Retrieve a sig scan
reference(scan,tcal_in=unset,pctTsys=0.01,verbose=F)
                                        : Retrieve a ref scan
temp()                                  : Perform (s-r)/r for pos switch data
getc(scan)                              : Retrieve \& calibrate pos switch pair
getfs(scan,tcal_in=unset,flipsigref=F,pctTsys=0.001,verbose=T)
                                        : Retrieve freq switch scan
getfsint(scan,intNo=1,tcal_in=unset,flipsigref=F,pctTsys=0.01,verbose=F)
                                        : Retrieve freq switch integration
calibTaStar(tau=0.012,eta_l=0.99)       : Calibrate to Ta*
calibTmb(tau=0.012,eta_m=0.98)          : Calibrate to Tmb
calibSnu(tau=0.012,eta_a=0.7)           : Calibrate to Jy

Averaging Scans:
----------------
accum()                                 : Add scan to accumulator
ave()                                   : Average scans in accumulator
sclear()                                : Clear accumulator
avgFeeds()                              : Average all feeds

Plotting Scans:
----------------
page()                                  : Clear the plotter
show()                                  : Display scan in memory (globalscan1)
show1(ifeed)                            : Display 1 feed of scan in memory
showref()                               : Display ref scan
setYUnit(unit)                          : Set Y axis unit for plotting
saxis(strval)                           : Change units on X axis
bdrop(value=T)                          : Set bdrop parameter
edrop(value=T)                          : Set edrop parameter

Baseline Fit:
-------------
nfit(value=T)                           : Set order of polynomial to fit
nregion(...)                            : Set baseline region
setregion()                             : Set baseline region with mouse
baseline()                              : Subtract polynomial of order nfit
dcbase()                                : Subtract polynomial of order 0
bshape()                                : Show baseline fit of order nfit

Smoothing and Scaling data:
---------------------------
uscale(factor)                          : Scale the scan in memory
bias(factor)                            : Add a bias to scan in memory
hanning()                               : Hanning smooth scan in memory
boxcar(smooth_width)                    : Boxcar smooth scan in memory
chngres(smooth_width)                   : Change resolution of scan in memory

The Stack:
----------
addstack(beg,end=beg,inc=1)             : Add elements to the stack
empty()                                 : Empty the stack
delete(value)                           : Delete one component from the stack
tellstack()                             : Show the stack

Analysis:
---------
stats(quiet=F,feed=0,bchan=0,echan=0)   : Calculate stats over specified range
rms(printFlag=F)                        : Calc stats over the baseline region
bmoment(value=T)                        : Set bmoment parameter
emoment(value=T)                        : Set emoment parameter
moment(quiet=F)                         : Calculate moments of scan in memory
peak(quiet=F)                           : Calculate location and val of peak
galactic(quiet=F)                       : Calculate galactic coords from header

Scan Arithmetic:
----------------
push()                                  : push a scan for processing
minus()                                 : Perform sig = sig-ref
plus()                                  : Perform sig = sig+ref
multiply()                              : Perform sig = sig*ref
divide()                                : Perform sig = sig/ref

Saving Data:
------------
chngfile(outfile=F)                     : Set output file
keep()                                  : Save a scan
kget(scan)                              : Retrieve a scan from the keep file
klscans()                               : List scans in keep file

Utility:
--------
lscans()                                : List available scans
utable()                                : Show data values from scan in memory
header()                                : Show header values for scan in memory
getvf(chan)                             : Show velocity, freq for given channel
getvfarray()                            : Get array or velocities, frequencies
uniput(name,value)                      : Store a value in memory slot
uniget(name)                            : Retrieve a value from memory slot
copy(fromhere,tohere)                   : Copy memory locations
upr(...)                                : Show internal variable values
store()                                 : Store any state values (nregion, ...)
restore()                               : recall stored values


4.10 A Mapping between UNIPOPS and UNI-jr commands

UNIPOPS                              UNI-JR
-------                              ------

get 55                               get(55)
page                                 page()
show                                 show()
accum                                accum()
ave                                  ave()
sclear                               sclear()
nfit = 3                             nfit(3)
nregion = 1,128,380,512              nregion(1,128,380,512)
baseline                             baseline()
dcbase                               dcbase()
bshape                               bshape()
on 55                                signal(55)
off 56                               reference(56)
temp                                 temp()
factor=3.5; scale                    uscale(3.5)
factor=1.2; bias                     bias(1.2)
addstack(600,620,1)                  addstack(600,620,1)
addstack(631)                        addstack(631)
empty                                empty()
delete(609)                          delete(609)
tell stack                           tellstack()
table                                utable()
header                               header()
bmoment = 128                        bmoment(128)
emoment = 512                        emoment(512)
moment                               moment()
minus                                minus()
plus                                 plus()
multiply                             multiply()
divide                               divide()
peak()                               peak()
chngfile                             chngfile()
keep()                               save()
hanning                              hanning()
nbox=5; boxcar                       boxcar(5)
newres=4.4; chngres                  chngres(4.4)

next up previous contents
Next: 5. ATCA reduction Up: Volume 3 - Telescope Specific Processing Previous: 3. GBT Continuum Single dish Imaging   Contents