; ; waverecon.pro - Reconstructs a wave transform. ; ; Copyright (C) 2005, 2006 Patricio Rojo ; ; This program 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. ; ; This program 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 this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; ;+ ; NAME: ; WAVERECON ; ; PURPOSE: ; This function does an inverse wavelet transform ; ; CATEGORY: ; Pato's Array Data Reduction Potpourri. ; ; CALLING SEQUENCE: ; ; Result = WAVERECON(Wavelet, Dt, Scale, Cdelta, Psi0) ; ; INPUTS: ; Wavelet: Complex two dimensional array containing the wavelet ; Dt: X axis sampling distance ; Scale: Vector of scale indices ; Cdelta: Wavelet reconstruction factor. ; Psi0: Wavelet parameter ; ; KEYWORD PARAMETERS: ; DJ: Spacing betweeen discrete scales. Default is 1/8. ; ; OUTPUTS: ; This function returns the reconstructed array ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; PROCEDURE: ; It just applies equation [11] of ; Torrence, C. and G. P. Compo, 1998: A Practical Guide to ; Wavelet Analysis. Bull. Amer. Meteor. Soc., 79, 61-78. ; ; EXAMPLE: ; Reconstruct wavelet 'wave' that was created by Morlet mother ; with standard parameters ; ; unwave = WAVERECON(wave, 1, scale, 0.776, !PI^(-0.25)) ; ; MODIFICATION HISTORY: ; Written by: Pato Rojo, Cornell. Jul 2005 - Mar 2006 ; pato@astro.cornell.edu ; strongly based on routine wavelet.pro (copyright (C) ; 1995-1998, Christopher Torrence and Gilbert P. Compo) ;- FUNCTION waverecon,w,dt,scale,cdelta,psi0,dj=dj IF (N_ELEMENTS(dj) LT 1) THEN dj = 1./8 IF (cdelta EQ -1) THEN BEGIN y1 = -1 MESSAGE,/INFO, $ 'cdelta undefined, cannot reconstruct with this wavelet' ENDIF ELSE BEGIN y1=dj*sqrt(dt)/(cdelta*psi0)*(float(w) # (1./sqrt(scale))) ENDELSE RETURN,y1 END