A photon is an elementary particle that is weightless and
travels through space at a constant and maximal speed, the speed
of light. It is famous for behaving both like particles, e.g. by
colliding with other particles, and like waves, e.g. by
interfering with other electromagnetic radiation (more about
that
later on).
But most of all, photons are famous for being the particles our
eyes evolved to measure. Some photons, with the right amount of
energy, trigger reactions on the backside of our eyes, telling
our brain how many of those come from which direction, and since
each energy corresponds to a colour, our brain can interpret
what colour comes from what direction. That is also how normal
optical telescopes work. However, most of the energy levels are
quite faint and rare on Earth, so our eyes specialised only in a
narrow group of those colours. Most of the photons therefore are
invisible to our eyes.
So, how does one distinguish the energy of photons if they have
no mass and all the same speed? In fact, photons are
electromagnetic waves, or light; these waves may all travel at
the same speed, but they have different wavelengths. The
wavelength is the distance between two repetitions of a wave,
like the peaks. Visible light has wavelengths of about 0.4 to
0.8 µm. X-rays have wavelengths about 1,000 times smaller,
whereas radio waves may have lengths measured in km.
The maximal height of the light wave is called its amplitude, A,
and is independent of its energy per se. The wave’s amplitude
sets the light’s intensity (how many photons per area per time).
A single photon’s energy depends only on its frequency (or
wavelength). Sine waves oscillate, so that means that over time,
the amplitude of the wave at a given point will go up in a
positive direction, and then down to a negative direction, from
A to -A. To better visualise the amplitude in the illustrations,
the higher its absolute value is, the brighter the pixels will
be. But if you want to see the direction of the wave pointing up
or down, you can turn on the differentiation of both directions,
in which case the blue part would point in the positive
direction, and the red part in the negative direction.
But where do photons come from? In the case of astronomy, the
most important source is stars. In the star’s core, a whole lot
of nuclear reactions occur, mostly the fusion of two hydrogen
atoms into a single helium atom. These reactions emit a
tremendous amount of energy carried by very energetic gamma-ray
photons (at several characteristic and discrete energies). Over
the course of their journey to the Sun’s surface, they will
interact, bounce, collide, being absorbed and then re-emitted,
with and by a variety of very closely packed atoms and
electrons. A star’s matter is so closely packed, and the
“bounces” of the photon with it are being so chaotic, that it
takes a single photon literally thousands of years to travel out
of a star.
Once the photons have reached the outer layer of a star, its
well-named photosphere, they all have lost different energy
levels, changing their colour, and now leaving full speed for a
long journey through outer space.
After exiting a star, the photons can either travel directly
towards the Earth or come to interact with other objects on the
way. Those objects’ matter then again absorb certain photons
with a given energy level, heating up, and then cooling down by
emitting in, once again, lower energies. All the photons whose
energies do not allow them to interact with those atoms pass by.
The material is then transparent for that light.
That is partly how planets and gaseous clouds can be measured.