updating calculation of psi_mag vs depth