make precalculate_aberrations less repetitive