  Gravitational lensing induces significant errors in the measured distances to
high-redshift standard candles and standard sirens such as type-Ia supernovae,
gamma-ray bursts, and merging supermassive black hole binaries. There will
therefore be a significant benefit from correcting for the lensing error by
using independent and accurate estimates of the lensing magnification. We
investigate how accurately the magnification can be inferred from convergence
maps reconstructed from galaxy shear and flexion data. We employ ray-tracing
through the Millennium Simulation to simulate lensing observations in large
fields, and perform a weak-lensing reconstruction on these fields. We identify
optimal ways to filter the reconstructed convergence maps and to convert them
to magnification maps. We find that a shear survey with 100 galaxies/arcmin^2
can help to reduce the lensing-induced distance errors for standard
candles/sirens at redshifts z=1.5 (z=5) on average by 20% (10%), whereas a
futuristic survey with shear and flexion estimates from 500 galaxies/arcmin^2
yields much larger reductions of 50% (35%). For redshifts z>=3, a further
improvement by 5% can be achieved, if the individual redshifts of the galaxies
are used in the reconstruction. Moreover, the reconstruction allows one to
identify regions for which the convergence is low, and in which an error
reduction by up to 75% can be achieved.
