Modifying getfields function by refactoring code to gridded_orbit, and
tested that it all works.