High-resolution three-dimensional space-charge and polarization mapping with thermal pulses