Pseudo code for EW uncert/upper limits


Need to take into account the EW uncert/upper limits. The idea found before submitting my thesis is that the cumulative distribution function (CDF) of the simulated EWb’s along with the erf(\mu=EW,\sigma=uncert) can generate a fractional probability that is not a step function.

To get this fractional probability curve, I use the y axes of the CDF and the input error function. The y axis of the CDF will now be the x-axis of the new function, and the y axis of the erf will now be the y xis for the new function.
In pseudo code:
for each individual absorption system (30 pairs eg), there will be at least 900 matches.
1) use 900 matches to generate CDF(EWsim). Keep CDF x and y values in individual arrays.
2)use the real EW measurement with uncertainty to generate an errorfunction over the same domain in x. Again, keep the x,y values of these in individual arrays.
3)mesh the two, taking the y axis from both and writing to a file
4)repeat steps 1-3 for the next absorption system (write to same file)
5)will have now 900×30 values in the file. sort by the x-axis values (y-axis from Gaussian), making sure to move the y-axis (y-axis from CDF of sim EWb) values along in the sort.
6)with a now sorted list (a melding of all 30 step-like functions), plot as a new CDF. THIS CDF is what we will now compare to y=x, as per original method
the idea is to simply mesh the different arrays of steplike functions together. to generate one, very resolved, CDF to use with the KS test.
NOTE: the best place in which to attach the weighting generated by the relative size calculations is in generating the CDF(EWsim). When making a CDF, you move in the x direction the magnitude of the EWsim, and then up a unit value in the y direction, once all steps are completed, you simply normalize by 900 to scale from 0 to 1. In this case, instead of each step having a unit y increment, they will have an increment decided by the relative size of the gaseous halo in which the match was made. Then we normalize by the sum of the relative weightings.