If P, D of each surface are not specified (so D's default value of [0., 0., 0.] is assumed) then save_optics crashes. This function should be reworked to iterate over the surfaces first, handling these edge cases, and then converting to a pd dataframe at the end to export as csv.