  Shocks that occur below a gamma-ray burst (GRB) jet photosphere are mediated
by radiation. Such radiation-mediated shocks (RMSs) could be responsible for
shaping the prompt GRB emission. Although well studied theoretically, RMS
models have not yet been fitted to data due to the computational cost of
simulating RMSs from first principles. Here, we bridge the gap between theory
and observations by developing an approximate method capable of accurately
reproducing radiation spectra from mildly relativistic (in the shock frame) or
slower RMSs, called the Kompaneets RMS approximation (KRA). The approximation
is based on the similarities between thermal Comptonization of radiation and
the bulk Comptonization that occurs inside an RMS. We validate the method by
comparing simulated KRA radiation spectra to first-principle
radiation-hydrodynamics simulations, finding excellent agreement both inside
the RMS and in the RMS downstream. The KRA is then applied to a shock scenario
inside a GRB jet, allowing for fast and efficient fitting to GRB data. We
illustrate the capabilities of the developed method by performing a fit to a
non-thermal spectrum in GRB 150314A. The fit allows us to uncover the physical
properties of the RMS responsible for the prompt emission, such as the shock
speed and the upstream plasma temperature.
