c_coords21dindex function

Convert physical coordinates to 1d indices into image array