  The extended wings of the Ca II H and K lines provide excellent diagnostics
of the temperature stratification of the photosphere of the Sun and of other
cool stars, thanks to their LTE opacities and source functions and their large
span in formation height. The aim of this study is to calibrate the usage of
the H and K wings in one-dimensional interpretation of spatially averaged
spectra and in deriving per-pixel stratifications from resolved spectra. I use
multi-dimensional simulations of solar convection to synthesize the H and K
wings, derive one-dimensional models from these wings as if they were observed,
and compare the resulting models to the actual simulation input. I find that
spatially-averaged models constructed from the synthesized wings generally
match the simulation averages well, except for the deepest layers of the
photosphere where large thermal inhomogeneities and Planck-function
nonlinearity gives large errors. The larger the inhomogeneity, the larger the
latter. The presence of strong network fields increases such inhomogeneity. For
quiet photospheric conditions the temperature excesses reach about 200 K.
One-dimensional stratification fits of discrete structures such as granulation
and small-scale magnetic concentrations give satisfactory results with errors
that are primarily due to steep temperature gradients and abrupt changes of
temperature with depth. I conclude that stratification modeling using the H and
K wings is a useful technique for the interpretation of solar high-resolution
observations.
