pf_weight_versus_energy

ell1fit.weighting.pf_weight_versus_energy(times, energies, parameters, nharm=1, tolerance=1e-08, plot_root_file_name=None)[source]

Estimate per-event weights from pulsed amplitude versus energy.

For each input observation, this function computes phases with the current timing model, projects them onto an nharm-harmonic model of that observation’s own pulse profile, and fits the resulting per-event amplitude estimates against energy with a penalized cubic spline. The fitted curve is evaluated at each event’s energy and rescaled to peak at 1 to obtain per-event weights in [0, 1].

Parameters:
timeslist of np.ndarray

Event times (seconds from each file PEPOCH), one array per file.

energieslist of np.ndarray

Event energies (or PI channels if provided upstream), one array per file.

parametersdict

Timing/orbital parameter dictionary consumed by _calculate_phases().

nharmint, optional

Number of harmonics in the pulse model the amplitudes are measured against.

tolerancefloat, optional

Convergence tolerance (seconds) for deorbiting iterations.

plot_root_file_namelist of str or None, optional

If provided, save one diagnostic amplitude-versus-energy plot per file using these roots.

Returns:
list of np.ndarray

Event weights for each file, aligned with times and energies.