John Hayes avatar

Early last summer, while I was working on a new image, it occurred to me that the SpectrophotometricColorCalibration tool in PixInsight was generating all of the information that is needed to plot star data from a globular cluster as a Hertzsprung-Russell diagram. A couple of decades ago I used to write a lot of code but those days are long gone so I personally didn’t have the skills to do anything with this idea. A few days later, Adam Block and I were talking on the phone and at the end of the conversation, I brought up this idea. Adam immediately understood what I was suggesting and he said, “I know a guy who could write the code.” That led to an introduction to Mike Cranfield and to a collaboration between Mike, Adam, and myself to produce an easy-to-use tool that would allow PixInsight users to explore H-R diagrams along with stellar evolution using data from their own telescopes.

So, what is this diagram and why is it so important? The Hertzsprung-Russell (H-R) diagram was created independently, first in 1911 by Ejnar Hertzsprung, a Danish chemist and astronomer, and later in 1913 by American astronomer, Henry Norris Russell. It is an important tool used to develop the theory of stellar evolution. The basic concept of the diagram is to produce a scatter plot showing absolute stellar brightness plotted against color temperature for a large population of stars. Young, massive hot, blue stars will appear on the upper left leading downward and to the right with cooler, less luminous, redder stars in the lowest right quadrant. Most stars will fall along this downward diagonal trend forming what is called the “main sequence.” Certain stellar types, such as white dwarfs and red giants appear off the main sequence. The life span of a star and its ultimate fate depend heavily on its initial mass. Where stars “exit” the main sequence as they burn through their reserves of fusible hydrogen provides clues about their age. Here is what the main sequence looks like in a classic HR diagram.

📷 HRDiagram.pngHRDiagram.png (Image courtesy Richard Powell, Wikipedia)

There are a couple of different incarnations of the H-R diagram. When Hertzsprung, published his first diagrams in 1911, he was working on star clusters so all of the stars were at approximately the same distance, which allowed him to ignore the difference between apparent and absolute magnitudes so he used apparent stellar magnitudes. Russell’s first diagrams incorporated stars with known distances so he plotted his data relative to absolute magnitude, which is a measure of the star’s actual luminosity.

The horizontal axis can show the stellar temperature or the spectral class, which is known as a theoretical H-R diagram. If the horizontal axis shows an observed color index, the plot is called an observational H-R diagram. The conversion between color index and stellar temperature requires a conversion between the difference in color magnitudes using a known, well-defined filter set. The standard conversion requires data measured using Sloan B and V filters with corrections applied for the sensor spectral responsivity. In our diagram, users will typically use standard RGB filters that don’t have specific bandpass specifications along with different cameras so it becomes challenging to provide a general-purpose algorithm to show stellar temperature. Therefore, the diagrams that this tool produces are strictly observations diagrams using the B-R magnitudes. It should be possible to use narrow band filters to overcome this limitation but there are some challenges to that idea (mostly due to the reduced throughput of NB filters) so that’s a potential project for the future.

The genesis of this idea happened back in June, 2019 when Tolga Gumusayak collaborated with Robert Vanderbei of Princeton to produce a HR diagram for M13 that won an APOD award. At the time, it seemed like a straightforward idea and I put it in the back of my mind as something that I’d eventually like to do myself. So, when I first suggested this idea to Adam, it seemed like a straightforward project. Of course, nothing is ever as easy as it seems at first and along the way, we discussed a number of options to minimize scatter and to make the plots more accurate. Mike quickly realized that by using GAIA data, we had access to parallax data and hence distance information. Adam realized that by looking at proper motion, the star population could be further refined to include only stars in a particular cluster. So, the tool includes options to laterally define the location of the stars to be plotted along with distance and proper motion parameters. To get meaningful results from this tool, it is important to have a fundamental understanding of what it shows and how to set it up.

This tool is most useful for looking at star clusters and well-resolved globular clusters are ideal targets for a couple of reasons. First, they contain a very large number of stars in a compact region of space. Second, all of the stars lie at approximately the same distance. When all of the stars are at approximately the same distance, differences in apparent magnitude relate directly to differences in stellar luminosity, which translates into differences in absolute stellar magnitude.

I just posted an image that I took of 47 Tucanae in 2024 with my GTX130 refractor using L+RGB data; however, the HR diagram was produced using only the linear RGB channels of that data set. You can see that image here: https://app.astrobin.com/i/decy0n?r=E. It includes an overlay showing some of the features of the HR diagram for this cluster. I’m reposting much of the narrative from that image here so that there is more room for discussion and to insure that more folks get word of this new script. In addition I can add another example here.

Here is another image of Omega Centauri that I produced with my CDK20 a few years ago showing its HR diagram.

📷 Omega Centauri with HRD.jpgOmega Centauri with HRD.jpgThe script is remarkably easy to use. The first thing to do is to download and install the script from Mike’s Cosmic Photons website at: https://cosmicphotons.com. If you don’t know how to do that, Adam has a nice video explaining the process at: https://www.youtube.com/watch?v=AgzGrDmbppU. Next, if you don’t have them already installed (and you should), you will need to install the full set of 16 DR3 GAIA star database files on your PC. These files are used by SPCC to color calibrate images and they also contain stellar parallax and proper motion data that this script uses for object filtering.

For your first time, I recommend starting with some globular cluster data; although a dense open cluster might also work well. The more stars that appear in the cluster, the better. Just be sure that the stars are reasonably well resolved. If you can, start with a cluster that is reasonably nearby but that isn’t essential.

Stack your data to create a RGB image. Next, use BXT in “Correct Only” mode to correct and align the stars in the linear image. Star correction in BXT helps to align the color data and to refine colors when one or more channels are saturated. Correcting the stars generally helps to reduce scatter in the output to produce a better result. Then, use SPCC to color calibrate your RGB image. Afterwards, do not stretch your data! The script requires linear data to produce a correct result. Now, fire up the script, load your RGB image, and press “Plot Data” to start the analysis. You’ll see that the script invokes SPCC to measure the stellar flux to compute the color index for each star. Within a minute or two, you should see your first H-R diagram plot appear on the screen. Unfortunately, it’s probably not yet a correct plot of the data.

The tool has a lot of options to refine how the data is plotted and it allows the user to filter the image by size and stellar distance to limit which stars are included in the plot. It also allows using distance values in the Gaia DR3/SP databases to plot color verses absolute magnitude values. Checking the distance and proper motion options will tell the script which stars to use and you should see a fairly major change to the plot when you select those options. Mike did an amazing job producing documentation for this script. It not only tells you how to use the script but it goes into some of the physics behind what it shows. So, be sure to check it out.

My goal here is really just to announce the availability of the script; not to provide detailed instructions about how to use it. Adam has produced an outstanding instructional video that reviews the operation and features of the script and how to interpret the H-R plots that you can produce from your own data. I highly recommend watching Adam’s video. You can find it here: https://www.youtube.com/watch?v=rfmWigz66v0.

📷 image.pngimage.pngFinally, I want to publicly thank Mike for all of the hard work he put into producing this script. Adam and I helped with brainstorming but we served mostly as advisors, beta testers, and reviewers. Mike did the really heavy lifting to bring this project to completion and it was a real pleasure working with him. This is a really impressive script and I think that once you try it out, you will see what I mean. It is one of the very few scripts available for use in the Pixinsight ecosystem that allows users to go beyond image processing to look at the astrophysics of stellar evolution. Over the years, a few others have written code to produce H-R diagrams but this script takes it to a new level, making it very easy to produce your own diagrams using your own data.

Have fun creating your own HR diagrams and learning more about the astrophysics of stellar evolution.

John

Well Written Engaging Supportive
Spacetime Pictures avatar

That is really and excellent and elegant idea! Love it :)

Thomas avatar

This is amazing! Looking forward to trying it out. Now I have more of an excuse to image some globular clusters!

Well Written Respectful Engaging
Gordon Pegue avatar

Just tried it out with the TL data I had on 47Tuc.

The script worked much better and resulted in a cleaner HR diagram if I first used DynamicCrop to reduce “pollution” from MW field stars. I imagine there’s settings in the script that can do that too, but for my quick test, here’s my diagram:

📷 HRDiagram.jpgHRDiagram.jpg

Helpful Concise
Tim Hawkes avatar

Great idea John! This is what the hobby is about!

John Hayes avatar

Thomas · Oct 13, 2025, 04:55 PM

This is amazing! Looking forward to trying it out. Now I have more of an excuse to image some globular clusters!

I agree! This script gives new life to imaging globulars and I can’t wait to try some open clusters as well. Adam shows some great results from some open clusters in his video so be sure to check it out. Globulars are very old so the HR diagrams from open clusters tend to show a lot more of the main sequence.

John

Well Written Engaging Supportive
John Hayes avatar

Gordon Pegue · Oct 13, 2025, 05:07 PM

Just tried it out with the TL data I had on 47Tuc.

The script worked much better and resulted in a cleaner HR diagram if I first used DynamicCrop to reduce “pollution” from MW field stars. I imagine there’s settings in the script that can do that too, but for my quick test, here’s my diagram:

📷 HRDiagram.jpgHRDiagram.jpg

That’s fantastic Gordon! You can limit the extents of what data gets included from within the script by using the circular aperture option. If you apply the distance and proper motions filters, I think that you’ll see that you can reduce a lot of the scatter in your plot. Without filtering, you may be including foreground stars that aren’t a part of the object itself.

John

Well Written Concise Supportive
Arny avatar

Love it - thank you!

Arny