Process your own JWST images at home
Since its launch, the JWST has not only been giving us an unprecedented new look at the Universe, it’s been leaving global audiences gasping at the beauty that exists across the cosmos. Now, you can also download and process these images with this easy guide - no technical experience required to start.
Astronomy’s newest legacy space-based observatory - the JWST - continues to astonish both the astronomy community and the general public with its awe-inspiring images and data that are sent back to Earth. The infrared observatory, which is as big as a tennis court and boasts a 6.5-metre primary mirror, was orbited back on Christmas day in 2021 and has been capturing exquisite details from different objects across the cosmos.
So far, the telescope has given humanity some remarkable views inside the hearts of distant galaxies, taken a look at the aftermath of supernova explosions, surveyed the gas and ice giants in our Solar System, and peered deep into giant molecular clouds, to name a few of its targets.
Along with this wonderful imagery, the JWST has also been collecting spectral data on the atmospheres of exoplanets, stellar objects, and resolved some of the furthest galaxies known (which were born only a few hundred million years after the Big Bang).
Historically, access to images and data from professional astronomical observatories has sometimes been challenging to get, but that’s beginning to change. Many telescopes, including the JWST, now publish their data on public forums for anyone to go in, download and use as they like.
Over the last year and a half, I’ve been downloading JWST data and colour processing it, to bring out the beautiful details of many different types of space objects, so I thought I would share how you too can also do this.
What You’ll Need
Ok, to get you started there are a few things that you will need a few things. Of course, you will need access to the internet, so you will need your computer to download the images. I have found that doing this on the desktop is much easier than trying to do this on a smaller-screen device.
Along with your computer, you will also need some image processing software. I use SAOImage DS9, which can be a bit tricky and clunky, but easily usable once you get in there and start playing with it. If you don’t have DS9, then I recommend you download it. Alternatively, any FITS file photo editor that you are familiar with can also work.
And lastly, for those of you who love jazzing images up with filters, then something like Instagram works well too.
Once you have all of these (or similar platforms that you are already using), then we can begin. I must stress, you don’t need to be an expert in these tools to process your own JWST images, but they can be tricky when you first start - so best to just spend time playing around with them, learning their features and their interfaces. You can also look up their guides if you need further detailed assistance.
What to Expect
Now that we have downloaded all of the required software, we’re almost ready to begin, but a little caveat I would like to talk about before we jump in.
This guide is for a very simple method of colour-processing JWST images. I don’t go into any details of scientific image processing, as this requires a chapter of a text book to be written (especially, if you are wanting to bring out the true colour of objects using RGB (red, green, blue) filters.
So, expect to process images from the JWST that are artistically beautiful, full of colour and detail that best represents you, but don’t expect to be processing images in a scientific manner here. If anyone out there is keen on writing a blog about processing scientific JWST images, I would be more than happy to have that blog hosted here on SpaceAustralia.com with your name as the author!
Downloading Images from the JWST
To access the JWST images (or for that matter, images from numerous observatories), you’ll need to first visit the MAST.STScI website. There are a number of blocks of info on the home page, but the YouTube-featured tutorials are always interesting to watch. What you want to do is firstly go into the ‘Advanced Search’. This is a small hyperlink at the top of the page near the search parameter inputs.
Once through, you are presented with a number of filter options that allow you to select different missions, instruments, projects, RA and Decs, and date ranges. To access the JWST database, there are two main boxes we need to make selections from and then one box we need to put input into. These are:
Mission - in this box you will note several observatory missions. Hit the button that says ‘show 17 more’ and you will be presented with a drop-down menu that will have a tick box available for JWST. Scroll down and tick this box.
Product Type - in this box we want to select image items, so go ahead and tick this box as well.
Object Name or Postiion - once you have made these selections, then we need to input the name of the object we are looking for. I have found that the DB cannot resolve for items when you name the planets directly (e.g., ‘Saturn’) so these are harder to locate (you can always do a date range search in the Start Time box below if you know the date the observation was made).
Instead, you can put names of objects located away, like ‘Ring Nebula’ and this sometimes brings it up. What I have found works best is to find the Messier or the NGC designation and use this, as this always brings back the correct data.
Once you have done all three boxes, hit enter and wait for the database to search for the results.
These are presented by the number of records counted on the top left of this page. Once you have some values in there, then hit the ‘search’ button in the top left corner and that will list the results.
The listed results appear on a page that has a number of features. On the left are the filters (so you can turn these off and on as you please to narrow your search), and on the far right is an image panel that shows the image of the object, overlaid with the JWST field of view frames per observation made.
The wide central column is what we are after, which features all the observations taken with the different JWST instruments and different filters. If you read across a row, you can get a lot of info about what the files in that row are. The first thing you are going to want to look just above the column headings on the right and check the ‘show preview’ box. What this will do is show a thumbnail for any of rows that have been made public.
The rows are generally coloured to represent public access. The light orange colour means they are not available, the yellow colour means they are locked, and the white means they are open for public access. You might also notice in the actions columns some icons that can help you determine which are publicly available - if there is a floppy disc icon, it means you can download these, but if there is a lock next to it, it means only people who have access to the DB can download them. What you want are the images that have a floppy disc icon, but no locked icon (the row is white in colour for these ones).
The thumbnail can be small to look at, so you can make this a little bigger by clicking on the three dots below the floppy disc and selecting the ‘show details’ option. A pop-up inset will open which allows you to inspect the image a little closer before downloading.
Important - at this point you will be also able to see some metadata that you should use in crediting your images. We know that this is a JWST image, and we know the agencies involved with this observatory, but what you can grab from this inset is the Proposal PI (the scientists in charge of the team that made the observation) as well as the instrument and filters. I like to write my credits like so:
Credit (I use the camera emoticon here): JWST/NASA/ESA/STScI/<Proposal PI scientist>
Filters (I use the dials emoticon here): <Instrument>/<Filter>
It’s always good practice to provide these proper credits when using these images.
Once you are happy with the image post inspecting the preview and have taken note of what you need to use in the credit, then use the floppy disc icon to download the image package. This will land in your local download folder.
Credit to my friend, Kirsten Banks (@AstroKirsten on socials, go follow her) for pointing me to this all those months ago.
Processing your JWST images
After completing the above process, a zip file should appear in your local downloads directory. You can unzip and extract all the files from within this zip folder to commence processing.
Several sub-folders are produced when you extract the files but keep clicking through them until you get to the large FITS formatted files. These will be tens of thousands or even hundreds of thousands of kb (they are very large files). Once you have spotted them, it is time to pull them into SAO Image DS9 (or just DS9 for short).
Open up this software and use the File > Open function to locate the FITS file in the extracted folder and open this in DS9. This will allow the image to appear in the DS9 interface, which has many options for processing.
The first step I take is to click on the ‘zoom’ button in the tabular menu (right above the image, but the dropdown is also fine) and then use the ‘zoom fit’ feature. This allows the image to fit nicely on your screen size. Don’t be alarmed if the image seems very dark or overly exposed at this stage, you will adjust this shortly.
Once the image has been fitted, use the ‘scale’ button to select a scaling method. Each image can be scaled differently with different outcomes, so it is always good to try a few of these (if not all, just for experimentation). My preference is to use the ‘sqrt’ (square root) scaling option. You will notice a gradient bar at the bottom of the screen going from black on the left to white on the right, and transitioning through greys between.
If you hover your mouse over this bar and use the right mouse button to drag the cursor back and forth, you will change the amplitude values within the image, and bring it to a point where the detail is remarkably visible. Go too far in one direction, and the image is too dark. Go too far in the other direction and the image is too overexposed. There is a balance that needs to be found here, per image you download (and they are always different). So its a good idea to play with the scaling and the amplitude changes until you get the optimal solution.
Once you have the hang of this, you can now start to introduce different colours. From the menu items (either buttons or dropdown - here my preference is the drop-down), go in and select the ‘heat’ option. That should make the image pop out with a fiery orange. Now go and move the amplitude bar left and right at the bottom of the screen to bring out the right amount of detail.
Try a variety of different colours, change their bottom bar amplitude, and see which is your favourite. Once you are ready, you can save the files to your local drive by going File > Save Image > <select the format you wish to use>. I generally save them as PNG or JPEG images.
That’s about as easy as it is to play with JWST data. As I mentioned at the start of this article, this method allows you to toy with the images for artistic purposes, but DS9 is actually a tool that scientists use to apply proper colour, science, and image information into data taken from global observatories. Therefore, there is much more to be explored beyond the ‘artistic approach’ that I have outlined here, and much more science that can come from this tool should you wish to explore this further on your own.
Stacking and Applying Filters
In astrophotography, we often combine many images to bring out a high-quality, high-signal-to-noise image. We do this by integrating (or stacking) many of the same images on top of each other to cancel out the noise, as well as increase the bright pixels. There are also a number of other images that we apply to help us achieve this (darks, flats, bias frames, etc.).
Now that you know how to access, download and artistically alter your JWST image, why stop at one? Go back to the start of the process, and download another image, this time using a separate JWST instrument filter. Then do it again for other filters.
What you should end up with is many of the same images, all taken with a different filter of JWST. You don’t need to stop there as well … instead of just sticking to one of the instruments (say NIRCAM), go and grab lots of images using the MIRI instrument with many filtered versions there as well.
Effectively, what you want to have are many images of the same object, using different instruments and different filters, so that you can now stack these to achieve both a high signal-to-noise and, more importantly, bring out a range of different astrophysical details that each filter and instrument captures. It’s always fascinating to read about what each instrument and filter does, so have a read over the JWST Wikipedia page to learn more about these. They will help you understand what you are seeing with each image and might give you ideas about which colour maps to use as well.
Once you have all of the images you want from all the different instruments and filters, the next step is to stack them on top of each other so that they are perfectly aligned. In this step, you might need to adjust the size, rotation, and alpha (i.e., transparency) of some images to work harmonically together in the finished product.
There are a number of tools you can use to do this (astrophotographers have lots of stacking software that you can look up), but Photoshop or GIMP allows for this as well. Fair warning though - this step can be a bit fidgety.
Then, when you’ve finally finished stacking them all, save the master image and it is ready to go public! As mentioned, some folks might want to tweak it a little further, and using Instagram filters and adjustments is totally fine for this.
Remember, this is meant to be about enjoying and immersing yourself in the ability to use fresh telescope data and share it with your networks, but if you want to do some real science with it, that is the next step up.
Well, that’s about it. Once you’ve done all of the above, your image is now ready to be shared with the world! Share it proudly, and remember to always:
- Apply the proper accreditation (including the principal investigator scientist's name)
- Add in the alt-text image description, so folks with vision impairments can also enjoy your masterpiece
That’s it! Happy JWST image processing, and please share your results with me - i'd love to see them!