KSBf90: A Fortran 90 Implementation of Kaiser, Squires and Broadhurst 1995.
 
            KSBf90: A Fortran 90 Implementation of Kaiser, Squires and Broadhurst 1995.
Select galaxies for shear measurement:
Once you have a shape catalogue you need to decide which galaxies to use in your analysis.  With nearly all shape measurement methods this selection is rather ‘black magic’ and your choice usually has a significant impact on your results.  The exception to this is the Lensfit method which outputs a probability distribution of the shear for each galaxy.  
For KSB your selection should be based on the following
•Remove all galaxies that are within a mask
•Remove galaxies which have a size close to the PSF size.  These galaxies are usually hard to completely remove the PSF distortion from.  I find rg>1.15 r_star works well
•Remove low signal-to-noise galaxies which are hard to measure shapes from.  I find S/N>10 works well
•Remove really noisy shape measurements.  I find |γ| < 1 works well.  
The above selection criteria are used in gal_correct to write out the average shear in the catalogue.
How should you choose your selection criteria?
If you have wide-field data you know that on average <γ> = 0.  This should be true for all galaxy sizes, all magnitudes and all S/N.  gal_select.f90 bins and averages your shape catalogue by size, magnitude and S/N.  You can then identify “problem” galaxies which are biasing your shear measurement.
Should you fit Pgamma?
Many KSB users do fit Pgamma with a polynomial to reduce noise in the final shear catalogue.  My experience is that this fit biases your result, however I include the ability to do this fit with the gal_select -fit 1 option.
The resulting simple final shear catalogue
The output file is very simple
#  1 x          SExtractor x   
#  2 y          SExtractor y 
#  3 g1         KSBf90 output reduced shear_1
#  4 g2         KSBf90 output reduced shear_2
Running gal_select.f90 from the command line:
gal_select.a -in shape.cat -param KSBf90.param -fit 0 -nbins 10 -out finalshear.cat
-in : Your SExtractor catalogue with KSB shape parameters appended output by gal_correct
-param:  The name and location of your parameter file
-fit : Do you want to fit Pgamma with a polynomial?  Yes - fit 1,  No -fit 0
-out: The output of this code; your final selected shear catalogue
Page maintained by Catherine Heymans, IfA, University of Edinburgh