Importing Data from MIRIAD: Difference between revisions

From CASA Guides
Jump to navigationJump to search
No edit summary
m (moved Importing Data from MIRIAD to importing Data from MIRIAD: Converting page titles to lowercase)
(No difference)

Revision as of 16:43, 16 March 2012


CARMA Tutorials


Note: A filler routine is currently being developed to convert native MIRIAD format data into a CASA measurement set, but it has not yet been completed. The following steps describe how to use FITS format files to transfer CARMA data into CASA, and should still be useful even when the filler is operational. At that time, a description of how to use the CARMA filler routine will be added to this page.


Assumptions:

1. You have MIRIAD installed on your computer.

2. You are running the MIRIAD commands shown on this page in a shell script (csh), with a number of variables defined at the top of your script (see below).

3. The original MIRIAD dataset is in a separate subdirectory called "rawdata" which is at the same level in the directory tree as your current directory.


This example uses a single track from the CARMA STING observations of NGC4254 (M99); more details of the observations and analysis of this galaxy can be seen on the CARMA STING webpage and in Rahman et al. (2010, in prep.), respectively. The dataset can be downloaded here:c0104I track. (Click the little white box next to "Data File", and click "Submit" at bottom right. Follow the instructions on the next page that appears to download the dataset.)


You can extract all of the CASA commands shown on this or any other CASAGuides page into a python script which you can run in CASA. However, the MIRIAD script commands will not be extracted, so you'll need to save these on your own. See Extracting scripts from these tutorials for more information.


For this example, the following items would be defined at the beginning of the csh shell script:

# in MIRIAD csh script

#!/bin/csh
# FILE = name of original, raw MIRIAD-format file
set FILE="../rawdata/c0104I.8D_115NGC4254.2.miriad"
# PROJECT = base file name for processed data files
set PROJECT="c0104I"
# ANTPOS = the location of the file which contains updates to the CARMA antenna positions
set ANTPOS="../antpos.YYMMDD"

Preparing MIRIAD data for export to FITS

To minimize the data you are transferring over, select only the astronomically useful data:

# in MIRIAD csh script
uvcat vis=$FILE  select='-source(NOISE),-auto' out=$PROJECT.vis

If you need to apply an update for the antenna positions, or linelength corrections, you should do these before exporting to FITS. Note: you only need this next step if you actually have an ANTPOS file.


To update antenna positions (optional):

# in MIRIAD csh script
uvedit vis=$PROJECT.vis out=$PROJECT.ant apfile=$ANTPOS


It's definitely a good idea to correct the linelengths. To apply linelength corrections:

# in MIRIAD csh script
linecal vis=$PROJECT.ant
uvcat vis=$PROJECT.ant out=$PROJECT.lc

Currently, MIRIAD writes out the identity of the array as identified by Antenna 1, which is a formerly-OVRO antenna. Thus, without correction, the dataset will identify the array as OVRO rather than CARMA, which means that CASA will make the same mistake. To fix this problem, simply do a small header edit:

# in MIRIAD csh script
puthd in=$PROJECT.lc/telescop value=CARMA

One last recommendation for preparing the data: it is still valuable to do some initial hanning smoothing to dampen ringing in the bandpass. (This was still true, at least, for data taken in summer 2009.)


To hanning smooth:

# in MIRIAD csh script
uvcal vis=$PROJECT.lc options=hanning out=$PROJECT.hann

Writing out the FITS files

Now you should be ready to write out your CARMA visibility data. You will need to write out each spectral window as a separate FITS file in MIRIAD, and then concatenate them back together within CASA. In your shell script, just use a "foreach" loop.

In this example, I am writing out the upper sideband windows only (windows 4,5, and 6). This loop produces one file for each spectral window, including data from all sources observed with that window.

# in MIRIAD csh script
foreach i (4 5 6)
    fits in=$PROJECT.hann op=uvout select="win($i)" out="./fits/$PROJECT.$i.fits"
end


CARMA Tutorials
CASAguides


Last checked on CASA Version 3.0.1 (r10803).

--Michele Thornley