Table of Contents


snapifu - take spectra from a snapshot at a set of specified grid points


snapifu in=snapshot out=image [parameter=value]


snapifu computes spectra, or reduces this to moments, in a number of predefined gridpoints, very simular to snapgrid(1NEMO) . The model behind this is Integral Field Units such as DensePak, SparsePak and Sauron.

The output image is written in standard image(5NEMO) format, where the X coordinates enumerates the grid points, the Y axis is dummy, and the Z axis the spectrum.


The following parameters are recognized:
input file, must be in snapshot(5NEMO) format. Multiple snapshots can be stacked uses the times= keyword: see stack= below. [no default].
output file, will be in image(5NEMO) format [no default].
Selection of the times of snapshots to be selected for gridding. For stack=t all snapshots will be co-added into one image, however selecting stack=f or selecting multiple evar’s one can request multiple output images. [Default: all].
A set of X (see xvar=) positions where spectra are taken. Use tabcols(1NEMO) if the grid points are hidden in a columns in a table. Default: 0.
A set of Y (see yvar=) positions where spectra are taken. Default: 0.
Size of the grid point. The shape of the point is circular, and the size is the diameter of this point. For square/recangular shapes, use snapgrid(1NEMO) .
The value of x-expression is gridded along the X axis. [default: x].
The value of y-expression is gridded along the Y axis. [default: y].
The value of z-expression is gridded along the Z axis (nz>1), or moments taken off (nz=1). [default: -vz].
Variable to denote emissivity per particle. You can select more than 1 expression, in which case different images will be written out (only in stack=f mode) [default: m].
Variable to denote the optical depth of a particle. [Default: 0]
Variable to denote the line of sight. [Default: z]
Range in zvar to bin, or take moments of [default: -infinity:infinity].
Number of pixels along the Z axis of the cube. If one pixel is choosen, moments can be taken (see below), else a simple gridding is used. [default: 1].
Order of the Z-gridding. Most commonly choosen are: 0 (total intensity), 1 (velocity zvar weighted intensity) and 2 (velocity square weighted intensity), where ’intensity’ should really be read as surface density per square unit length. Special values of -1 and -2 can be used to directly compute the mean and the dispersion from the mean. [default: 0].
Should the emission in a cell be averaged? This also controls the units of the gridding. For mean=f (the default) a surface-density is computed (emission per area), whereas for mean=t the average per
pixel is computed of the units of emission. [Default: f].
Should all snapshots from the input file be stacked, or write one image per selected (see times=) time? [default: f].


Units are maintained in the same way as in snapshots, they don’t have a specific name, but carry their normal meaning ’length’, ’velocity’ and ’mass’. Since snapifu calculates (surface/space) densities, its units are formally ’mass’ per square ’length’ times ’velocity’ to the power moment. Notice the mean= keyword, which prevents division by the (fiber) cellsize.

When channel maps are produced (moment=0), the data are not normalized w.r.t. the convolving velocity beam. For a rectangular beam (vrange=vmin:vmax) the data should formally be divided by (vmax-vmin), for a gaussian beam (vrange=vmean,vsig) by vsig*sqrt(2*pi). Also remember that a gaussian beam has FWHM = 2.355*sigma.


Combinations of large snapshots and large images may run into memory problems since both the snapshot and the image(s) must fit into memory to obtain turbo speeds. Use non-negative moments to avoid having to allocate one or two extra images in addition to the snapshot and the image.


If the grid points are hidden in the columns of an ASCII table, the tabcols(1NEMO) can be used to extract them directly into the xgrid= and ygrid= keyword, albeit perhaps somewhat ugly looking. Here is an example of taking a spectrum around each star in a 10-body Plummer sphere,
   mkplummer p10 10 seed=123
   snapprint p10 x,y >
   set x=(‘tabcols 1‘)
   set y=(‘tabcols 2‘)
   snapifu p10 p10.ccd xgrid="$x" ygrid="$y"

Currently the spectra are written to a CCD image where the 2nd axis is a dummy axis. There are least two ways to view these data. With ccdfits(1NEMO) you can write a fits(5NEMO) file and ignore the dummy axis, and then display it in your favorite display program

  snapifu p10 p10.ccd xgrid="$x" ygrid="$y" zrange=-2:2 nz=32
  ccdfits p10.ccd p10.fits dummy=f
  nds9 p10.fits
or use ccdsub(1NEMO) to reduce this axis for data that want a 2D image in the first two dimensions:
  ccdsub p10.ccd p10a.ccd dummy=f
  ccdplot p10a.ccd
  ccdprint p10a.ccd x= y=

See Also

snapgrid(1NEMO) , snaprotate(1NEMO) , snapslit(1NEMO) , snapccd(1NEMO) , ccdsub(1NEMO) , ccdprint(1NEMO) , image(5NEMO)


Peter Teuben


src/nbody/image      snapifu.c

Update History

8-apr-09    V1.0: Created    PJT

Table of Contents