function shapelets_centroid, decomp, $ FLUX=flux, $ ERROR=error, $ BASIS_FUNCTIONS=basis_functions,$ IMAGE_COORDS=image_coords, $ N_MAX=n_max, $ GAUSSIAN=GAUSSIAN, $ MATRIX=matrix, $ POLAR=polar, $ CARTESIAN=cartesian ;$Id: shapelets_centroid.pro, v2$ ; ; Copyright © 2005 Richard Massey and Alexandre Refregier. ; ; This file is a part of the Shapelets analysis code. ; www.astro.caltech.edu/~rjm/shapelets/ ; ; The Shapelets code is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public Licence as published ; by the Free Software Foundation; either version 2 of the Licence, 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 Licence for more details. ; ; You should have received a copy of the GNU General Public Licence ; 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: ; SHAPELETS_CENTROID ; ; PURPOSE: ; Computes the centroid from a linear summation of shapelet coefficients, ; read in from a Cartesian decomp structure. ; ; CATEGORY: ; Shapelets. ; ; INPUTS: ; decomp - A Cartesian shapelet decomp structure, with at least ; beta and coefficients defined. ; ; OPTIONAL INPUTS: ; N_MAX - Summation performed only to this n_max. Overrides GAUSSIAN ; keyword. Flux summation still performed to all orders. ; ; KEYWORD PARAMETERS: ; CART - Perform summation in Cartesian shapelet space. [DEFAULT] ; POLAR - Perform summation in polar shapelet space. ; ERROR - Simultaneously calculate the error on the centroid (and flux). ; BASIS_F - Centroid is returned relative to the centre of the basis fns. ; IMAGE_C - Centroid is returned in global image coordinates. ; GAUSSIAN - Gaussian weighted centroid calculated, by setting N_MAX to 2. ; ; OUTPUTS: ; CENTROID - Shapelet measure of centroid ; ; OPTIONAL OUTPUTS: ; FLUX - Floating point variable optionally returned with the object's ; flux (calculation needed to work out the centroid anyway). ; MATRIX - Cartesian to polar conversion matrix, if /POLAR was set. ; ; EXAMPLE USE: ; result = shapelets_centroid(decomp,flux=flux) ; ; NOTES: ; Not yet compatible with oversampling, nor full covariance error matrix ; of coefficients. ; ; MODIFICATION HISTORY: ; Jul 07 - Fixed to work with older versions of IDL by RM. ; Jan 06 - N_MAX and GAUSSIAN keywords added by RM. ; Jul 05 - BASIS_FUNCTIONS and IMAGE_COORDS keywords added by RM. ; Jul 05 - Rendered capable of accepting polar decomp structures by RM. ; Oct 03 - Calculation of error on flux added by RM. ; Feb 03 - Written by Richard Massey ;- COMPILE_OPT idl2 ; ; SET DEFAULTS ; ; Backwardly compatible if not tag_exist(decomp,"polar") then decomp=create_struct(decomp,"polar",0B) ; Decide whether default method should be in Cartesian or polar shapelet space if ((keyword_set(cartesian)+keyword_set(polar)) mod 2) eq 0 then cartesian=1-decomp.polar ; Decide up to what order the summation should be performed if n_elements(n_max) eq 0 then if keyword_set(gaussian) then n_max=2 else n_max=decomp.n_max n_max=0>fix(n_max)
Return to the shapelets web page or the code help menu.
Last modified on 2nd Mar 2009 by Richard Massey.