def get_layers(self, Psurf=<NUM_LIT>, Ptop=<NUM_LIT>, **kwargs):
Psurf = np.asarray(Psurf)<EOL>output_ndims = Psurf.ndim + <NUM_LIT:1><EOL>if output_ndims > <NUM_LIT:3>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>SIGe = None<EOL>SIGc = None<EOL>ETAe = None<EOL>ETAc = None<EOL>if self.hybrid:<EOL><INDENT>try:<EOL><INDENT>Ap = broadcast_1d_array(self.Ap, output_ndims)<EOL>Bp = broadcast_1d_array(self.Bp, output_ndims)<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>Cp = <NUM_LIT:0.><EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>Bp = SIGe = broadcast_1d_array(self.esig, output_ndims)<EOL>SIGc = broadcast_1d_array(self.csig, output_ndims)<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>Ap = Cp = Ptop<EOL><DEDENT>Pe = Ap + Bp * (Psurf - Cp)<EOL>Pc = <NUM_LIT:0.5> * (Pe[<NUM_LIT:0>:-<NUM_LIT:1>] + Pe[<NUM_LIT:1>:])<EOL>if self.hybrid:<EOL><INDENT>ETAe = (Pe - Ptop)/(Psurf - Ptop)<EOL>ETAc = (Pc - Ptop)/(Psurf - Ptop)<EOL><DEDENT>else:<EOL><INDENT>SIGe = SIGe * np.ones_like(Psurf)<EOL>SIGc = SIGc * np.ones_like(Psurf)<EOL><DEDENT>Ze = prof_altitude(Pe, **kwargs)<EOL>Zc = prof_altitude(Pc, **kwargs)<EOL>all_vars = {'<STR_LIT>': ETAe,<EOL>'<STR_LIT>': ETAc,<EOL>'<STR_LIT>': SIGe,<EOL>'<STR_LIT>': SIGc,<EOL>'<STR_LIT>': Pe,<EOL>'<STR_LIT>': Pc,<EOL>'<STR_LIT>': Ze,<EOL>'<STR_LIT>': Zc}<EOL>return all_vars<EOL>
Compute scalars or coordinates associated to the vertical layers.

Parameters
----------
grid_spec : CTMGrid object
    CTMGrid containing the information necessary to re-construct grid
    levels for a given model coordinate system.

Returns
-------
dictionary of vertical grid components, including eta (unitless),
sigma (unitless), pressure (hPa), and altitude (km) on both layer centers
and edges, ordered from bottom-to-top.

Notes
-----
For pure sigma grids, sigma coordinates are given by the esig (edges) and
csig (centers).

For both pure sigma and hybrid grids, pressures at layers edges L are
calculated as follows:

.. math:: P_e(L) = A_p(L) + B_p(L) * (P_{surf} - C_p)

where

:math:`P_{surf}`, :math:`P_{top}`
    Air pressures at the surface and the top of the modeled atmosphere
    (:attr:`Psurf` and :attr:`Ptop` attributes of the :class:`CTMGrid`
    instance).
:math:`A_p(L)`, :math:`Bp(L)`
    Specified in the grid set-up (`Ap` and `Bp` attributes) for hybrid
    grids, or respectively equals :math:`P_{top}` and :attr:`esig`
    attribute for pure sigma grids.
:math:`Cp(L)`
    equals :math:`P_{top}` for pure sigma grids or equals 0 for hybrid
    grids.

Pressures at grid centers are averages of pressures at grid edges:

.. math:: P_c(L) = (P_e(L) + P_e(L+1)) / 2

For hybrid grids, ETA coordinates of grid edges and grid centers are
given by;

.. math:: ETA_{e}(L) = (P_e(L) - P_{top}) / (P_{surf} - P_{top})
.. math:: ETA_{c}(L) = (P_c(L) - P_{top}) / (P_{surf} - P_{top})

Altitude values are fit using a 5th-degree polynomial; see
`gridspec.prof_altitude` for more details.