Edits to convert_to_cartesian for unit handling