https://casaguides.nrao.edu/index.php?title=Extracting_data_from_MIRIAD&feed=atom&action=historyExtracting data from MIRIAD - Revision history2024-03-28T14:30:48ZRevision history for this page on the wikiMediaWiki 1.38.6https://casaguides.nrao.edu/index.php?title=Extracting_data_from_MIRIAD&diff=3039&oldid=prevMthornle: Created page with 'Category:CARMA {{CARMA Intro}} <div style="background-color: #dddddd;"> '''Note:''' A filler routine is currently being developed to convert native MIRIAD format data int…'2010-05-14T18:46:07Z<p>Created page with '<a href="/index.php?title=Category:CARMA" title="Category:CARMA">Category:CARMA</a> {{CARMA Intro}} <div style="background-color: #dddddd;"> '''Note:''' A filler routine is currently being developed to convert native MIRIAD format data int…'</p>
<p><b>New page</b></p><div>[[Category:CARMA]]<br />
<br />
{{CARMA Intro}}<br />
<br />
<br />
<div style="background-color: #dddddd;"><br />
'''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.<br />
</div><br />
<br />
<br />
Assumptions:<br />
<br />
1. You have MIRIAD installed on your computer.<br />
<br />
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). <br />
<br />
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. <br />
<br />
<br />
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 [http://www.astro.umd.edu/~bolatto/STING/ CARMA STING webpage] and in Rahman et al. (2010, in prep.), respectively. The dataset can be downloaded here:[http://carma-server.ncsa.uiuc.edu:8181/asp/describe.cgi?pid=c0104I&obs=8D_115NGC4254&sub=&trial=2&pw=n 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.)<br />
<br />
<br />
'''Note:''' All commands on this page are MIRIAD commands, not CASA commands. Therefore, trying to extract a script from this page will result in an empty file. See [[Extracting scripts from these tutorials]] for more information on extracting CASA scripts.<br />
<br />
<br />
For this example, the following items would be defined at the beginning of the csh shell script:<br />
<br />
<source lang="bash"><br />
# in MIRIAD csh script<br />
<br />
#!/bin/csh<br />
# FILE = name of original, raw MIRIAD-format file<br />
set FILE="../rawdata/c0104I.8D_115NGC4254.2.miriad"<br />
# PROJECT = base file name for processed data files<br />
set PROJECT="c0104I"<br />
# ANTPOS = the location of the file which contains updates to the CARMA antenna positions<br />
set ANTPOS="../antpos.YYMMDD"<br />
</source><br />
<br />
== Preparing MIRIAD data for export to FITS ==<br />
<br />
To minimize the data you are transferring over, select only the astronomically useful data:<br />
<br />
<source lang="bash"><br />
# in MIRIAD csh script<br />
uvcat vis=$FILE select='-source(NOISE),-auto' out=$PROJECT.vis<br />
</source><br />
<br />
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.<br />
<br />
<br />
To update antenna positions ('''optional'''):<br />
<br />
<source lang="bash"><br />
# in MIRIAD csh script<br />
uvedit vis=$PROJECT.vis out=$PROJECT.ant apfile=$ANTPOS<br />
</source><br />
<br />
<br />
It's definitely a good idea to correct the linelengths. To apply linelength corrections:<br />
<br />
<source lang="bash"><br />
# in MIRIAD csh script<br />
linecal vis=$PROJECT.ant<br />
uvcat vis=$PROJECT.ant out=$PROJECT.lc<br />
</source><br />
<br />
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:<br />
<br />
<source lang="bash"><br />
# in MIRIAD csh script<br />
puthd in=$PROJECT.lc/telescop value=CARMA<br />
</source><br />
<br />
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.)<br />
<br />
<br />
To hanning smooth:<br />
<br />
<source lang="bash"><br />
# in MIRIAD csh script<br />
uvcal vis=$PROJECT.lc options=hanning out=$PROJECT.hann<br />
</source><br />
<br />
== Writing out the FITS files ==<br />
<br />
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.<br />
<br />
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.<br />
<br />
<source lang="bash"><br />
# in MIRIAD csh script<br />
foreach i (4 5 6)<br />
fits in=$PROJECT.hann op=uvout select="win($i)" out="./fits/$PROJECT.$i.fits"<br />
end<br />
</source><br />
<br />
<br />
[[CARMA Tutorials | &#8629; '''CARMA Tutorials''']] <br><br />
[[Main Page | &#8629; '''CASAguides''']]<br />
<br />
<br />
{{Checked 3.0.1}}<br />
<br />
--[[User:Mthornle|Michele Thornley]]</div>Mthornle