  Instrumental artifacts in gravitational-wave strain data can overlap with
gravitational-wave detections and significantly impair the accuracy of the
measured source localizations. These biases can prevent the detection of any
electromagnetic counterparts to the detected gravitational wave. We present a
method to mitigate the effect of instrumental artifacts on the measured source
localization. This method uses inpainting techniques to remove data containing
the instrumental artifact and then correcting for the data removal in the
subsequent analysis of the data. We present a series of simulations using this
method using a variety of signal classes and inpainting parameters which test
the effectiveness of this method and identify potential limitations. We show
that in the vast majority of scenarios, this method can robustly localize
gravitational-wave signals even after removing portions of the data. We also
demonstrate how an instrumental artifact can bias the measured source location
and how this method can be used to mitigate this bias.
