Joint Astronomy Centre
Show document only
JAC Home
JCMT
UKIRT
Contact info
JAC Divisions
OMP
Outreach
Seminars
Staff-only Wiki
Weather
Web Cameras
____________________

JCMT home
Observing at JCMT
OMP Observation Manager
Telescope
Instrumentation
Schedule
Data Archive
Future Developments
Legacy Surveys
Newsletter & Publications
How to reduce ACSIS data with CLASS

Reducing ACSIS data with CLASS

To run the GILDAS software (class, greg, etc) first type (or enter this in your .login file):

setenv GAG_ROOT_DIR /jcmt_sw/CLASS/GILDAS
setenv GAG_EXEC_SYSTEM x86_64-redhat-g95
source $GAG_ROOT_DIR/etc/login

The latest installed version (October 2009a) can be reached at all 64-bit machines.

If you prefer to use CLASS and other Gildas software to reduce your spectra these are the steps to take:
(at this moment one is working in Grenoble on methods to do the conversion in CLASS itself)
First make cubes of the ACSIS data with makecube or ORACDR. Then extract subcubes of dimension 1,1,nspec from the cubes in NDF format and convert these to FITS format. Read the FITS files into CLASS.

This can be done with the kappa command ndfcopy and the convert command ndf2fits.

The following assumes that you are using the most recent (Lehuakona) release of the Starlink software (the exten parameter of ndfcopy is only available in Hilo).

to FITS

If you have multisubsystem observations made with RxA3, where the first subband is in LSB (USB) and another is in USB (LSB), you have to change the sideband in the header of the USB (LSB) cube:

kappa
wcsattrib file.sdf set sideband USB (LSB)

The simplest ways to convert .sdf files to FITS format is for:
RxA3 and RxW (single spectra):

convert
ndf2fits file.sdf file.fits encoding="fits-class"
RxA3, HARP, RxW (maps) - one single spectrum from position (1,1) in map:
kappa
ndfcopy in='file(1,1,)' out=file.sdf exten
./cubecopy file.sdf file_cc.sdf
convert
ndf2fits file_cc.sdf file.fits encoding="fits-class"

The parameter exten in ndfcopy extracts header arrays correctly when copying the cubes.
Cubecopy copies the cube, and updates the median values of the FITS header parameters MEDTSYS, EFF_EXP, and EFF_TIME.

To convert maps one needs to do this for all positions in the map.
This is an example of a csh script that does that for a 4x4 map:

#!/bin/csh -f
source /star/etc/login >& /dev/null
source /star/etc/cshrc >& /dev/null
kappa >& /dev/null
convert >& /dev/null
if (`alias kappa` == "") then
echo ""
echo "Fatal: Initialization error of kappa environment"
echo ""
exit
endif
@ i = 0
while ($i <= 3)
@ j = 0
while ($j <= 3)
ndfcopy in='file('${i}','${j}',)' out=file_${i}_${j}.sdf
./cubecopy file_${i}_${j}.sdf file_cc_${i}_${j}.sdf
ndf2fits file_cc_${i}_${j}.sdf file_${i}_${j}.fits encoding="fits-class"
echo "Finished file_${i}_${j}.fits"
@ j ++
end
@ i ++
end

The size of a cube and pixel bounds can be found with the kappa command ndftrace, e.g.
Dimension size(s): 45 x 45 x 2048
Pixel bounds : -23:21, -23:21, -1024:1023

to CLASS

These files can be converted into class format

%class
LAS90>file out jcmtdata mul (or sin)
LAS90>fits read file.fits
(or alternatively)
LAS90>fits read "/dir/subdir/file.fits"
LAS90>write n

(note: if the scannumber is missing in the fits header one needs to give a number when writing to the output file, or it will be put to 1)

If you have large maps it is useful to do the conversion to class format with a commandfile, e.g.
%ls *.fits > files.class
and then edit files.cfits with your favourite editor from
file.fits
to
fits read file.fits
write 1
etc
then
%class
to start class

LAS90>@files.class

Problems

Currently there are some problems with the FITS files converted in this way.
Some header variables don't have the expected name in the FITS files. To correct this, enter in CLASS before reading the file:
LAS90> sic\symbol OBSNUM NUMBER
LAS90> sic\symbol MEDTSYS TSYS
LAS90> sic\symbol EXP_TIME OBSTIME
LAS90> sic\symbol LINE NOTAKEY
LAS90> sic\symbol MOLECULE LINE
Note: The scan number is missing (and put to 1 by class) when the ACSIS spectrum is the sum of many spectra.
There is a FITS keyword LINE, but it is empty.

Other header parameters which are missing are:
tau (not calculated for ACSIS data)
weather parameters
beameff
forweff
All class spectra will have the observed position in the header (offsets are 0 0 for every position in a map).
So in class one may want to modify the positions:
In order to do that one has to modify the projection to 'none' (0).
set var pos wr
let proj 0
modi pos hh:mm:ss.ss dd:mm:ss
However in the current class version (oct09a) there is a bug - the resulting RA offset is 24h too large.

Because of limitations of the CLASS headers, observations made with very large radial velocities will have incorrect velocities and velocity resolutions in CLASS. It is recommended in such cases to observe with a calcalated sky frequency and velocity 0 km/s.

For help within class, greg, etc type help, or look at the GILDAS homepage.

In the newest version of Greg/Graphic the Explain command is not working. Here is a list of available tasks (run task).

Jan Wouterloot

Contact: Per Friberg. Updated: Fri Oct 23 15:45:12 HST 2009

Return to top ^