Whether you are an amateur astronomer taking images of the night sky for pure amusement, or an astrophysicist sieving over large amounts of data to research star formation from various nebulas or examining young stellar objects (YSO’s), you will use one technique that is key to creating an image that is usable. This technique is called stacking.
- Using it in python
- Future works
You maybe asking, what exactly is stacking. Stacking is what it sounds like. You take the amount of photos you have taken of your object, in this case it will be M31 or otherwise called the Horsehead Nebula, and overlay these images on top of one another. The reason we do this is to reduce as much noise as possible from the image. By doing so, the image of our object becomes crisper with every stack we overlay , allowing for the benefit of enhanced signal-to-noise ratio.
Astronomers, astrophysicists, amateur astronomers, and hobbyists alike all use one specific sensor that enables for present image takers to photograph the night so well. A CCD or charge-coupled device, takes in an electrical signal and outputs an image or video. This is due to various wavelengths of the spectrum given off by our electromagnetic spectrum. Astronomers and astrophysicists use the same device in most, if not all of the current satellites, depending on what part of the electromagnetic spectrum you are trying to capture. However, these beautifully designed machines are not without their flaws. The flaw, in this case, is the amount of noise present in each photo of the celestial object. That is where stacking becomes key.
Utilization of Python and Astropy:
In today’s age, astronomers and astrophysicists alike use data science as a tool to improve models, interpret data, and analyze our universe with even greater confidence. Using a tutorial from AstroPython on viewing and manipulating FITS images. A FITS image, as defined by Wikipedia, is an open standard for defining a digital file format which is useful for storage, transmission, and processing of data formatted as multi-dimensional arrays. Astronomers use these files to take in the information taken from their object of interest. In this case, we will be looking at the Horsehead nebula.
First, task your necessary packages to process the image. To do this you need to import the packages numpy, astropy, plyplt, fits, and LogNorm as I have down below.
Then, we intake the image we want to process either from your local computer or, as in this case, an outside source. We call it to a variable to make it easier for calling this image. Once we have our image we need to open up our image being able to grab the array that is contained in the PRIMARY part of the file. Once we have an array of the image we can plot the array using imshow. Imshow takes a 2D array and outputs a 2D image. The image below shows the gradient of the Horsehead Nebula.
This image gives us a lot of detail about the Horsehead nebula including how the transition of the cloud of dust, gas that is forming the stars, and where the dust cloud stops. This image is great for analyzing what is occurring within this specific nebula, but noise is still present within this image. Now, we can stack the image to further reduce noise. Next, by using the power of a for loop, we can begin to stack the image over and over again, overlaying them as many times as we have images ultimately producing one file. In this example, I used 5 images stacked over each other, before, once again, extracting the array data.
Once I have this concatenated data, I can sum the list of all the arrays from each image and use another for loop to combine all the arrays into one final image.
Before we plot this image, we need to find out the best stretch, that is how best to fit the image on the page, by plotting a histogram of the final image that has been stacked. I can see that our range is from 2000 to 3000 for our color scaling and will use this data to plot the final image. And there you have it, our final image which denotes many of the characteristics of this nebula in a clear and concise manner.
Now we plot our final image with the parameters from the color scaling of 2000 to 3000.
In an upcoming project I will be using this method to stack images of the Small Magellanic Cloud (SMC) where the several YSO’s live, that I have classified in my thesis. This will assist in significantly reducing the amount of noise to get the best FIT image of the area of interest in the SMC. This will enable me to then extract the necessary information to plot the near infrared spectrum and properly determine the stellar characteristics of each of the YSO’s. To be continued….