Restructure sim study by creating the function spatial_calc and designing it to be set up as a map-reduce job