Sanity tests

Jump to: navigation, search


Sanity Checks

Here we will quickly go over some commands to test basic functionality of miriad: getting the data into miriad and displaying this data using pgplot routines. We also suggest to install ds9 and the associated XPA tools. Although mostly for images and cubes, it can also be used to browse your visbility data bricks. An additional, image cube visualization package we recommend for Miriad is karma

X windows and your OS shell

Linux uses the X11 windowing system, on the Mac this is an option and you need to have it installed via Xcode. Although in principle you can operate out of X windows, you probably should have it. Test it:

 % xterm

You should also check what your default login shell is. It should be sh (most likely bash) or csh (most likely tcsh). The examples below, where they matter, are using csh-style. Notably on MacOSX there are two ways you have to set your login-shell (Terminal->Preferences and xterm w/ chsh)  !! need to verify this statement !!

Notably how you start MIRIAD depends on your login shell:

 % source miriad_start.csh

for the csh family, and

 $ source

for the sh family.

Image Data and Display

Generating an image and displaying it in miriad:

 % imgen out=map0
 % hexdump -C map0/header | tail
 000001c0  6e 61 78 69 73 00 00 00  00 00 00 00 00 00 00 08  |naxis...........|
 000001d0  00 00 00 02 00 00 00 02                           |........|

The important thing to note is the last line, if endianism is wrong on your machine, the last 4 bytes might read as 2,0,0,0 instead of 0,0,0,2. As in FITS files, data in miriad are stored in a big-endian fashion, which means on intel chips (little-endian) data will need to be byte swapped.

Now display the data using ds9:

 % implot in=map0 device=/xs
 % ds9 &
 % mirds9 map0

And to make sure your random number generator works:

 % imgen out=map1 object=noise spar=1
 % histo in=map1 | grep Rms
 Mean -3.29890E-04 Rms  9.99046E-01 Flux -2.16197E+01 Jy (65536 points)

Image Data and Display (advanced)

There are two packages developed outside of MIRIAD that are useful and popular for visualizing images and cubes: ds9 and karma. The latest binary releases will have them included, and here's how you can test them:

 % ds9 &
 % mirds9 map0

and you should now see your little gaussian blob in ds9. As of version 7.0 of ds9, you can also visualize cubes in 3D.

The karma package consist of a number of tools to slice and dice datacubes, but to just visualize a 2D image the kvis program will do for now:

 % kvis map0

This package is not well maintained anymore, on your particular platform you may find missing shared libraries. Don't worry if this part of the test gives errors.

Visibility Data and Display

Getting a Carma visibility dataset from the archive and displaying some basic properties of the data. The example below is a small example dataset from our anonymous ftp, it is 0.5MB in size. It is also available from the official CARMA data archive.

Here are some Unix command line examples to grab them (assuming you have one of those programs installed):

 % wget -O - | tar zxf -
 % curl | tar zxf -
 % itemize in=fringe.3C273.2008jun18.4.miriad
 itemize: Version 1.4, 2008/02/19 20:06:29 UTC
   obstype  = mixed-auto-cross
   nwcorr   = 6552
   ncorr    = 98280
   vislen   = 545232
   wflags     (integer data, 212 elements)
   vartable   (text data, 650 elements)
   history    (unknown data, 0 elements)
   visdata    (binary data, 545228 elements)
   flags      (integer data, 3171 elements)

On MacOSX (not sure intel, ppc or both, although it looks the same on an intel MacOSX running Leopard) the output of nwcorr/ncorr/vislen may look different, which is related to the compiler not able to print integer*8. This seems to work fine on linux (32 and 64 bit).

 % uvplt vis=fringe.3C273.2008jun18.4.miriad device=/xs

and a plot should appear on your screen that will page you through some phase as function of time for many baselines.

 % uvio fringe.3C273.2008jun18.4.miriad  > flux.log

you can inspect this file. It should contain lines from

  0x00000000 FILE: (null)
  0x00000000 SIZE: airtemp   Count=1,Type=r
  0x00000008 DATA: airtemp            25.66670036
  0x00000010 SIZE: antaz     Count=15,Type=d
  x00000018 DATA: antaz              125.0117534
  0x000851a0 DATA: coord              46.79749408
  0x000851c0 DATA: baseline                  3599
  0x000851c8 ========== EOR (1092) ========

Fringe Mapping Test

Run the command

 % $MIR/install/mir.fringe

which will fetch that beforementioned fringe dataset, and run a standard mapping and compare the result of the mapped point source against a reference map. At the end of the script it will show a histogram of the difference of the map created with your version of MIRIAD and the reference map. Although we would like this map to be all 0s, different compilers (even gnu g77 and gfortran) will show a map with RMS around 1e-2 (10 mJy/beam), viz.

HISTO Difference map:
Histo: version 21-oct-03
Finding image minimum and maximum
Object  3C273
Mean  1.24332E-04 Rms  9.19909E-03 Flux  1.68249E-01 Jy (65536 points)
Maximum value      4.689598E-02    at (129,130,1,1)
Minimum value     -4.326379E-02    at (41,224,1,1)
 Bin    Value          Number
      Underflow          0
   1 -4.326379E-02       8 *
   2 -3.762881E-02      23 *
   3 -3.199382E-02     137 *
   4 -2.635884E-02     679 **
   5 -2.072385E-02    2540 ******
   6 -1.508886E-02    6318 *************
   7 -9.453878E-03   11778 ***********************
   8 -3.818892E-03   15814 ******************************
   9  1.816094E-03   14347 ***************************
  10  7.451080E-03    8983 *****************
  11  1.308607E-02    3563 ********
  12  1.872105E-02    1104 ***
  13  2.435604E-02     197 *
  14  2.999102E-02      31 *
  15  3.562601E-02       9 *
  16  4.126099E-02       5 *
      Overflow           0

where the raw and cleaned maps have these statistics:

HISTO Dirty map:
Mean -8.187349E-04 Rms    1.44498E+00 Sum  -5.36566E+01 (65536 points)
Maximum value      1.735693E+01    at (129,129,1,1)
Minimum value     -2.607488E+00    at (184,185,1,1)
HISTO Cleaned map:
Mean  1.34632E-02 Rms  3.26697E-01 Flux  1.82187E+01 Jy (65536 points)
Maximum value      1.696329E+01    at (129,129,1,1)
Minimum value     -8.925390E-02    at (13,224,1,1)


The package is used for the new ALMA and VLA datasets, and will be interesting for CARMA users in two ways:

  • the casaviewer should be able to display MIRIAD images:
 % casaviewer map0
  • the carmafiller program converts MIRIAD visibility files to a CASA Measurement Set (their name for visibility data), so you can continue in CASA with mapping and deconvolution. Calibration is not recommended, you should probably do that in MIRIAD still.
 % carmafiller vis=vis0 ms=ms0

Note carmafiller is not available for mac yet, only linux.

WIP: a pgplot based plotting package

Give the following commands to see if you have your environment setup correctly:

 % wip -d /xs
 WIP> box
 WIP> end
 % wip -d /gif
 WIP> box
 WIP> end
 % wip -d /ps
 WIP> box
 WIP> hardcopy
 WIP> end
 % wip -d /xs
 WIP> image map0
 WIP> header rd rd
 WIP> halftone
 WIP> end

Be careful with that last example, the hardcopy command would spool your file to your default printer,unless you have modified your .wipinit file with something like

 set "print" echo Printfile in %s

or simply

 set print ignore

A final byteswapping test in from a miriad image:

 % wip -d /xs
 WIP> image map0
 WIP> header rd rd
 WIP> halftone
 WIP> end

should show just a blob in the center.

Software Development (old build)

  • Assuming your Miriad is CVS enabled (i.e. you will see the $MIR/CVS directory), you should test if you can update Miriad using cvs:
  % cd $MIR
  % cvs -nq update

If this failed with a command not found, cvs should be installed. Another failure mode is not having a ~/.cvspass entry for the anonymous access to the UMD cvs server. For this do:

  % cvs login                       (if it asks for a password, hit enter for anonymous access)
  % cvs -nq update
  • Testing to see if you can compile a subroutine or program, try these:
  % mirboss
  % mir.subs fitsio
  % mir.prog itemize
  • To update Miriad, you can update the source tree from its root:
  % cd $MIR
  % cvs update

now carefully watch files passing by on your screen. Any preceded with ? are ok, they are not in CVS control. But anything with M (locally modified) could be suspect, the U or P are files that were updated/patched, and a C is a disaster: a CVS conflict occured. You will need to resolve this, e.g. by renaming/removing the offending file, and updating that file again.

Software Development (new build)

The new build system should be easier to use and is normally installed under $MIR/build. The commands just take a bit longer. After a CVS update:

 % cd $MIR
 % cvs update

you should be able to test if the new code works:

 % make

and if so, install it

 % make install
Personal tools