KSBf90: A Fortran 90 Implementation of Kaiser, Squires and Broadhurst 1995.

Measure and model the PSF:


Once you have selected a good sample of stars, all weak lensing methods will use this sample to construct a spatially varying PSF across the field of view.  You require a continuous model of the PSF which is only sampled discretely by your stellar sample. 


In KSBf90 the PSF is characterised by its weighted ellipticity (p1, p2) given by equation C3 in the GREAT08 Handbook.

This is measured for a range of weight functions (eq C1) with varying scale radius rg.  A spatially varying PSF model is created for each scale radius.  Galaxy shapes are measured with an optimal weight function, where the scale radius is given by the galaxies half-light-radius.  Galaxies are then corrected for the PSF measured with the same weight function.


What model to choose?

Again this is a trial and error question, dependent on your telescope and observing conditions.  A good rule of thumb for KSBf90 is


  1. Fit each CCD chip separately (setting nchipx and nchipy in KSBf90.param)

  2. Choose the lowest order polynomial model that fits the variations of the PSF across the image (setting order in KSBf90.param)

  3. Choose a reasonable number of rg scales to check how rapidly the ellipticity varies with isophotal scale (setting rgmax in KSBf90.param)


For stacked data with large dithers however, it may make more sense to fit the full field-of-view with a high order polynomial.  If this is the case beware of your polynomial model going crazy at the edges of the field.  VIRMOS-DESCART found rational functions more useful than polynomial (see Van Waerbeke et al 2005) although this are not currently coded in KSBf90.  For an advanced method on choosing your model see Rowe 2009.


Diagonostic plots

Psffit.f90 will produce diagnostic plots either to your screen (the default) or to a postscript file it you select the pgopen option.  In these plots


  1. White/Black marks always refer to the measured PSF parameters

  2. Pink refers to either the model (stick plots) or the model corrected PSF ellipticity (all others)


A good PSF model will send all the corrected PSF ellipticities to cluster around (0,0) and this should be true for all rg scales.   It is normal however that as rg grows the PSF measurement will become noisy and hence the model will be poorer.

Running psffit.f90 from the command line:


psffit.a -image image.fits -in SExtractor.cat -crit star_criteria.dat -param KSBf90.param -out PSF.dat


-image:  The fits image you are analysing

-in : Your SExtractor catalogue of this image

-crit: Your stellar selection criteria from findstars.f90

-out:  The output file from this code which contains the PSF model

-param:  The name and location of your parameter file

-pgopen:  This code outputs plots to the screen.  If you wish these to be saved as postscript files use the additional option -pgopen /cps

Page maintained by Catherine Heymans, IfA, University of Edinburgh