Map
Robert Estalella
Map. Version 23.04
Description
Map is a simple, interactive program written in Fortran 90, using the PGplot Graphics Subroutine Library to plot maps, in color scale and contours, and annotate them with labels, lines, boxes, arrows, and centered symbols. New versions (starting 22.05) have a graphic interface using the widgets of the DISLIN library (see some examples below). The distribution tar file can be downloaded here.
Reads/writes images in FITS and ASCII formats.
Up to 3 overlay images (in FITS format) can be drawn with contour lines.
Can take the axes scale from the header of the FITS files.
Plots can be saved to (and retrieved from) an ASCII file, <filename>.map, fully commented. The map file can be edited to fine tune the plot (see an example of a map file).
The graphic output is in form of an eps or pdf file, map.eps or map.pdf (landscape or portrait, A4 or a custom size).
Map limits, position of objects, boxes, etc, can be set with the mouse, or entered as coordinates with the keyboard.
All positions can be given in pixels or world coordinates.
Three different palettes for color scale: gray, flame, rainbow.
User defined objects that can be drawn onto the plot: rectangular boxes, arrows (with an optional error ellipse at its tip), centered symbols, text labels, multipoint lines, circular arcs, beam. The style (size, line width, line style, color, background color) of each object can be set.
FITS data cubes maps: plot of channels maps; plot of single pixel, box-averaged, and elliptical-rings-averaged spectra; PV cuts; 0th, 1st and 2nd order moments calculation and plot.
Image analysis available: read and show map positions; distance and position angle measurement; peak position estimation; box, polygonal, or elliptical rings statistics; straight or polygonal slices.
Image transformations: 2D Gaussian fitting and deconvolution from the beam; adding or subtracting a Gaussian source to the map; intensity linear transformation; primary beam correction; Gaussian smoothing.
Requisites
Linux system.
Fortran 90 compiler: gfortran is assumed, but other compilers can be used.
DISLIN library, and the file dislin.mod (included in the distribution tarball).
PGplot Graphics Subroutine Library.
The library has to be installed from the Linux repository. If the library is compiled locally, the program can crash in some computers. Remove old installations of PGplot and install the library. For an Ubuntu system:
$ sudo apt-get install pgplot5
Mac users can find a guide for installing PGplot on Mac OS X in mingus.as.arizona.edu/~bjw/software/pgplot_fix.html or a local copy of the page pgplot_macosx.
Font packages xfonts-base or xfonts-100dpi
The DISLIN widgets use a monospace font, specified in the configuration file map.conf. If necessary, install the packages containing the fonts. For an Ubuntu system:
$ sudo apt-get install xfonts-base xfonts-100dpi
Installation
Download the tar file map.tgz and untar it in your installation directory, for example /usr/local/map
$ sudo mkdir /usr/local/map
$ sudo mv map.tgz /usr/local/map
$ cd /usr/local/map
$ sudo tar -xzvf map.tgz
Run the script map_compile
$ sudo ./map_compile
In some systems you may need to tune the script map_compile to include the location of the X11, pgplot, or dislin libraries. This can be made by adding the option -L with the folder containing the library. For example,
-L/usr/X11/lib -L/usr/lib
Make a symbolic link to the executable from a directory in your path, for example /usr/local/bin
$ sudo ln -s /usr/local/map/map /usr/local/bin/
Define the environment variable MAP_DIR, pointing to your installation directory. It is used by map to find the help and configuration files, map_help.txt. and map.conf. This can be done by adding to your .bashrc or .bash_profile the following lines:
# map
export MAP_DIR=/usr/local/map
Test the program by running, in the installation directory,
$ map test.map
If you get at run time the error
>>>> Font cannot be loaded!
change the font in the first line of the configuration file map.conf to another monospace font. Several suggestions are given in the file. You can also check that the longer help messages fit in the screen. If not, set a lower number in the second line of the configuration file.
Usage
$ map [<file>.fits|<file>[.map]]
Help is available for each menu.
Maptoeps is a complementary application that reads a map file <file>.map and plots to <file>.eps, without xwin graphic output, so it can be run remotely. Additionally, it can crop the map at any of the four sides of the PGplot window, useful for stacking different maps.
Usage
$ maptoeps [-b xXyY|-p|-l|-h] [<file>[.map]]
Options
-b xXyY: Crop to PGplot box, x= xmin, X= xmax, y= ymin, Y= ymax. For example, -b yY crops a plot to be stacked vertically.
-c xXyY: Same as -b
-p: Portrait (vertical, default)
-l: Landscape (horizontal)
-h: Help
The extension .map can be omitted.
Examples
Examples of the graphic interface of map:
Examples of plots made with map: