begin loop sets next if isNotValid(set) begin loop nodes create_pha_histogram(all CCD pixels) fit_peak_with_Gaussian(return: mean, sigma, normalization) write (outset) time_of_diag_image, ccdid, node, & mean, sigma, & refined_rejection_thresholds(per node), & refined_acceptance_thresholds(per node) end loop nodes end loop sets