Image analysis using Miriad

The output of SKY is written in FITS format, which can be easily imported into most commonly used astronomical image analysis packages, such as AIPS, IRAF and IDL. This page gives a few hints on how to analyze the output using Miriad. For a complete introduction to Miriad, see here and/or here.
Assume hco+_4-3.fits is a synthetic image of the HCO+ J=4-3 line in FITS format. It is converted into Miriad format using the task `fits':

fits op=xyin in=hco+_4-3.fits out=hco+_4-3.sky





To compare the emission with observations made at, e.g., the JCMT, it is convolved to a  14-arcsecond beam using `convol':

convol map=hco+_4-3.sky out=hco+_4-3.cnv fwhm=14 scale=4.5e-3




The scale factor f ensures that flux is conserved in this process. It is calculated from the full width at half maximum of the telescope main beam B and the pixel size p using

 f = [ 1.13309 (B/p)2 ]-1

The factor pi / 4 ln 2 = 1.13309 makes up for the difference between a round beam and square pixels.The convolution program keeps the pixel size and velocity coverage and resolution of its input. Instead of specifying the FWHM of a Gaussian beam, a self-constructed, assumed or measured beam pattern can be used through the the keyword beam=, followed by the Miriad image containing the pattern.

The task `imspec' extracts synthetic spectra:

imspec in=hco+_4-3.cnv region='arcsec,box(20,10,20,10)' log=hco+_4-3.msp

In the example above, a spectrum at an offset of 20 arcsec East and 10 arcsec North from the image center is written to the file specified as ``log''. This file can be read by a plotting program, to compare the result to observation. The quotes in the region= keyword protect the parentheses from interpretation by the C-shell. Velocities are written to 0.1 km/s precision; use the command imspect if higher spectral resolution is needed.

The velocity-integrated intensity can be obtained from the spectrum using `moment':

moment in=hco+_4-3.cnv out=hco+_4-3.int

Task `imstat' gives the image minimum & maximum and other information:

imstat region='arcsec,box(0,0,0,0)' in=hco+_4-3.int





and `maths' is useful to add, subtract, multiply or divide images. This example calculates a line ratio, where the <> signs protect the + in hco+ from interpretation by maths, and the quotes prevent the C-shell from interpreting the <>.

maths exp='<hco+_4-3.cnv>/<hco+_3-2.cnv>' out=hco+_ratio.cnv




If dust emission was included in the calculation, it should be taken out before extracting line fluxes. The first method to do this uses a combination of Miriad and C-shell commands. After convolving the image to the desired resolution, store the number of channels and the channel width (km/s) in shell variables:

set nchan = 100
set chw = 0.2

then derive the continuum temperature:

set tc = `imspec in=hco+_4-3.cnv |& tail +12 |head -1 |awk '{print $3}'`

and subtract the continuum from every channel:

imspec region="arcsec,box(0,0,0,0)" in=hco+_4-3.cnv  |& tail +12 | head -$nchan |\
  awk '{s+=$3-tc}END{print s*chw}' tc=$tc chw=$chw
 

The second method subtracts the first channel from the others with Miriad, starting from SKY output:

imsub in=hco+_4-3.sky out=hco+_4-3.ctm region='image(1)'
maths exp='<hco+_4-3.sky>-<hco+_4-3.ctm>' out=hco+_4-3.sub options=grow

followed by beam convolution and spectrum extraction.