| velocity | fabry | velocity |
velocity -- construct velocity maps from the fabry-perot image cube
velocity cube_image root lambda_rest
Each pixel in the image cube can be associated with a wavelength defined by its position in the x,y plane, and the parameters for the band: etalon gap, x-shift, y-shift, lambda-0, and the x,y centers for the calibration ring for that band, and the dispersion coefficients A, B, and C. (Actually A is replaced by the band lambda-0).
A spectrum is constructed by extracting the congruent pixels from each band, and deriving their wavelengths. This spectrum is then sky subtracted using the sky values from the image header, and normalized using the normalization factors in the image header. The corrected spectrum is fit to a Gaussian funtion in which the parameters: continuum level, peak intensity, and central wavelength are derived. The central wavelength is compared with the parameter "lambda_rest" to calculate a velocity. Since the fit may fail to converge (a non-linear least squares solved by the differential technique), the values are all set to a BADPIX value. Should a solution be found, a second attempt is made, but adding a fourth parameter, velocity width (the sigma of the Gaussian). Should this fail to converge, the first attempt is resurrected. If either fit should succeed, the formal errors of the fit are also computed.
At the option of the user, if the error in velocity exceeds the "v_limit" parameter, the fit may be recomputed using a spectrum now derived by averaging the intensities from the "navgx" by "navgy" pixels. Or if no fit could be found, the same option to refit can be selected by setting the "block" parameter to yes. Either of these options doubles the compute time since the fit must be recalculated for that pixel. But since, in general, most pixels have little signal and produce no answer, the use of block=yes, can double the time for the entire calculation, to analyze the least useful pixels.
The user may select to fit a subsection of the image by specifying the corners of the image area of interest: x1, x2, y1, y2. If the user has extracted a subsection of the original data cube, then the pixel coordinates no longer refer to those defined by the calibration image, and the parameters "x_offset" and "y_offset" must be specified, or the computed wavelengths will be shifted.
The output from the fits are stored in 8 new pictures for the velocity, velocity dispersion (sigma), peak intensity, and continuum intensity, and their associated errors. These are pictures of type REAL, and will have image names built from the parameter "root", and having suffixes of "vel","vdi","int", and "con" for the 4 pictures just described, and their errors "eve","evd", "ein", and "eco". So a root name of ngc300 will lead to pictures of ngc300vel, ngc300vdi, and so forth.
The value chosen for BADPIX is EPSILONR - the minimum machine discernable difference from 1.0. This is very close to 0.0 on the scale of most velocities, and so does not disturb plots or displayed images, but may still be tested in an IF statement, and is differentiable from a true 0.0. Maybe BADPIX=0 would be just as good.
By setting the "plot" parameter to yes, plots of the spectra at each pixel are generated, along with the derived Gaussian fit. The plots are packed 25 per frame, and labeled by pixel, the derived central wavelength, the derived sigma in km/s, and the number of pixels block averaged to generate the spectrum.
The plots are written to a metacode file so that when vast quantities of plots are generated (a 100x100 image generates 10,000 spectra, and 400 pages at 25 per page), the user may select from a directory which pixels are of special interest. The GKI tools in the plot package, in particular, GKIDIR, GKIEXTRACT, and GKIMOSAIC, may be used to plot the few interesting frames.
The metacode file is assigned a name by the user, and requires typically 2000 bytes of storage per spectrum. (Note that a 100x100 image would require 20 Mbytes to store the plots!) The file assigned to "dir_plot" simply identifies the ranges of pixels plotted on each frame of 25 plots.
Note also that plot generation roughly doubles or triples the total execution time for the analysis, and so plotting is recommended for only those regions of special interest.
Analyze the cube to produce a velocity map ngc224vel, and block average the pixels to 5x5 if the error in velocity exceeds 30 km/s
cl> velocity cube224 ngc224 5006.85 v_limit=30 navgx=5 navgy=5
Plot the spectra from the region near the central 32x32 pixels of a 256x256 cube.
cl> velocity cube224 ngc224 5006.85 v_limit=30 plot=yes
>>> dir_plot=pdir meta=mcfile y1=241 y2=272 x1=241 x2=272
Each pixel requires roughly 0.1 seconds for a cube having 10 bands. If the options block=yes, or v_limit=(small value) are employed, then this time may double. The time may double yet again if plot=yes is also selected.
The parameters navgx and navgy should be odd numbers: 3, 5, 7 ...
GKIMOSAIC, GKIEXTRACT, GKIDIR