# Check main spot position for multiple different random telescopes
main_spot_name = ('main', 'main')
def get_spot_x():
df, gh = simulator.full_random_telescope_sim(telescope, max_angle=0.1, max_shift=0.001,
beam_config=BEAM_CONFIG_on_axis_fast)
return df[df['name']==main_spot_name]['pos_x'].item()
x_spot_future = list()
starttime = timeit.default_timer()
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(get_spot_x, ) for i in range(10)]
for future in concurrent.futures.as_completed(futures):
x_spot_future.append(future.result())
stoptime = timeit.default_timer()
print(x_spot_future)
print("The time difference is :", stoptime - starttime)
Example: