The software package is currently being dramatically improved and updated.
This is a (very) old version, potentially with bugs.

  Shapelets web page     Shapelets IDL code     Installation     Help pages     Simulated images  
List of routines
Instrutions for general code
Instructions for image simulation code

Source code for simage_make_shapelet_object.pro:

You can also view the help page for this routine.

function simage_make_shapelet_object,decomp,$ gamma_input=gamma_input,psf=psf,inst_shear=inst_shear,$ rpos=rpos,seed=seed,shapeinfo=shapeinfo ;$Id: simage_make_shapelet_object.pro, v1.0$ ; ; Copyright 2004 Richard Massey and Alexandre Refregier. ; ; This file is a part of the Shapelets analysis code. ; www.ast.cam.ac.uk/~rjm/shapelets/ ; ; The Shapelets code is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License as published ; by the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; The Shapelets code is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with the Shapelets code; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; ;+ ; NAME: ; SIMAGE_MAKE_SHAPELET_OBJECT ; ; CATEGORY: ; Shapelet simulated images. ; ; PURPOSE: ; This module makes one object for the shapelet-based image simulations, using ; a full shapelet model of its morphology. It is pixellated using various ; input parameters. ; ; INPUTS: ; decomp - Cartesian shapelet decomp structure of the resampled galaxy. ; ; OPTIONAL INPUTS: ; gamma - Weak lensing shear on all galaxies [gamma1,gamma2]. ; psf - Cartesian decomp structure representing PSF. Will then do ; convolvution automatically. Stars are just this PSF. ; instrum - Post-smear shear due to geometric distortions in telescope. ; seed - Seed for random number generator. ; ; KEYWORD PARAMETERS: ; RPOS - Randomise positions and PAs of galaxies? ; ; OUTPUTS: ; recomp - One (shapelet) simulated object in a postage stamp image. ; shapeinfo - A structure containing object properties for inclusion in the ; pre-noise catalogue. ; ; MODIFICATION HISTORY: ; Jun 03 - Written by Richard Massey ;- COMPILE_OPT idl2 ; Rotate object randomly if the positions are also random. if keyword_set(rpos) then shapelets_rotate,decomp,(randomu(seed)*360.) ; Shear object (weak lensing). if keyword_set(gamma_input) then begin shapelets_extend_nmax,decomp,2 shapelets_shear,decomp,gamma_input n_max_g=decomp.n_max endif else n_max_g=decomp.n_max+2 ; Smear object (atmospheric + telescope PSF). if keyword_set(psf) then decomp=convolution(decomp,psf,n_max_g=n_max_g) ; Shear object (instrumental distortions). if keyword_set(inst_shear) then sshear,decomp,inst_shear ; Re-compose the object into pixels. shapelets_recomp, decomp, recomp ; Make sure we do not truncate the edges of the object as would bias shape measurement. while total(abs(recomp[*,0]))+$ total(abs(recomp[0,*]))+$ total(abs(recomp[decomp.n_pixels[0]-1,*]))+$ total(abs(recomp[*,decomp.n_pixels[1]-1])) $ gt (1e-10>abs(max(recomp)/1e7)) do begin decomp.n_pixels=decomp.n_pixels+[10,10] decomp.x=decomp.x+[5.,5.] shapelets_recomp, decomp, recomp endwhile ; Calculate (pre-noise) shape properties for posterity q=shapelets_quadrupole(decomp,flux=flux) rsq=(Q[0,0]+Q[1,1])/flux ell=complex(Q[0,0]-Q[1,1],2*Q[0,1])/(Q[0,0]+Q[1,1]) PA=atan(imaginary(ell),float(ell))/2.+!pi/2 A=sqrt(rsq*(1+abs(ell))/2.) B=sqrt(abs(rsq*(1-abs(ell))/2.)) shapeinfo={A:A,B:B,theta:(PA*180/!pi) mod 360-90,rsq:rsq,flux:flux,mag:-2.5*alog10(flux)+22.08} ; That`s all folks! return, recomp end

View the help page for this routine, return to the shapelets web page or return to the code help menu.

Last modified on 02nd May 2008 by Richard Massey.

Valid HTML 4.01!