  The temperature is a central parameter affecting the chemical and physical
properties of dense cores of interstellar clouds and their evolution to star
formation. The chemistry and the dust properties are temperature dependent and
the interpretation of observation requires the knowledge of the temperature and
its variations. Measurement of the gas kinetic temperature is possible with
molecular line spectroscopy, the ammonia molecule, NH3, being the most commonly
used tracer. We want to determine the accuracy of the temperature estimates
derived from ammonia spectra. The normal interpretation of NH3 observations
assumes that all the hyperfine line components are tracing the same gas volume.
In the case of temperature gradients they may be sensitive to different layers
and cause errors in the optical depth and gas temperature estimates. We examine
a series of spherical cloud models, 1.0 and 0.5 M_Sun Bonnor-Ebert spheres,
with different radial temperature profiles. We calculate synthetic NH3 spectra
and compare the derived column densities and temperatures to the true values.
For high signal-to-noise observations, the estimated gas kinetic temperatures
are within ~0.3 K of the real mass averaged temperature and the column
densities are correct to within ~10%. When the S/N ratio of the (2,2) spectrum
decreases below 10, the temperature errors are of the order of 1K but without a
significant bias. When the density of the models is increased by a factor of a
few, the results begin to show significant bias because of the saturation of
the (1,1) main group. The ammonia spectra are found to be a reliable tracer of
the mass averaged gas temperature. Because the radial temperature profiles of
the cores are not well constrained, the central temperature could still differ
from this value. If the cores are optically very thick, there are no guarantees
of the accuracy.
