; docformat = 'rst' ; ; NAME: ; getAperture2D ; PURPOSE: ; Extract a single parameter from multiAperture2D source characterization. ;+ ; :Description: ; Extract a single parameter from multiAperture2D source characterization. ; ; :Categories: ; Images ; ; :Returns: A single parameter from the input structure. ; ; :Params: ; param: in, required, type=structure ; The peak parameters, from multiAperture2D. Fields are: ; .id: Parameter simple identifyer ; .name: Name of the parameter ; .unit: Unit of the parameter ; .val: An array of N values, one per aperture ; .mean: Average value for N apertures ; .dev: Standard deviation for N apertures ; label: in, required, type=string ; Parameter ID. Possible values are:: ; radius base peak sigx sigy xc yc tilt EE RMS ; ; :Examples: ; ; :Uses: ; ; :Author: ; B.Carry (IMCCE) ; ; :History: ; Change History:: ; Written in April 2015, B. Carry (IMCCE) ;- function getAperture2D, param, label, index=index ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; COMPILE_OPT hidden ;--I.1-- Check Input Parameters ------------------------------------------------------- if not keyword_set(param) or not keyword_set(label) then begin message, 'Syntax: plotAperture2d, param, label' return, -1 endif ;--I.2-- Peak Model: Gauss or Moffat -------------------------------------------------- nbParam = n_elements( param ) nbMPF = nbParam - 3 ;--I.3-- Parameter Indices ------------------------------------------------------------ indRad = 0 indPar = 1+indgen(nbMPF) indEE = 1+nbMPF indRMS = 1+nbMPF+1 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Determine Parameter Index -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--II.1-- Determine Parameter Index ---------------------------------------------------- case strlowcase(strtrim(label,2)) of 'radius': kPar = indRad 'base' : kPar = indPar(0) 'peak' : kPar = indPar(1) 'sigx' : kPar = indPar(2) 'sigy' : kPar = indPar(3) 'xc' : kPar = indPar(4) 'yc' : kPar = indPar(5) 'tilt' : kPar = indPar(6) 'index' : kPar = indPar(7) 'ee' : kPar = indEE 'rms' : kPar = indRMS else: endcase ;--II.2-- Return Single Parameter Structure -------------------------------------------- if keyword_set(index) then return, kPar $ else return, param(kPar) end