next up previous
Next: Quick-start Tutorial Up: XIMGFIT v0.999 Manual Previous: Installation

Overview of Commands

Within XIMGFIT, use the ``help'' command for some assistance, and also typing commands that require parameters without any parameters will produce some help information. Below is a list of the available commands. In addition to these, any system command can be executed by preceding it with a $, e.g., ``$ls *ximg''. Parameters listed in parentheses are optional.
@filename
Executes the commands in file filename.
alias newname command
Allows ``newname'' to be used in place of ``command''.
addmod modname
Adds model to current list of models.
counts
Prints counts (and count rates if data image has an exposure defined in its header) for each model.
csv
Saves info concerning current fit into a comma-separated values (CSV) file (i.e., suitable for easily reading into a spreadsheet or user-written program).
data fitsfile (x0 y0 x1 y1)
Read data from fitsfile, optionally in the range (x0,y0) - (x1,y1).
delmod modnum
Deletes model modnum (model numbers are given in show model or show all commands). Currently only the last model in the list can be deleted.
error parnum/all delta_stat (maxiter dchi maxtry)
Get error on parameter parnum for delta fit fit statistic delta_stat; use "all" to automatically search for errors for all free and untied parameters. Errors are determined by stepping param until fit stat. changes by deltachi maxiter, dchi, maxtry have the same meaning as with the fit command.
exit
Exits XIMGFIT.
fit (n dstat maxtry)
Fit model to data, with up to n iterations or until the fitting statistic changes by less than dstat. maxtry specifies the number of times to keep trying when no new fit is found.
freeze parnum
Freezes parameter.
ga nsamples ntrials (mode cross_prob mut_prob mut_ampl outfile)
Fit using the genetic algorithm. See below for more details.
guess
Guess parameters for models which have a ``guess'' function defined, using the moments as in the moments commnand. Note that in the case of multiple models, the contribution of each model is subtracted after its parameters are guessed, and the residual image is used for each successive moment calculation. Right now this command performs poorly when for flattish source distributions and when the PSF is large compared to source extent.
help
Displays help screen.
load filename
Executes commands in filename
mask fitsfile threshold (x0 y0 x1 y1)
Read fitsfile as mask, with pixels below/above threshold set to 0/1.
model model1 (model2 model3 ...)
Deletes current list of models, if any, and creates new list.
moments
Computes sum, center of mass in x,y, standard deviation in x, y and rotation for data image (``standard deviation'' values are along the major and minor axis, i.e., the eigenvectors of the [[xx, xy],[xy,yy]] matrix, where xx = total of image*x*x/total of image).
pos
print position for each model with parameters "xc" and "yc" defined. RA/Dec. are also computed if astrometry keywords (CDELT1, etc.) are present in data image.
psf fitsfile (x0 y0 x1 y1)
Read psf image from fitsfile.
psf detector offangle (xsize ysize)
Compute psf from analytic model, uses size of data image, if present (currently, the only energy-independent imager defined is the ROSAT HRI).
psf detector offangle spectrumfile E_low E_hi (xsize ysize)
Compute psf for imaging spectrometer (currently, just the PSPC is defined).
saoreg fname (scale)
Saves saoimage region file for models with saoreg function defined (currently, Gaussian and King).
radprof qdpfile xc yc minrad maxrad nrad or radprof qdpfile xc yc annulusfile
Bins a radial profile (also coming soon will be azprof and projprof to bin azimuthal profiles and profiles for a projection along an axis). The values in annulusfile are inner and outer radii in arcseconds, one pair per line.
save what filename
What can be model, modimg, psfimg, dataimg or all. save all and model save text files, the others save fits images.
set setting value
Setting is one of plate, pad, rebin or view. ``set plate'' determines the plate scale (in arcsec/pixel, XIMGFIT tries to guess this when possible from inputed fits images). ``set pad $N$'' expands the data, psf and mask image to $N \times N$ pixels. The main motivation for this is to add a buffer around the PSF for numerical reasons associated with Fourier transforms (briefly, if the result of ``view model'' looks bizarre, padding is probably necessary). ``set pad smart'' adds padding up to the nears power of 2 (Fourier transforms are more efficient with images that are powers of 2). ``set rebin N'' is not implemented yet, but will be used to add padding to an image by increasing the pixel size by a factor of N, with the new image having the same number of pixels as the original (and hence there will be a border of empty pixels around the new image). A set of options that affect the view command can be changed using set view option (type set view with no arguments for more info.).
setpar parnum value (delta min max)
Set parameter to value, optionally also set delta (set to -ve value to freeze param), min and max (hard limits for value in fitting). Alternate usage: setpar parnum1 = parnum2 same as "tie" command
show counts
Prints out the total number of counts from the input image, total model, and individual model components (same as counts)
show model
Prints out current model
show files
Prints out current files in use
show (all)
Prints out both model and files
show param num
Prints out name, value, delta, min, and max fields for parameter num.
stat statistic
Sets fitting statistic to chisq or C (note that in the case of chisq, the error used is sqrt(n+1) rather than sqrt(n) in order to avoid divide-by-zero errors).
step parnum start stop nitervals
As in the XSPEC steppar command, freezes parnum at values from start to stop.
thaw parnum
Thaws parameter
tie parnum1 parnum2
Ties parnum1 to value of parnum2
view what (min max filename) or what filename
Displays data, psf, model, mask, or resid (data-model) in Tk window, optionally scaling intensities between min and max (N.B., if view is set to display logarithmically (i.e., set view log), then the default scaling is from the lowest positive-definite pixel value to the highest pixel value, and the min, max values inputed should logarithmic intensity ranges, such as -2 1 meaning scale between 0.01 and 10 counts/pixel). If a filename is given, the output of the view command is sent to the file filename instead of the display. The format of the output file is the raw ``ppm'' format, which can be easily converted into other formats using command-line tools like ppmtogif and graphical tools like xv.
xml
Saves info concerning current fit into an extensible markup language (XML) file (i.e., suitable for easily reading into a web browser or user-written program).
Finally, if the file $\sim$/.ximgfitrc exists, then the commands in that file will be executed on start-up (e.g., set view log).


next up previous
Next: Quick-start Tutorial Up: XIMGFIT v0.999 Manual Previous: Installation
Andrew Ptak 2001-10-11