  We show that atomic alignment presents a reliable way to study topology of
astrophysical magnetic fields. The effect of atomic alignment arises from
modulation of the relative population of the sublevels of atomic ground state
pumped by anisotropic radiation flux. As such aligned atoms precess in the
external magnetic field and this affects the properties of the polarized
radiation arising from both scattering and absorption by the atoms. As the
result the polarizations of emission and absorption lines depend on the 3D
geometry of the magnetic field as well as the direction and anisotropy of
incident radiation. We consider a subset of astrophysically important atoms
with hyperfine structure. For emission lines we obtain the dependencies of the
direction of linear polarization on the directions of magnetic field and the
incident pumping radiation. For absorption lines we establish when the
polarization is perpendicular and parallel to magnetic field. For both emission
and absorption lines we find the dependence on the degree of polarization on
the 3D geometry of magnetic field. We claim that atomic alignment provides a
unique tool to study magnetic fields in circumstellar regions, AGN,
interplanetary and interstellar medium. This tool allows studying of 3D
topology of magnetic fields and establish other important astrophysical
parameters. We consider polarization arising from both atoms in the steady
state and also as they undergo individual scattering of photons. We exemplify
the utility of atomic alignment for studies of astrophysical magnetic fields by
considering a case of Na alignment in a comet wake.
