(N.B. A first version of a requirements document was drafted by Simon Garrington towards the end of 2005: wideband_reqs.pdf)


Author: I M Stewart, lately of JBCA, now at the University of Cape Town.

Date: 2009-01-15

Description: this document explains the various files in this repository: ims_albus_modules.tar.gz.

1. Description:


The accompanying files in this repository are mostly python modules (1 or 2 are perl scripts). Their overall purpose is to clean (or deconvolve) images made by a radio interferometer operating with a bandwidth which is a significant fraction of the base frequency. The algorithm employed is described in the following publication:

2. General information:


2.0. Copyright and disclaimer:



2.1. A list of all files included in the repository:



2.2. How to set up the python modules:


Each module has a name of the format <prefix>_<version number>.py. However when importing one module into another, I nearly always omit the version number. Eg a module which has a file name "bloggs_9.py" appears when imported into another module via "import bloggs".

2.3. Additional required python modules or other packages:


3. What you can do with the available modules:


The python modules are grouped as follows. I have suppressed the version number and 'py' suffix. I've also indicated whether the module is meant to be run as a stand-alone task, and whether the module has received (sometimes basic) testing. Finally I indicate those tasks or modules which should be run in the ParselTongue environment.

3.1. Utilities


pgview_pkl

TASK

TESTED

pkl_to_fits

TASK

TESTED

fits_to_pkl

TASK

TESTED

rgb_pkls_to_fits

TASK

-

'Pickle' refers to the format python uses to write a generic object to file.

3.2. Miscellaneous libraries:


ims_utils

TESTED

mylib

TESTED

pgplot_aux

TESTED

ranges

TESTED

fits_wcs

TESTED

gram_schmidt

TESTED

SciMathConstants

TESTED

3.3. Libraries relevant to interferometry:


aips_lib

TESTED

Parseltongue

array_geom

TESTED

clean_comps

TESTED

gridding

TESTED

myaipslib

TESTED

Parseltongue

3.4 Simulations of AIPS-format wide-band visibility datasets:


aips_image_utils

TESTED

To those not familiar with object-oriented programming, the following three modules may seem a little arcane:

bin_tree

TESTED

bin_tree_file

TESTED

aips_desc2data

-

Parseltongue

The reason for writing them in this OO fashion is to preserve, at each stage, as much generality as possible.

The first module, bin_tree, is intended to implement a procedure for constructing a composite object from a list of component objects. This binary-addition procedure is, under certain conditions, more efficient than simply sequentially adding the list elements. The nature of the objects is left completely generic: all that is specified is a few simple properties they must possess.

The second module, bin_tree_file, is an example of how the objects manipulated within bin_tree may be implemented (there are of course an unlimited number of ways one could implement them). The nature of the objects is still kept as generic as possible but they are intended to behave like disk files.

The third module, aips_desc2data, finally gets specific: it describes in exact detail one way of describing and constructing the vague file-type objects of bin_tree_file. Here the objects are AIPS visibility datasets in a certain range of frequency channels.

All this machinery is put together in the task which produces the output:

uvncon

TASK

-

Parseltongue

3.5 Simulations of (non-AIPS) wide-band dirty images:


sim_grid

TASK

TESTED

This makes gridded beam visibilities (GBVs) for several (at present hard-wired) array- and observation parameters.

do_fft2d_c2r

TASK

TESTED

Ffts each GBV to give a sky-plane beam.

sim_make_DI

TASK

TESTED

This uses a (at present hard-wired) set of clean components, plus beam files read in from the command line, to construct a simulated dirty image (DI).

sw_tester

TASK

TESTED

This reads the (pickled) dirty image and beams which have been created by the previous three modules, then calls and applies the S-W algorithm in module sw_clean. The output is a (pickled) list of clean components. You can use the utilities described in section 3.8 to display resulting images.

3.6 The Sault-Wieringa core modules:


sw_array_defs

TESTED

sw_clean

TESTED

Initially it was intended to employ AIPS tasks to perform even simple arithmetical operations on images. It was desired to retain the ability to apply the same S-W algorithm code to either AIPS-format images or (for easier testing purposes) python numpy-format image arrays. The specification of the nature of the 'image' object was thus not tied down within the module sw_clean but was intended to reside in a separate module. The crude initial implementation of this had one auxillary module to define the AIPS images and another to define the numpy ones. The idea to use AIPS was abandoned (because of disk I/O overhead), thus only the array definer remains. It would probably be simpler to dispense with much of the amiguity which remains within sw_clean.

In addition to the usual symlink to sw_array_defs_<vers>.py you should also, in the same directory, set up a symlink as follows:

3.7 Machinery to apply the S-W algorithm to real data:


Here is more OO-style separation of powers. The function of the modules in this section is to generate S-W dirty beams for real UV data. Expansion of the spectrum and/or the time series in one of several sets of basis functions is supported. (S-W discuss only Taylor expansion of the spectrum but their method is readily generalised.) The user runs form_dirty_beams, and all the machinery is taken care of within the classes defined in the other modules. There are two lots of complicated business which it is desirable to farm out in this way: (i) the detailed description of the set of visibilities (or, more exactly, the positions of these visibility samples in the UV plane) which is to serve as a template for the various beams; plus the construction of the beams from this template; and (ii) the description and implementation of the basis functions themselves.

I am not satisfied with the logic of the 'chunking' as I have written it. I have no doubt that a programmer with more experienced of OO could do a better job.

basis_fn_types

TESTED

basis_functions

TESTED

beam_uv_template

-

Parseltongue

form_dirty_beams

TASK

-

Parseltongue

3.8 Tasks which process S-W output:


cc_im_make

TASK

TESTED

Takes the output of sw_clean and creates an image of the clean components.

cleaned_im_plot

TASK

TESTED

Takes the output of sw_clean and cc_im_make and plots a residual image and a total image.

4. Perl scripts:


Supplementary perl scripts are provided as follows:

fitsdisplay_1.pl

This is a translator of FITS to ASCII.

fits_card_replace_2.pl

This script is called by beam_uv_template to fix the FITS files written by FITAB.

5. TODO:


WideBandImaging (last edited 2009-03-13 15:55:21 by MikeSipior)