Of Astronomy, Stars and Data. A data-driven explanation of the... | by Sowmya Krishnan | Towards Data Science

Astronomy is one of the most ancient, data-driven sciences. The late 1800s saw the rise of ‘Astrophotography’, a photography technique employed to capture and create a data-bank of photographic plates of astronomical objects, celestial events, and areas of the night sky.
As early as 1875, Harvard College Observatory began employing an increasing number of women assistants (though this decision was more from an economic perspective than an ethical one) to work with the glass plates. These women would work for six days a week to catalog, compute and interpret data from these plates, thereby mapping the universe.
With an inordinate amount of data being produced using modern instruments, astronomy has become more data driven than ever before. While working on the “stars” data set sourced from R’s ‘dslabs’ package, I came across an interesting exercise to analyze a set of real astronomical data to inspect properties of stars, the different categories they belong to, their apparent & absolute magnitudes, spectral types and surface temperatures.
A little background in stellar evolution and properties essential to studying and categorizing a star would further help understand this exercise.
Consider two sources of light — a flashlight in your hand and a distant streetlight a certain point away. Superficially, one would come to a conclusion that the flashlight in our hand is brighter than the far away streetlight. In essence, this problem translates to stellar brightness. A casual glance at stars does not help reveal if the star is a nearby glowing ember or a distant large beacon. To distinguish between how bright a star looks and how bright it really is, astronomers make use of the apparent vs absolute magnitude measure.
As is understood from the name, apparent brightness is the relative brightness of a star perceived by an observer on the Earth whereas absolute brightness is the same observer’s perception if all the stars were to be magical placed at the same standard distance.
One way of measuring apparent brightness is in terms of units of photos per second. A more convenient way is to express this as a ratio of a prominent bright star with the actual star. Sirius, the brightest star, has an apparent magnitude of -1.46, while the faintest stars visible to the naked eye have magnitudes of about 6.
The apparent brightness of a star, majorly, depends on two factors:
1. Actual Brightness
2. Distance from the Earth
On the other hand, absolute magnitude reflects the true amount of light emitted by the star. We therefore express this value as the luminosity of the star.
Henry Draper was the first to photograph stellar spectra in the year 1872. The ‘women computers’ at Harvard subsequently carried out his dream of photographing and cataloging all the bright stars in the sky. Spectral classes were soon arranged according to temperature and had letter designations in a sequence that went from hot to cool in the order — O, B, A, F, G, K and M. Type O stars have the highest surface temperatures that can be as hot as 30,000 Kelvins and Type M stars can be as cool as 3,000 Kelvins.
Let’s color the points in the data set by star type. This classification describes the properties of the star’s spectrum, the amount of light produced at various wavelengths.
stars %>%    ggplot(aes(log10(temp), magnitude, col=type)) +    geom_point() +    geom_text(aes(label = star)) +    scale_x_reverse() +    scale_y_reverse()
A density plot of temperature shows that majority of the stars have a low temperature.
stars %>%    ggplot(aes(temp)) +    geom_density()
Below give is a scatter plot of the data with temperature on the x-axis and magnitude on the y-axis. Most stars are shown to follow a decreasing exponential trend. These are also known as the main sequence stars that we will talk about later.
stars %>%    ggplot(aes(temp, magnitude)) +    geom_point()
For various reasons, scientists do not always follow straight conventions when making plots, and astronomers usually transform values of star luminosity and temperature before plotting. We’ll flip the y-axis so that lower values for magnitude will shift towards the top of the axis.
stars %>%    ggplot(aes(log10(temp), magnitude)) +    geom_point() +    scale_x_reverse() +    scale_y_reverse()
From Stefan-Boltzmann Law, we know that:
Like black bodies, stars also emit radiations. Hence, we can make use of the above three properties (luminosity, radius and temperature) to compare and categorize stars. Ejnar Hertzsprung and Henry Russells plotted the now famous H-R Diagram which became a fundamental tool of modern astronomy. Plotting spectral classification against absolute magnitude, they found that most stars lay on certain regions in the diagram.
Noticeable empty zones give rise to a question if stars necessarily appear throughout the diagram or only at certain combinations of temperature and luminosity? Turns out that stars falling in regions other than the four highlighted above, are rare or non-existent.
The four main star sequences are as follows:
Main Sequence
The narrow band of stars running from the upper left to the lower left corner forms the Main sequence. These stars the mirror the fusion reactions within the Sun’s core. The larger stars in this sequence (high luminosity, high temperature) undergo rapid fusion reactions. Therefore, higher the position of the star in this sequence, shorter its life. And lower the position, longer the life.
Giants
The cluster of stars located above the Main Sequence in the upper right-hand corner is termed as Giants. These stars mostly appear red in color owing to their large radius and low surface temperatures. Having burnt all the hydrogen into helium, these stars have entered the final stage of their life.
Super Giants
With a radii larger than those of the Red Giants, the Super giants are scattered above the Main Sequence and Giant stars. The Helium-carbon fusion process happens much faster in these stars due to their masses and hence they never become Giants. Super Giants can fuse carbon into oxygen, oxygen into neon, neon into magnesium, magnesium into silicon, and finally, silicon into iron. With an iron core, the super-giant will ultimately die in a supernova explosion. Depending on the original mass of the star, the result would be a neutron star or a black hole.
White Dwarfs
The few stars found in the lower left corner of the Main Sequence stars. The fusion reaction for these stars stops with carbon and the core eventually begins to shrink. The outer layer dissipates and all that remains is the small cool core of the star. White dwarfs have temperatures that result in yellowish-white to bluish-white colors.
Since we can now identify whether specific stars are main sequence stars, red giants or white dwarfs, let’s now label all the stars in our data set to locate some specific stars.
stars %>%    ggplot(aes(log10(temp), magnitude)) +    geom_point() +    geom_text(aes(label = star)) +    scale_x_reverse() +    scale_y_reverse()
We know that Super Giants are stars with lowest temperature and highest luminosity. Looking at the plot above, we see Betelguese and Antares are the super giants in this dataset. While Van Maanen’s the least luminous star in the sample.
If you look at the plot a little more closely, you’ll see the Sun present in the Main sequence of stars. So is Alpha Centauria.
There is a place in the H-R diagram where the stars are just exhausting their nuclear fuel. This has been labelled as the ‘main sequence turn-off’ region by the astronomers. This group will contain no main sequence O type stars. Older the cluster, more of the main sequence stars will disappear. They would transform into giants, white dwarfs, or super giants. An important conclusion that can be drawn here is that
The H-R diagram can serve as a tool for dating groups of stars that formed together.
This is an extremely important application that enables astronomers to further probe the ages of stars across galaxies.