Jump to main content

Using a Digital Camera to Measure Skyglow

1
2
3
4
5
589 reviews

Abstract

This is a great project for someone interested in both stargazing and photography. Bright city lights and even the light of the full Moon obscure the dimmest stars, which can make identifying constellations more difficult. In this astronomy science project, you will calibrate a digital camera to measure the skyglow in different locations. This can be a great tool to comparing the quality of different star viewing locations.

Summary

Areas of Science
Difficulty
 
Time Required
Long (2-4 weeks)
Prerequisites
You should have already taken an algebra class and understand what a function is.
Material Availability
A digital camera with full manual control is essential for this project. If you cannot manually control the ISO, shutter speed, focus, and lens aperture of your camera, then your camera will not work for this project. See the Materials and Equipment list for details.
Cost
Very Low (under $20)
Safety
Take an adult with you when you take skyglow photos at night.
Credits

Terik Daly and Andrew Olson, PhD, Science Buddies

This project is based on an article in Sky & Telescope magazine: Flanders, T., 2006. "Measuring Skyglow with Digital Cameras," Sky & Telescope, February, 2006: 99–104.

Objective

In this astronomy project, you will calibrate the image sensor in your digital camera. Then, you will use your camera to compare the amounts of skyglow in different locations.

Introduction

If you've ever seen the clear night sky out in the country or away from city lights, you know that many more stars can be seen under these darker conditions. In urban and suburban areas, however, skyglow—which is scattered light in the atmosphere—obscures dimmer stars (see Figure 1, below).

Image of the constellation Orion visible against a dark sky next to an image of the constellation blurred by city lights
Figure 1. The constellation Orion. The picture on the left was taken in an area with very dark skies, while the image on the right was taken in the suburbs. The skyglow produced by artificial lights obscures most of the stars in the picture on the right (Image credit: Jeremy Stanley, 2009, Wikimedia commons).

In urban areas, light pollution created by artificial light sources is the biggest contributor to skyglow. Natural sources, such as zodiacal light and airglow, also contribute. Zodiacal light is created as dust in space scatters sunlight. It is typically very faint and appears as a glow near the horizon. Airglow consists of light emitted in Earth's upper atmosphere as a result of certain chemical reactions. It is also very faint. These natural sources are the primary source of skyglow outside of urban areas.

Professional astronomers use sophisticated tools to precisely measure skyglow. Experienced stargazers can estimate the amount of skyglow by noting what features of the night sky they can and cannot see. But, there is also another way to measure skyglow. If you own a digital camera with full manual control, you can make your very own tool for measuring skyglow. While you will not be able to measure absolute brightness the way more sophisticated equipment can, you will be able to measure the relative brightness of skyglow in different locations.

The first step toward using your digital camera to measure skyglow is to calibrate the image sensor in your camera. The image sensor consists of pixels laid out like the squares of a checkerboard. Each pixel in the image sensor converts the light that falls on the pixel into an electrical signal. Software in the camera eventually converts this electrical signal into a pixel value between 0 and 255. For grayscale images, a pixel value of 0 corresponds to black; a pixel value of 255 is white. Values between 0 and 255 are various shades of gray. The picture you see on your computer screen or digital camera display is the checkerboard of pixels on the image sensor, where the color of each pixel is determined by the pixel value.

To calibrate the image sensor in your camera, you will expose the sensor to different amounts of light and measure the average pixel value that results. A few features of your camera can affect the image sensor's response to light, including aperture, ISO, and shutter speed. Shutter speed, sometimes called exposure time, is the amount of time the image sensor is exposed to light. In this project, you will vary the amount of light hitting the image sensor by changing the exposure time. You will not be able to measure the exact amount of light that hits your camera's image sensor, but you will be able to compare the relative amounts of light in different images.

In an ideal world, the relationship between the amount of light hitting the image sensor and average pixel value would be a linear function. For example, if twice as much light hit the image sensor (i.e., the exposure time were twice as long), the average pixel value would be twice as high. For an idealized sensor, we can write a linear equation (the "equation of a line") that relates the amount of light hitting the image sensor to the average pixel value, P:

Equation 1:

The sensitivity constant, S, describes how much the average pixel value increases with increasing exposure time. The detection limit, D, relates to how much light has to hit the image sensor before the sensor can create a meaningful image. The detection limit is sometimes called the "noise floor". For example, if the detection limit of an image sensor were a pixel value of 10, and a photo with a 1/1,000 sec exposure gave you an average pixel value of 10, then a 1/4,000 sec exposure would also give an average pixel value of about 10. The amount of light in both cases is so small that random electrical noise in the image sensor would overwhelm the tiny signal generated by the small amount of light that fell on the image sensor.

A similar situation also happens when too much light hits the image sensor. The image sensor is saturated when increasing the exposure time does not increase the average pixel value. For example, if the average pixel value in an image taken with a 2 sec exposure were 255 (the highest pixel value possible), then the sensor is saturated. No matter how much longer you expose the sensor to light, the average pixel value will always be 255.

The sensitivity constant, S, and detection limit, D, vary from image sensor to image sensor, camera to camera, and with camera settings. So, every image sensor has to be tested to find out what S and D are for that particular sensor.

Unfortunately, the relationship between exposure time and average pixel value usually is not linear in images with pixel values that range from 0 to 255. Instead, the relationship is non-linear. This is often due to the software inside the camera that converts the electrical signals from the image sensor into pixel values. For a non-linear response, we have to make a change to Equation 1:

Equation 2:

Now, instead of a sensitivity constant, S, we have a sensitivity function, S(t) that depends on exposure time. And, the function S(t) changes depending on whether you are near the detection limit of the image sensor, near the saturation limit of the detector, or somewhere in between. The purpose of calibration is to figure out S(t). Because S(t) can be a complicated function, we will not try to figure out the exact equation; instead, we will make a calibration curve. A calibration curve is a graphical representation of the relationship shown in Equation 2, but we can use it without having to actually find the function S(t) analytically. Once you make your calibration curve, you will be able to compare the skyglow at different locations (or at different times in the same location).

Calibration is an essential step for any new telescope, camera, or spectrometer that will be used for research. Calibration for image sensors on spacecraft missions, for example, lasts months or even years and costs millions of dollars. Calibration for such instruments takes such a long time (and costs so much money) because those scientists want an absolute calibration. They want to know exactly how the sensor responds to specific numbers of photons. For this project, you will do a relative calibration. You want to investigate how skyglow compares in different locations, but it is not important to know precisely how much light is in each location.

Terms and Concepts

Questions

Bibliography

This project is based on an article in Sky & Telescope magazine:

  • Flanders, T. (2006). "Measuring Skyglow with Digital Cameras," Sky & Telescope, February, 2006: 99–104.
  • Cizano, F. (2000). The Night Sky in the World. Retrieved August 25, 2014.
  • Cambridge in Colour. (n.d.). Camera Exposure. Retrieved August 25, 2014.
  • Nice, K., Wilson, T. V., and Gurevich, G. (n.d.). How Digital Cameras Work. Retrieved August 25, 2014.

Materials and Equipment

Experimental Procedure

Calibrating Your Digital Camera

  1. Set up a piece of white paper so that it is uniformly illuminated by indirect sunlight. Choose a place where the light is bright, but you should not see any shadows on the paper. Taping the paper on the wall next to a large window during the day would work well, for example. You could also set up the paper in the shade of a building outside. The most important thing is that the paper is illuminated evenly, with no bright spots or shadows. Choose a time and place during which it is unlikely there will be any changes in lighting, such as the Sun passing behind clouds.
  2. Position your digital camera so that the white paper fills the entire field of view. The precise distance from the camera to the paper is not critical.
    1. Tip:Mount the camera on a tripod, if you have one. Otherwise, place the camera on a solid support, such as a sturdy box or table. Many of the exposures will be too long for you to hold the camera steady in your hands.
  3. Put the camera in manual mode and make the following adjustments:
    1. Manually adjust the focus so that the camera is focused on the white piece of paper. Once you set the focus, do not change it during the calibration.
    2. Set the camera's sensitivity to ISO 200.
    3. Set the aperture to f/2.8.
    4. Set the image resolution to a low setting (e.g., 640 × 480).
    5. If your camera has a self-timer feature, set it so that the camera shutter opens a few seconds after you press the button to take a picture. This minimizes camera shake.
  4. Now that your camera is focused on the white piece of paper, with the settings adjusted correctly, you are ready to take calibration photos. Take a series of photos at different shutter speeds, varying by a factor of 2 each time. Use 30, 15, 8, 4, 2, 1, 1/2, 1/4, 1/8, 1/15, 1/30, 1/60, 1/125, 1/250, 1/500, and 1/1,000 sec shutter speeds.
    1. Tip: Make sure that shutter speed (exposure time) is the only thing that changes between pictures. All other camera settings and the position of the camera should stay the same.
  5. Repeat step 4. This will give you two complete series of calibration photos. You will compare the two sets of photos later in this procedure.
  6. Follow your camera's instructions to download all of the calibration photos onto your computer.
  7. Make two data tables in your lab notebook to keep track of the pixel value information for each calibration photo. One data table will be for the first set of calibration photos. The other data table will be for the second set of calibration photos. Set up each data table as shown below.
    1. Tip:The photo browsing software on your computer will tell you the exposure time or shutter speed for each image file. Remember, exposure time and shutter speed are the same thing.
Filename Exposure Time
(sec)
Pixel Value Statistics
Mean Std. Dev. Min MaxMode
       
       
Table 1. Data table for recording pixel value information for calibration photos. Make two copies of this data table: one for each set of calibration photos.
  1. Measure the average pixel intensity of each photo using ImageJ, a free scientific image analysis program.
    1. You can download ImageJ here: http://imagej.nih.gov/ij/download.html.
    2. Start ImageJ. You will see a small window similar to the one in Figure 2, below. The colored 'skin' may look slightly different on your system. This window is the ImageJ menu bar.

      Screenshot of the menu bar in the program ImageJ

      The program ImageJ has a very small window that consists only of a row of icons and file menus.


      Figure 2. The ImageJ menu bar.

    3. Open the first calibration photo using the "File/Open..." menu command.
    4. Click on "Analyze" and select "Histogram" from the drop-down menu.
    5. A histogram of the pixel values in the photo will open in its own window, similar to Figure 3, below. You will use this histogram to measure the average pixel gray value in each image.

      Screenshot of a histogram measuring the grey value of pixels in an image in the ImageJ program

      The program ImageJ opens an image in a new window that only contains the image. The program can also create a histogram in a separate window that plots the pixels in the opened image by their gray values. This example screenshot shows an almost entirely gray image with two black bars and the histogram shows a large group of data points clustered around similar gray values as well as a large group of pixels that are purely black.


      Figure 3. The histogram of pixel values.

    6. Record the Mean, StDev, Min, Max, and Mode in your data tables. StDev is short for "standard deviation". Min and Max are short for minimum and maximum, respectively. Mean is another name for the average. The mean of this histogram is the average pixel value.
    7. Click on "File" and select "Open Next" to open the next image file. You can also use the keyboard shortcut Ctrl+O to do this.
    8. Repeat steps 3.d.–3.g. until you have analyzed all images in both sets of calibration photos.
  2. Make a calibration curve by graphing the average pixel value (the mean of the histogram) on the x-axis and exposure time (in seconds) on the y-axis. Use a logarithmic scale for the x-axis and a normal (linear) scale for the y-axis. Your graph will have two data series, one for each set of calibration photos. Choose different colors or symbols for each series.
    1. This kind of graph is called a "semi-log" plot. You can make a semi-log plot by using semi-log graph paper or by formatting the x-axis in your graphing software.
    2. It is helpful to use a logarithmic scale for the x-axis because exposure times vary by a factor of more than 10,000. If you made this graph using a normal, linear x-axis, it would be difficult to see the calibration curve clearly.
  3. Look at your graph and compare the calibration curves from each set of photos. The two curves should overlap or only be slightly separated. If there is a lot of space between the two calibration curves or if one of the curves has a very different shape from the other, you will need to repeat steps 1–9, making sure that the lighting conditions are the same for both sets of photos.

Taking Skyglow Photos

  1. Now that you have finished calibration, you are ready to measure skyglow. Identify three or four places where you would like to measure skyglow. Choose places you think will have different amounts of skyglow. Write a hypothesis about which site you think will have the darkest and brightest skyglow, respectively.
    1. Keep in mind that you will need to visit these places at night. Plan to take an adult with you for safety.
    2. If you will be out photographing under cold weather conditions, check out these 10 tips for cold weather photography before you head out.
    3. Plan to measure skyglow at the same time of night in each location you visit. If your locations are far from each other, you will need to visit different locations on different nights.
    4. The presence or absence of clouds can cause variations in your measurements. Check the weather forecast and only make measurements on nights with clear skies.
  2. Travel to your first location. Don't forget your camera, tripod or sturdy box or table, towel or rag, lab notebook, and something to write with. Your first location must be the one that you predict will have the brightest sky so that you can set exposure time appropriately. Choose a clear night so that clouds do not affect your measurements.
  3. In your lab notebook, write down the address of your first location. You could also include GPS coordinates, if available (you can look up the GPS coordinates with various online tools or mapping software). Write a brief description of the location in your lab notebook. What does it look like? Is it in a city or out in the country? Are there lots of street lights? What is the weather like?
  4. Set up your camera to take skyglow photos. Make sure the camera is in full manual mode. It is essential that you use the exact same camera settings at each site you visit. With the exception of focus and exposure time, these are the same settings you used for calibration photos.
    1. Manually adjust the focus so that the focal length is infinity (or as long as your lens will allow).
    2. Set the camera's sensitivity to ISO 200.
    3. Set the aperture to f/2.8.
    4. Set the image resolution to a low setting (e.g., 640 × 480).
    5. Set the shutter speed (exposure time) to 30 sec.
    6. If your camera has a self-timer feature, set it so that the camera shutter opens a few seconds after you press the button to take a picture. This minimizes camera shake.
    7. Lay your towel or rag on the ground, then lay the camera down on it, with the lens pointing toward the sky. If you have a tripod, you can mount the camera on the tripod and then point the camera toward the sky.
  5. Double-check that your camera's field of view does not include the Moon, street lamps, or house lights. If any of these things are in your camera's field of view, reposition the camera so that only the night sky fills the field of view.
  6. Take skyglow photos.
    1. If large parts of the photo with the 30 sec exposure time appear white, the image is saturated. Decrease the exposure time until only the stars are saturated. Because the first location is the place you predict will have the brightest skyglow, if the images from the first location are not saturated, then images from your other sites will also not be saturated.
    2. If something unusual happens, such as a car's headlights shine on you, retake the skyglow photo.
  7. Repeat steps 2–5 for each of the remaining locations where you plan to measure skyglow. Remember to always use the same exposure time that you used at your first location, even if the photos appear very dark.

Using Your Calibration to Measure Skyglow

  1. Use the ImageJ software to measure the average pixel value in each skyglow image by following the procedure in step 8 of the Calibrate Your Digital Camera section. Make a data table, like the one below, in your lab notebook, and record the mean, standard deviation, minimum, maximum, and mode of each pixel value histogram.
FilenameLocationExposure Time
(seconds)
Pixel Value Statistics EET (s)
Mean Std. Dev. MinMaxMode
          
          
Table 2. Data table for recording pixel value information for skyglow photos.
  1. Because all of your skyglow images were taken with the same camera settings and exposure time, you can use the calibration curve to determine an "equivalent exposure time" (EET) for each skyglow photo. The EET is how long the exposure time would have to have been under calibration conditions to reach the same average pixel value as measured in the skyglow photo. Figure 4, below, shows how this process works.
Graph of a skyglow calibration curve measuring exposure time over pixel values

The average pixel values from numerous calibrated photos are graphed and form a positive linear slope until it plateaus at the highest chart value (a pixel value of 255).


Figure 4. An example calibration curve. The purple dots show the average pixel values measured from the calibration photos. To use the calibration, take the average pixel value from a skyglow photo and find the corresponding exposure time on the calibration curve that gives that average pixel value. For a given average pixel value, move horizontally to the right from the y-axis until you intersect the calibration curve. Then drop down to the x-axis and read off the exposure time (in seconds) that would have been required to obtain the same average pixel value under calibration conditions. This number is the EET. In the example shown here, an average pixel value of 75 corresponds to an EET of 0.003 sec. This means that as much light hit the image sensor during a 30 sec exposure to skyglow as fell on the sensor during a 0.003 sec exposure under calibration conditions.
  1. Convert the average pixel value in each skyglow image to an EET using the process described in the caption to Figure 4, above. Record the EET for each image in your lab notebook.
  2. By converting the average pixel values of each skyglow image into an EET, you can determine how much brighter or darker one location is compared to another.
  3. Determine which of your skyglow locations had the smallest EET. This is the location with the darkest skyglow.
    1. Divide the EET of all other skyglow locations by the EET at the darkest location. Write the resulting values in your lab notebook. These numbers are the ratios between the EET at the two sites. The ratio of EETs is the ratio of the sky brightness of the two sites. For example, if the darkest skyglow site had an equivalent exposure time of 0.003 and a second site had an EET of 0.03, then the skyglow at the second site is 0.03/0.003 = 10 times brighter than the darkest location.
    2. Note: This relative brightness comparison only works if you are comparing photos taken with the same exposure time.
  4. Which of your locations had the darkest skyglow? How much brighter was the skyglow in the brightest location you photographed? Did these locations match with your hypothesis?
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Variations

  • For a more basic experiment on light pollution, see the Science Buddies project Where Did All the Stars Go?
  • In addition to comparing skyglow at different places at the same time of night, you can also try comparing:
    • Skyglow in the same location on both cloudy and clear nights.
    • Skyglow in the same location at different times of the night (e.g., shortly after dusk, midnight, pre-dawn).
    • Skyglow in the same location during different seasonal conditions (e.g., snow on the ground vs. not, leaves on trees vs. not, Milky Way visible vs. not).
    • Skyglow in the same location as the phases of the Moon change.
  • For more-advanced students, "Starlight, airglow, scattered moonlight and various kinds of artificial lights have different spectral signatures. It should be possible to tease out a huge amount of information about those by comparing the readings of the red, green, and blue pixels. Anybody interested in the challenge?" (Flanders, 2006). Can you use spectral information from your camera (i.e., red, green, and blue values) to identify the source of the skyglow?

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Astronomers think big! They want to understand the entire universe—the nature of the Sun, Moon, planets, stars, galaxies, and everything in between. An astronomer's work can be pure science—gathering and analyzing data from instruments and creating theories about the nature of cosmic objects—or the work can be applied to practical problems in space flight and navigation, or satellite communications. Read more
Career Profile
Lights, camera, action! It takes more than actors to put an exciting motion picture movie together. It takes film and video editors and cutting-edge computer technology to make an exciting movie that people want to see. From the many thousands of minutes of film and video, the editor has to choose the best shots to tell a cohesive and compelling story. In addition to having an artistic bent, the film and video editor must relish working with complicated computer equipment. If you would like to… Read more
Career Profile
Statisticians use the power of math and probability theory to answer questions that affect the lives of millions of people. They tell educators which teaching method works best, tell policy-makers what levels of pesticides are acceptable in fresh fruit, tell doctors which treatment works best, and tell builders which type of paint is the most durable. They are employed in virtually every type of industry imaginable, from engineering, manufacturing, and medicine to animal science, food… Read more
Career Profile
Physicists have a big goal in mind—to understand the nature of the entire universe and everything in it! To reach that goal, they observe and measure natural events seen on Earth and in the universe, and then develop theories, using mathematics, to explain why those phenomena occur. Physicists take on the challenge of explaining events that happen on the grandest scale imaginable to those that happen at the level of the smallest atomic particles. Their theories are then applied to… Read more

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Science Buddies Staff. "Using a Digital Camera to Measure Skyglow." Science Buddies, 20 Nov. 2020, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Astro_p022/astronomy/using-a-digital-camera-to-measure-skyglow. Accessed 19 Mar. 2024.

APA Style

Science Buddies Staff. (2020, November 20). Using a Digital Camera to Measure Skyglow. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Astro_p022/astronomy/using-a-digital-camera-to-measure-skyglow


Last edit date: 2020-11-20
Top
We use cookies and those of third party providers to deliver the best possible web experience and to compile statistics.
By continuing and using the site, including the landing page, you agree to our Privacy Policy and Terms of Use.
OK, got it
Free science fair projects.