next up previous
Next: Fit to a ROSAT Up: Quick-start Tutorial Previous: Fitting an Optical Image

Fit to a GIS2 Elliptical Gaussian Simulation

Here we will fit the Gaussian model to a GIS2 simulation of an elliptical Gaussian source (e.g., this is a sanity check since we should get back the same parameters that went into the simulation, namely 1' by 2'). This example also includes a mask to only include the central 18' of the GIS FOV.
ximgfit> data tutorial/g2_g1x2min_100ks.img.gz
ximgfit> psf tutorial/g2_psf_sim_1Ms.img.gz
ximgfit> mask tutorial/gis_mask_18min.img.gz 1
ximgfit> model Gaussian
ximgfit> new 3 100
ximgfit> new 4 50
ximgfit> new 5 130
ximgfit> stat C
ximgfit> show
Data file: test/test_g2_g1x2min_100ks.img.gz, size = 256 X 256
PSF: test/test_g2_1Ms.img.gz, size = 256 X 256
Mask file: gis_mask_18min.img.gz, size = 256 X 256
Padding =  none
Rebinning =  none
Plate scale = 14.753989 arcsec/pixel
Model:  Gaussian 
Par Mod   Name            Value (     units)        Description
  1   1     xc                0 (    arcsec)        X offset from image center
  2   1     yc                0 (    arcsec)        Y offset from image center
  3   1   norm              100 (      comp)        Normalization
  4   1 sigmax               50 (    arcsec)        Sigma in the X direction
  5   1 sigmay              130 (    arcsec)        Sigma in the Y direction
  6   1  theta                0 (   degrees)        Rotation angle
C = -69510.24, with 16286 degrees of freedom (16292 data bins)
ximgfit> fit
-70937.52 -4 0.3171 1.977 121.3 54.86 116.4 0.01173
-71043.90 -5 0.3677 2.327 128.7 55.84 114.7 0.02735
-71044.48 -6 0.3633 2.397 129.3 55.92 114.5 0.04423
-71044.55 -7 0.3621 2.402 129.3 55.92 114.5 0.06094
-71044.61 -8 0.362 2.402 129.3 55.92 114.5 0.07736
-71044.67 -9 0.362 2.402 129.3 55.92 114.5 0.09349
-71044.74 -10 0.362 2.402 129.3 55.92 114.5 0.1093
-71044.79 -11 0.362 2.401 129.3 55.92 114.5 0.1249
-71044.85 -12 0.3621 2.401 129.3 55.91 114.5 0.1402
-71044.90 -13 0.3621 2.401 129.3 55.91 114.5 0.1553
Last change in fit statistic = 0.0546
Although C is coming out negative (probably due to the fact that the $n!$ term is dropped in the fitting procedure, see Cash 1979), note that a proper minimum is reached. The results of ``view data'', ``view model'', ``view psf'', and ``view psf'' are shown in Figure 2 (after running fit 100 to reach a slightly better minimum in the C statistic). These images are shown with view set to display logarithmically (set view log). The effect of the 18' mask is evident in the model image.

Figure: Result of ``view data'' (top left), ``view psf'' (top right), ``view model'' (bottom left), and ``view resid'' (bottom right) within XIMGFIT. All images are displayed logarithmically.
\begin{figure}\epsfig{file=test_g2_all.ps,height=10cm}\end{figure}

To get the error on a parameter, use either the ``error'' command or the ``step'' command (to manual search for an error range when the expect range of the parameter is already known):
ximgfit> step 5 115 120 5
  Fit Statisitc Delta Fit Stat.       Mod Param
      -71046.26            0.16          115.00
      -71044.61            1.81          116.00
      -71041.19            5.22          117.00
      -71036.03           10.39          118.00
      -71029.13           17.29          119.00
      -71020.52           25.90          120.00
This example implies that there is some systematic error in the difference between the best-fit $\sigma_y$ and the inputted $\sigma_y$ of 120'', probably due to the slight change in the GIS PSF with off-axis angle.


next up previous
Next: Fit to a ROSAT Up: Quick-start Tutorial Previous: Fitting an Optical Image
Andrew Ptak 2001-10-11