get_x_at_nearest_y

rubin_sim.maf.maps.get_x_at_nearest_y(x, y, x_goal)

Given a goal x value, find y values at the closest x value.

This could be used to fetch the nearest ebv value at a given distance, or the nearest distance to a given m-Mo value, for example.

Parameters:
xnp.array

Can be either a map with x at each point in the map (2d array) or the x at a single point of the map (1d array)

ynp.array

Can be either a map with y at each point in the map (2d array) or the y at a single point of the map (1d array) - but should match x dimensionality

x_goal`float’

The goal x value to look for the nearest y value

Returns:
x_closest, y_closestnp.array, np.array

1-d array of x and y (single value or over map).