  The Kepler satellite has provided photometric timeseries data of
unprecedented length, duty cycle and precision. To fully analyse these data for
the tens of thousands of stars observed by Kepler, automated methods are a
prerequisite. Here we present an automated procedure to determine the period
spacing of gravity modes in red-giant stars ascending the red-giant branch. The
gravity modes reside in a cavity in the deep interior of the stars and provide
information on the conditions in the stellar core. However, for red giants the
gravity modes are not directly observable on the surface, hence this method is
based on the pressure-gravity mixed modes that present observable features in
the Fourier power spectrum. The method presented here is based on the vertical
alignment and symmetry of these mixed modes in a period echelle diagram. We
find that we can obtain reliable results for both model frequencies and
observed frequencies. Additionally, we carried out Monte Carlo tests to obtain
realistic uncertainties on the period spacings with different set of
oscillation modes (for the models) and uncertainties on the frequencies.
Furthermore, this method has been used to improve mode detection and
identification of the observed frequencies in an iterative manner.
