better vectorization in map_coordinates, added __init__