Open awhoward opened 6 months ago
Part of this task is to write down what we're actually doing to determine the uncertainties! This should be put in Readthedocs.
@stevengiacalone -- Issue https://github.com/Keck-DataReductionPipelines/KPF-Pipeline/issues/837 has some related topics.
For reference, this is what I do to compute the total RV error from the individual slice errors.
# individual camera RVs -- unweighted mean of all slices
rvg = np.nanmean([rv_arr1_green,rv_arr2_green,rv_arr3_green],axis=0)
rvr = np.nanmean([rv_arr1_red, rv_arr2_red,rv_arr3_red],axis=0)
# total weights for all CCF orders
weights_all_ords = np.nansum(weights_green) + np.nansum(weights_red)
# compute the total RV by taking the weighted mean of G+R
rv = (rvg * np.nansum(weights_green) / weights_all_ords) + (rvr * np.nansum(weights_red) / weights_all_ords)#np.nanmean([rvg, rvr],axis=0)
# total error in each camera, computed by combining errors from all slices
rv_err_g = 1./( (1. /rv_err1_arr_green ** 2.) + (1. /rv_err2_arr_green ** 2.) + (1. /rv_err3_arr_green ** 2.)) ** 0.5
rv_err_r = 1./( (1. /rv_err1_arr_red ** 2.) + (1. /rv_err2_arr_red ** 2.) + (1. /rv_err3_arr_red ** 2.)) ** 0.5
# total error for both cameras combined
rv_err = 1./(1./rv_err_g ** 2. + 1. / rv_err_r ** 2.) ** 0.5
Note the above still isnt' quite right, since I should be computing the errors using the same weights that are used in the RV calculation (which are derived from the CCF order-by-order weights), but it's close.
@bjfultn
Are the individual chip uncertainties problematic or is it just the final combined RV?
The RV uncertainties in the L2 files appear to be too large. The is apparent in multiple RM observation sequences, one of which is shown below. Note in that plot that the post-egress RVs vary by significantly less than the per-measurement errors. If the errors were computed properly, and are limited by Poisson statistics, then 68% of the points should be within 1-sigma and 32% should be outside of 1-sigma. In the example shown, all points seem to be within ~0.5-sigma.
@stevengiacalone is interested in looking into this. @shalverson, perhaps you could comment on your understanding of how the RV uncertainties are currently being computed?
If this is a problem, we should correct it.