[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


pp_correlate Source code in pp_correlate.pro

pp_correlate

Name
       pp_correlate
Purpose
       correlates a pulse profile with a template profile
       and returns the index of the shifted profile that matches
       the template at best
Category
       lightcurve
Calling Sequence
 index=pp_correlate(template, testarray, minsubtract=1, chatty=1)
Input Parameters
       template : array of a template pulse profile (light curve)
       testarray: array of a light curve, which should be shifted
                  to match the template at best
Optional Input Parameters
       none
Keyword Parameters
       minsubtract : By default, the mean value of both arrays subtracted
                     before correlation. Setting minsubtract will
                     subtract the minimum from both array instead of the
                     mean value.
       chatty      : if set, some output is printed during processing
Output Parameters
       Result      : The index of testarray, which matches best template[0].
                     If template and testarray are not of same size, a value
                     of -1 is returned.
Optional Output
       none
Restrictions
       * testarray must have the same size as template
Procedure
       1. The mean value or the minimum value is subtracted from
          both arrays (depending on keyword minsubtract)
       2. Both arrays are scaled with the mean value of their absolute
          values so that they are comparable
       3. testarray is shifted to all possible positions and for each
          position chi-squared is computed
       4. The index of the minimum chi-squared is returned
Example
       nbins=N_ELEMENTS(template)
       i=pp_correlate(template, testarray, minsubtract=1, chatty=1)
       ; or use default:
       i=pp_correlate(template, testarray)
       ; now shift testarray to index i:
       IF (i GT 0) THEN BEGIN
               index=[INDGEN(nbins-i)+i,INDGEN(i)]
               testarray=testarray[index]
       ENDIF
Revision History
 $Log: pp_correlate.pro,v $
 Revision 1.1  2006/03/23 09:53:52  barnsted
 initial release

Last modified by pro2html on 2006 March 24 at 04:10 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically