Shears from shapelets
In the following tarball you can find the software
that was used to create the GREAT08 submission 'Shapelets N=10'.
Here's the description (also included in the tarball):
SHAPELET CODE USED TO GENERATE GREAT08 SUBMISSION
K. Kuijken Oct 2008.
Included in tarball:
code/ subdirectory with the fortran programmes.
out/ subdirectory with results for LowNoise_Known/set0001.fit simulation
COMPILING
=======
To link the software you also need the cfitsio (I use version 3.030)
and pgplot libraries (version 5.2.2). Also SExtractor is used (version
2.5.0).
pgplot can be a pain to compile and install... it is not crucial for
this test but is used extensively in the code to generate diagnostic
plots. You could safely remove all lines calling subroutines whose
names start with 'pg' and everything would still work.
The code is fortran 77 - to compile it you need g77. the code/
directory includes a makefile - adjust to the location of these libraries and type
'make all'
RUNNING AN EXAMPLE
===============
# you need 4 directories to be defined by means of variables:
# adapt to your setup, make sure they all exist!
#e.g.:
setenv stardata ~/great08/Stars/
setenv galdata ~/great08/LowNoise_Known/
setenv rslts $galdata/rslts
setenv code ~/great08/kkcode/
# set up extractor paramater files
cp $code/sexconfig/default.* $rslts
#making PSF maps:
# go to your working subdirectory
cd $rslts
# make param file with shapelet order (here 10), interpolation order (0)
echo 10 > orders.par; echo 0 >> orders.par
# first make PSF map for set0001
# format stars1.cat file: swap x and y coords in set000?.cat files and add 0.525 offset
grep -v # $stardata/set0001.cat | \
awk '{print($6+.525,$5+.525,10000,100,4,1,1,0,0,0)}' > stars1.cat
ln -s $stardata/set0001.fit inimage.fits
$code/psfcat2sherr < stars1.cat > stars1.sh
$code/fitpsfmap2 < stars1.sh > stars1.map
# the stars1.map file contains the PSF's shapelet coefs, as fitted to the stars
#(similarly for PSFs 2 and 3 if you need these - only for RealNoise_Blind)
#Then to calculate the shears do the following:
cd $rslts
#example for image set0001
set im='0001'
rm inimage.fits; ln -s $galdata/set$im.fit inimage.fits
# detect sources, makes test.cat sextractor catalogue
sex inimage.fits
# identify correct psf map
rm psf.map; ln -s $rslts/stars1.map psf.map
# make shapelet expansion for detected sources
$code/cat2sherr < test.cat > $im.sh
# determine ellipticities
$code/sortbybeta < $im.sh | $code/sh2gerrshift012 > $im.g
# the 0001.g file contains one line per source, including in col 9 and
# 10 the estimate for g1 and g2 of each galaxy.
# finally to average the shears I use a convex hull peeling algorithm
(echo 0.5; awk '{print($9,$10)}' $im.g) | $code/chpmean > $im.g1g2
# output file 0001.g1g2 list number of galaxies used, and estimate for g1, g2.
# sample output files can be found in the out/ subdirectory of the tarball.
Konrad Kuijken, Leiden Observatory
Last modified: Sat Oct 18 22:17:36 2008