  Kinetic theory describes a dilute monatomic gas using a distribution function
$f(q,p,t)$, the expected phase-space density of particles. The distribution
function evolves according to the collisionless Boltzmann equation in the high
Knudsen number limit. Fluid dynamics is an alternative description of the gas
using hydrodynamic variables that are functions of position and time only.
These hydrodynamic variables evolve according to the compressible Euler
equations in the inviscid limit. Both systems are noncanonical Hamiltonian
systems. Each configuration space is an infinite-dimensional Poisson manifold,
and the dynamics is the flow generated by a Hamiltonian functional via a
Poisson bracket. We construct a map $\mathcal{J}_1$ from the space of
distribution functions to the space of hydrodynamic variables that respects the
Poisson brackets on the two spaces i.e. a Poisson map. It maps the $p$-integral
of the Boltzmann entropy $f\log f$ to the hydrodynamic entropy density. This
map belongs to a family of Poisson maps to spaces that include generalised
entropy densities as additional hydrodynamic variables. The whole family can be
generated from the Taylor expansion of a further Poisson map that depends on a
formal parameter. If the kinetic-theory Hamiltonian factors through the Poisson
map $\mathcal{J}_1$, an exact reduction of kinetic theory to fluid dynamics is
possible. This is not the case, but by ignoring the relative entropy of $f$ to
its local Maxwellian, we can construct an approximate Hamiltonian that factors
through the map. The resulting reduced Hamiltonian generates the compressible
Euler equations. We can thus derive the compressible Euler equations as a
Hamiltonian approximation to kinetic theory. We also give an analogous
Hamiltonian derivation of the compressible Euler--Poisson equations with
non-constant entropy, starting from the Vlasov--Poisson equation.
