Image Reconstruction with MATISSE
A guide for the intrepid traveler in Fourier space
Rainer Köhler
March 2014
This is an attempt to help others follow my experiments with image
reconstruction from (simulated) MATISSE data.
If you don't know anything about infrared interferometry, or that
MATISSE is an instrument for the VLTI, then you've come to the wrong
place.
Introduction
My tools are an interface between
Walter Jaffe's MATISSE simulator and
Eric Thiebaut's MiRA program for image reconstruction.
This guide describes where to get the necessary pieces and what to do
with them.
Installation
To install MiRA, you have to install a few other packages first.
I have create a tar ball that should contain everything you need:
Mira-complete.tar.gz.
After unpacking the tar file, you have to install the packages one by one:
- Yorick:
cd to dhmunro-yorick-e974bcc and follow the installation
instructions in "README.md"
They tell you that "make install" should be enough.
The executable will be in relocate/bin/yorick.
To make running it easier, I created a symbolic link from a
directory in my path to it.
- Yeti:
Go to yeti-6.3.2 and read the README file.
The following commands should do the trick:
yorick -batch ./config.i
make
make install
- OptimPack:
Installation instructions are in OptimPack-1.3.2/README.
For MiRA, you only need support for yorick, so the commands for the
installation are:
cd OptimPack-1.3.2/yorick/
yorick -batch make.i
make clean
make
make install
For more information, read the instructions on the
OptimPack page, in the section "Yorick Installation".
Note that you don't need the LBF... algorithms.
- MiRA itself:
You don't have to compile anything, unpacking the tar-file was enough.
MiRA will allow you to reconstruct images from data stored in files in
oifits-format.
You will probably want a tool to simulate data coming from MATISSE:
- MIA+EWS:
Walter's simulator is based on our data reduction software for MIDI:
Download MIA+EWS
You must download the latest daily snapshot, anything else is
just not shiny enough.
You don't have to install the full package, since the MATISSE
simulator requires only the IDL-routines. To set up those, it is
enough to unpack the tar-file, go to the directory created, and
type make startup. This means you can also install it
on Mac OS without any modifications.
- Walter's MATISSE simulator:
The link to download the simulator is at the bottom of the
download page for MIA+EWS.
A user guide can be found
here.
Now you will probably want to download
my routines to bring everything
together (last update: 28-mar-2014).
Create a directory for it, put the tar-file there, and
extract its contents with tar xvfz matisseImgReco.tgz.
As a final installation step, you have to tell my routine where you
installed MiRA on your computer. To do this, open "mira.pro" with a
text editor. Change the definition of "mirapath" in or near line 26 to
the full path of "mira.i" on your computer.
Operation
Once you installed everything, you can start it up:
- Start MIA+EWS by typing mia (if it is in your PATH)
or the command that was printed when you installed MIA+EWS.
- Change to the directory where you installed Walter's
simulator:
cd,'/path/to/simulator'
- type @setup to setup the simulator.
- Change to the directory where you installed my routines:
cd,'/path/to/Rainers_stuff'
(You can install my routines in the same directory as Walter's
simulator, in which case you don't have to switch directories.)
- type @setupIRec to setup my routines.
Now everything should be set up and ready to go.
You might be able to simplify the last 4 steps by combining the
setup-scripts into one big startup file. However, be careful to
get the paths and the order of compilation right!
To simulate MATISSE observations, refer to
Walters user guide.
The final result should be a set of files with calibrated
visibilities, squared visibilties, and triple products. These are
usually named "...CalVis.fits", "...CalVis2.fits", and "...CalT3.fits".
You can now try to run an image reconstruction with
mira,'bla.LMCalVis.fits',3.2e-6,'bla_test'
This will create a file "bla_test.i", which contains yorick-code to
run mira with some (more or less reasonable) default parameters.
To spare you direct contact with yorick, it will also run the script,
which will hopefully create two files named "bla_test_reco0.fits"
and "bla_test_reco1.fits". These are the images reconstructed by two
consecutive runs of MiRA. The number 3.2e-6 is the wavelength of the
data used for the image reconstruction (in meters).
Test Script
I have provided an example to demonstrate how an image can be
reconstructed successfully. To run it, go to the directory "testimg"
and execute the script:
@testimgN
This script will first run Walter's simulator to simulate observations
of the science target and the calibrator, and then call mira twice.
The first run uses the regularisation "total variation", the second
run uses "smoothness". Both contain three iterations with different
values of the hyperparameter mu.
The input image is "F5513bb.fits", the reconstructed images are called
"*_reco1.fits" to "*_reco3.fits".
The Details
This section is a reference manual for my routines, with explanations
of all the options.
clone_image
The simulator needs at least four images at different wavelengths, in
order to interpolate the spectrum of the source.
Since image reconstruction is (so far) only monochromatic, one usually
has only one image for the simulation.
This routines clones the image a few times and puts the LAMBDA keyword
in the header.
The cloned images will make the simulator run happily.
- SYNTAX:
clone_image, input.fits [, output [, list_of_wavelengths]]
[,FLUXFACTOR=ffac] [,PIXSIZE=pixsize]
- INPUT:
Name of an image in fits-format.
- OUTPUT:
One fits-file for each wavelength given.
- PARAMETERS:
input.fits | name of the input-file in fits-format |
output |
name of the cloned images.
The wavelength and ".fits" will be appended.
If output is not given, the names will be derived from the
input filename. |
wavelengths |
a list of wavelengths in meters to put into the
fits-headers.
If the list is not given,
(2.0, 2.8, 3.6, 4.5)·10-6 meters will be
used. |
FLUXFACTOR=ffac |
Factor to scale the flux in the image |
PIXSIZE=pixsize |
Pixel size to put into the header, in mas/pixel.
Default is 1 mas/pix. |
- EXAMPLE:
clone_image, "image.fits"
merge_V2T3
Merges files containing OI_VIS2- and OI_T3-tables into one file with
both tables. This is necessary because MiRA requires all tables in
one file.
- SYNTAX:
merge_V2T3, vis2fname, t3fname [, v2t3fname]
- INPUT:
Names of two files in oifits-format with OI_VIS2 and OI_T3 tables.
- OUTPUT:
One file in oifits-format with both OI_VIS2 and OI_T3 tables.
- PARAMETERS:
vis2fname |
name of the input-file with the OI_VIS2 table |
t3fname |
name of the input-file with the OI_T3 table |
v2t3fname |
name of the output-file. If omitted, the name will be
derived from vis2fname. |
- EXAMPLE:
merge_v2t3, "mice.LMCalVis2.fits", "mice.LMCalT3.fits"
- NOTE:
Make sure both input files contain the same OI_WAVELENGTH,
OI_TARGET, and OI_ARRAY tables. This is the case if both
files were produced by the same run of the MATISSE simulator.
If the tables are not the same,
the output file will be garbage!
mira
The IDL-routine "mira" is actually just an interface to the
yorick-program "mira". Its main purpose is to create a yorick-script
and run it, which will save you from learning to write yorick code.
- SYNTAX:
mira, input, wavelenght, output[, options]
- INPUT:
Name of a file in oifits-format.
For the MATISSE simulations, we decided it should contain an
OI_ARRAY table with all the stations on Paranal, an OI_TARGET
table, an OI_WAVELENGTH table, and either an OI_VIS table with
complex visibilities or two tables OI_VIS2 and OI_T3 with
squared visibilities and triple products.
NOTE: all observations have to be in one file!
- OUTPUT:
A text file containing the output printed by mira to the
terminal.
One FITS file with the reconstructed image for each value of
mu passed via the keyword parameter (see below).
- PARAMETERS:
input | name of the input-file in oifits-format |
wave | wavelength of observations in meters |
output | name for the output files (without extension) |
REGULARISATION=regularisation |
name of the regularisation algorithm
(see Mira documentation for possible values) |
MAXITER=maxiter | maximum number of iterations |
PIXSIZE=pixsize | pixel size in milliarcsec |
IMGSIZE=imgsize | size of reconstructed image in pixels |
MU=mu |
array of hyperparameter mu for series of mira-runs.
For each number in the array, one image will be
reconstructed and written to a FITS file.
The reconstructed image is used as starting point
for the reconstruction with the next value of mu. |
/NOWAIT |
Do not wait for the user to press return before starting
and quitting mira |
/NOWISH |
Do not use wish to manage the graphics windows |
More parameters will be added later.
- EXAMPLE:
mira, "observations.oifits", 10e-6, "image", REGUL="smoothness", MU=[1e10,1e9,1e8]
plotUV
This routines plots the uv-coordinates of the data points stored in
one or more oifits-files or the OBlist-files used by the simulator.
(It supersedes the routine plotUV_oifits, which could read only oifits-files).
- SYNTAX:
plotUV, filenames [, DEC=dec] [,/VERBOSE] [,OUTFILE=outfile] [, PLOT_OPTIONS]
- INPUT:
Name(s) of oifits-files (with OI_VIS, OI_VIS2, and/or OI_T3 tables) or OBlist-files.
- OUTPUT:
Plots of uv-coordinates on the screen or in a Postscript-file.
- PARAMETERS:
filenames | Name(s) of the input-file(s). |
DEC=dec |
Gives the declination for the object (only used for OBlist-files). |
/VERBOSE |
Option to activate printing of error messages. |
/NoFrameNo |
Use crosses instead of frame numbers as plot symbols. |
SYMBRIGHT=symbright |
Set brightness of plot symbols (between 0.0 and 1.0).
When plotting to a postscript file, this number will be
multiplied by 0.4 |
WAIT=time |
Wait time seconds after plotting the points for one baseline. |
OUTFILE=outfile |
Name of a Postscript-file where the plots will be written.
One page will be generated for each input file. |
PLOT_OPTIONS |
Any additional arguments will be passed on to the plot-command.
This can be used, e.g., to set the XRANGE or YRANGE of the plot. |
- EXAMPLES:
plotUV, ["mice.LMCalVis.fits", "mice.LMCalVis2.fits", "mice.LMCalT3.fits"]
plotUV, 'oblistN.star', DEC=-42