create_template_from_profile_harm¶
- ell1fit.templates.create_template_from_profile_harm(profile, imagefile='template', nharm=None, final_nbin=None, plot=True)[source]¶
Create a smooth pulse template from a folded profile.
- Parameters:
- profilenp.ndarray
Folded pulse profile.
- imagefilestr, optional
Where to save the diagnostic figure. Ignored when
plotis False.- nharmint or None, optional
Number of harmonics retained. Defaults to
profile.size * 3 / 16.- final_nbinint or None, optional
Number of bins in the returned template.
- plotbool, optional
Whether to write the diagnostic figure. Iterative refinement rebuilds the template once per pass, and writing a figure each time is both slow and useless – only the final template is worth looking at.
- Returns:
- templatenp.ndarray
The smoothed template.
- additional_phasefloat
Phase offset of the template peak, wrapped to
[-0.5, 0.5).