![]() |
Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
![]() |
pp_correlate
correlates a pulse profile with a template profile
and returns the index of the shifted profile that matches
the template at best
lightcurve
index=pp_correlate(template, testarray, minsubtract=1, chatty=1)
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
none
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
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.
none
* testarray must have the same size as template
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
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
$Log: pp_correlate.pro,v $ Revision 1.1 2006/03/23 09:53:52 barnsted initial release
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]