WL Photoz Joint Analysis with RayTracing -test image-

Test image is 2048 x 2048 pixels which correspond to ~47 square arcminutes field of view. Some programs and parameter files are also available here. If you use this, please read the instruction at the bottom of this page.
  1. Make galaxy catalog with STUFF

    First, make configure files for all pass bands, g,r,i,z,y.
    -- config files:stuff_HSCbands.conf
    -- filter set:g,r,i,z,y
    $ stuff -c stuff_HSCbands.conf
    -- catalog files: stuff_g.list, stuff_r.list, stuff_i.list, stuff_z.list, stuff_y.list

    remove object z>5, which are infeasible to detect with HSC wide-survey,
    $ gawk '$12<=5 {print}' stuff_[g-y].list > stuff_[g-y].list2 -f
  2. Add shear

    Convert file format suitable to raytrix program,
    $ set npix = 2048
    $ set pixsec = 0.202
    $ stuff2hamana stuff_[g-y].list2 $npix $pixsec > stuff_[g-y].list3
    -- program: stuff2hamana.f90 / binary(Linux i386)

    Since the shape distortion is independent of filters, but depends only on the position of object and redshift, we can run raytrix_pz.sh only for the reference filter.
    $ $RAYTRIX2Pz/raytrix_pz.sh stuff_i.list3 stuff_i.shear stuff_g.log
    $ cp stuff_i.shear stuff_[g-y].shear
    $ cp stuff_i.log stuff_[g-y].log
    The program, raytrix_pz.sh and associated programs, huge data are available at,
    ftp://godzilla.astr.tohoku.ac.jp:21/home/wlwg/data/
    The access of anonymous is prohibited.(If you'd like to use this, contact me)

    Convert back to the stuff format,
    $ set npix = 2048
    $ hamana2stuff stuff_[g-y].list2 stuff_[g-y].shear $npix > stuff_[g-y].list4
    -- program: hamana2stuff.f90 / binary(Linux i386)
    Now, the stuff_[g-y].list4 are convergenced/sheared catalog of galaxies. Note that the changes in magnitudes of galaxies due to lensing magnification are not considered.
    -- catalog files: stuff_g.list4, stuff_r.list4, stuff_i.list4, stuff_z.list4, stuff_y.list4
  3. Make sky image

    Make sky images of sheared galaxy catalog for all pass bands. To do this we use a publicly available skymaker code. Note: If you compile skymaker with multi-threads mode, you may have a bug on the random seed of star position: with exactly same parameters set including non zero random seed, the star positions differ run by run. This problem is fatal since we are going to stack images. If you have this problem, you can quickly avoid this by compile skymaker with single thread mode, i.e. configure --disable-threads. Also be sure to have compiled single precision FFTW library with single thread mode.
    -- config files: sky_g.conf, sky_r.conf, sky_i.conf, sky_z.conf, sky_y.conf,
    Below we show the example of cshell script to make many images,
    #! /bin/csh
    set ns = (3 3 15 15 15)
    set filt = ("g" "r" "i" "z" "y")
    @ i = 1
    while ( $i <= 5 )
      @ g = 1
      while ( $g <= $ns[$i] )
        set n = `printf "%03d" ${g}`
        set f = skyimages/sky_${filt}[$i]${n}
        sky stuff_${filt}[$i].list4 -c ${f}.conf -IMAGE_NAME ${f}.fits
        @ g ++
      end
      @ i ++
    end
    The exposure time for each shot is (g,r,i,z,y)=(300,300,60,60,60) secnds, and we try to make stacking images equivalent to 900 seconds exposure: stack by average, instead of sum.
    $ stackn sky_i001.fits sky_i002.fits ...... sky_i015.fits sky_i.fits
    -- program: stackn.f90 / binary(Linux i386)
    -- images : sky_g.fits, sky_r.fits, sky_i.fits, sky_z.fits, sky_y.fits, riz image
    -- object list : sky_g.list, sky_r.list, sky_i.list, sky_z.list, sky_y.list
  4. Object detection / Shape measure

    Make matching catalog to sextractor output. This enables us to compare the input and output magnitude and shape of galaxies.
    $ stuff2sex sky_[g-y]001.list > temp && mv -f temp sky_[g-y]001.list
    The hamana-san's pipeline, getobj2.sh execute ojbect detection and shape measure, with SExtractor and imcat(KSB method), and match them. getobj3.sh is used only for the photometry of SExtractor and the catalog is matched to reference catalog obtained by getobj2.sh.
    $ cd ~/work/hamana/raytrace/work/KSB/bin/
    $ ./getobj2.sh # for reference(i') band / with shape measure
    $ ./getobj3.sh [g,r,z,y] # for other band
    -- matched objects list : sky_g.cat, sky_r.cat, sky_i.cat, sky_z.cat, sky_y.cat
    (imcat lc formatted binary table)
  5. Photometric redshift

    $ cd ../CAT
    $ lc -o MAG_APER MAGERR_APER < sky_[g-y].cat > temp_[g-y]
    $ lc -o SPECZ < sky_i.cat > temp_specz
    $ make_lepharecat temp_[g-y] temp_specz > sky_photometric
    $ lc -C -n ID -N "1 2 g_APER" -N "1 2 r_APER" -N "1 2 i_APER" -N "1 2 z_APER" \
      -N "1 2 y_APER" -n context -n zspec < sky_photometric > sky_photometric.cat
    $ lc -o < sky_photometric.cat > ../../lephare/cat/sky_photometric.cat
    $ rm temp_* sky_photometric -f