Whistler determination of electron energy and density distributions in the magnetosphere