robs(m,i) = observed event rate (background-subtracted) for order m
within wavelength bin i (in tg_mlam space) = the
observed rate at photon wavelength tg_mlam/m.

r*m* = true (unpiled) event rate of order m (within tg_mlam bin i).

rall = the sum of all rm (m=1-10) in wavelength bin i, which is a more than
adequate approximation to the total event rate in that bin.

kp(m) = parameter for true pile-up (2 events yielding one valid event with
summed energy).

kg = parameter for grade-migration pile-up (both events are lost)

ktot = k_total = kp + kg

ktot is assumed to be independent of energy. It presumably isn't, but it doesn't vary enough to matter (or be measurable) in the wavelength range of interest here.

kp for different orders is notated as kp(m) because it has significant energy dependence at the very short wavelengths where it is most important. Since we're dealing with 2 (or 3) events there is some unavoidable ambiguity in what the pileup parameters for the separate events that contribute to make one pile-up event really mean, but this treatment works well.

The true rates, r*m*, are computed iteratively using the equations
below (shown for + orders). Only pile-up with 1st order is significant.
The equation for 3rd order includes pile-up of three 1st order events,
which makes a small contribution at the shortest wavelengths, but
otherwise only 2-event pileup is considered.
There are four iterations, but things usually converge very well
after only two. The true rates are allowed to be negative to avoid
odd results when minimizing variances for m=2 among the
multiple ObsIDs to tune kp;
if negative rates are set to 0 (to avoid
unphysical values) then you can get perfect agreement (zero variance)
among the ObsIDs by making kp unphysically large
and driving all the r2 values to 0.

rall=r1+r2+r3+r4+r5+r6+r7+r8+r9+r10 r1=robs(1,i)/exp(-rall*ktot) r2=(robs(2,i)/exp(-rall*ktot)) -(1.0/2.0)*r1*r1*(kp(1)/ktot)*exp(+r1) -r1*r1*kp(1)*(1.0-(1.0/ktot)) r3=(robs(3,i)/exp(-rall*ktot)) -r1*r2*kp(2) -r2*r1*kp(1) -r1*r2*(kp(2)/ktot) -(1.0/6.0)*r1*r1*r1*(kp(1)/ktot)*(kp(1)/ktot)*exp(+r1) -(1.0/2.0)*r1*r1*r1*kp(1)*kp(1)*(1.0-(1.0/ktot)) r4=(robs(4,i)/exp(-rall*ktot)) -r1*r3*kp(3) -r3*r1*kp(1) -r1*r3*(kp(3)/ktot) r5=(robs(5,i)/exp(-rall*ktot)) -r1*r4*kp(4) -r4*r1*kp(1) -r1*r4*(kp(4)/ktot) r6=(robs(6,i)/exp(-rall*ktot)) -r1*r5*kp(5) -r5*r1*kp(1) -r1*r5*(kp(5)/ktot) r7=(robs(7,i)/exp(-rall*ktot)) -r1*r6*kp(6) -r6*r1*kp(1) -r1*r6*(kp(6)/ktot) r8=(robs(8,i)/exp(-rall*ktot)) -r1*r7*kp(7) -r7*r1*kp(1) -r1*r7*(kp(7)/ktot) r9=(robs(9,i)/exp(-rall*ktot)) -r1*r8*kp(8) -r8*r1*kp(1) -r1*r8*(kp(8)/ktot) r10=(robs(10,i)/exp(-rall*ktot)) -r1*r9*kp(9) -r9*r1*kp(1) -r1*r9*(kp(9)/ktot)

As described on the main page, kp and ktot have different values for BI and FI chips. Determination of their values is described here.