This summer, visitors to the Princeton Public Library can enjoy a series of stunning photos that line the walls of the second floor hallway and technology center. The bright, colorful prints, which almost look as if they emit their own light, are called astrophotographs.

Taken with a special camera attached to a telescope, they depict stars and other celestial bodies in space, thousands of light years from Earth. The pictures were taken by the library’s current scientist in residence, Professor Robert Vanderbei of Princeton University.

Robert Vanderbei, a professor of operations research and financial engineering at Princeton, captures stunning images of the night sky with specialized equipment set up in his driveway.

Beauty is only one reason to appreciate these photos. As a mathematician, Vanderbei also likes to understand the physical properties of the objects he photographs. He is especially interested in how big the universe is and how to measure the distances to, and sizes of things.

In 2010, he co-wrote a book with J. Richard Gott, published by National Geographic, called “Sizing Up the Universe.” He also teaches a course at Princeton with the same name.

Both the book and the class are all about how people can do these measurements using a telescope and camera that the average person can afford. They cover basic questions, such as, how we know the earth is spherical, how we know how far away the sun and planets are, and how far away stars are.

“In particular, in the class I show how I’ve done some of these things with my own equipment,” said Vanderbei. He sometimes invites students to his home in Belle Mead for demonstrations.

His role as a teacher extends to the library, where as scientist-in-residence for the summer he is leading several public events in addition to displaying his artwork. Up next is a stargazing night on Wednesday, August 7, on the lawn of Mountain Lakes House. On Wednesday, August 14, Vanderbei leads a discussion following a screening of the documentary “Brian Cox: Life of a Universe,” which follows the renowned physicist on travels around Australia exploring the southern sky.

Growing up in Grand Rapids, Michigan, during the Apollo era, Vanderbei was interested in astronomy, as many kids were at the time, and he spent a couple of years with a local astronomy club. “But then I just went out and did other things with my life,” he says. His parents were both clerical workers, and he was the first in his immediate family to go to college.

At Rensselaer Polytechnic Institute he pursued a degree in chemistry because of a favorite high school teacher who was a mentor and friend to him until his death several years ago. “I majored in chemistry mainly just because I thought this guy was awesome and also I liked chemistry. But at some point during my undergraduate education, I realized chemistry was not what I really wanted to do with my life,” says Vanderbei.

The stars don’t change that often, but through his astrophotography, Robert Vanderbei has observed interesting properties of the Crab Nebula.

He earned a master’s in operations research and statistics, also from Rensselaer, and a second master’s and PhD in applied mathematics from Cornell University in 1981. After several post-doctorate fellowships, he worked for the AT&T Bell Labs Math Research Center in Murray Hill, New Jersey. In 1990 came to Princeton University to work in the field of operations research, focused on problem-solving and optimizing decision-making processes. He is now a professor in the Department of Operations Research and Financial Engineering.

Vanderbei rekindled his childhood interest in astronomy in the fall of 1999. A colleague, Kirk Alexander, had a calendar with astrographs in his office in Princeton’s engineering quadrangle. The calendar piqued his interest. “I said ‘Ooh Kirk, you’re into astronomy’ and he said ‘yeah, I’m the director of the Amateur Astronomers Association of Princeton.’ And I said, ‘oh wow, that’s awesome!’ And so he got me interested in it again,” Vanderbei says.

He bought first telescope a few months later. But there was a problem: light pollution. Artificial light from cities and towns makes it difficult to see the night sky in this area. “I subscribed to Sky and Telescope Magazine, and every month I’d get a magazine that would tell me what the cool things are to look at. But living here in New Jersey with the light pollution and with my relatively small telescope and just looking visually with my eye, most of those things I couldn’t see,” he says.

It was a challenge. But it is a challenge that can be overcome with the right equipment — and the field of operations research is all about taking on challenges.

Vanderbei realized that if he took a photograph, he could take a long exposure for several hours — allowing in much more light from the objects he wants to see while using filters to block out unwanted light. This type of photography involves using a long-duration shutter speed to sharply capture the stationary elements of images while blurring, smearing, or obscuring the moving elements.

Long-exposure photography captures one element that conventional photography does not: an extended period of time. The paths of bright moving objects become clearly visible. It in effect makes them brighter and shows their path of movement over time. “I transitioned to photography because I was disappointed in the visual experience,” Vanderbei says. He started taking space pictures in 2002.

Most of the pictures are of astronomical objects called nebulae and globular clusters, which are Vanderbei’s favorite things to photograph. Latin for “cloud” or “fog,” a nebula is an interstellar cloud of dust, hydrogen, helium, and other ionized gases. They are the basic building blocks of the universe. Stars inside these clouds of gas cause them to glow with beautiful reds, blues, and greens. These colors are the result of different elements within the nebula. “I like the nebulae because they’re all different and beautiful, and I like the globular clusters kind of for the same reason,” says Vanderbei.

Derived from the Latin, globulus, which means a small sphere, globular clusters are spherical collections of stars that orbit a galactic core, like a satellite. They are tightly bound by gravity, which gives them their spherical shapes and relatively high stellar densities toward their centers. Vanderbei likes the randomness of the stars’ distribution within the cluster.

“It’s more dense in the middle and it’s beautiful in a different way from the nebulae. But the fact that it’s got sort of this globular density — more density in the middle and less dense as you move out from the center — it makes it also artistically interesting to me,” he says.

Vanderbei’s process is as interesting as the artwork it produces.

People have been doing astrophotography since photography was invented, but the art has advanced dramatically in the last 25 years since the advent of digital photography. A regular DSLR camera can capture decent long exposure photos of the night sky, but to see anything deep into space, such as nebulae, requires a telescope to use in place of the standard DSLR lens.

“I like to tell people a telescope with a camera attached to it is just kind of like a lens on a camera. It’s just that it’s just got a much longer focal length and a much bigger aperture to collect more light,” Vanderbei says.

Vanderbei, however, prefers to use a special camera designed for astrophotography. This camera only takes black and white pictures, which makes it more sensitive to light and, therefore, able to take clearer pictures of bright objects than a color camera can.

To make a color picture Vanderbei uses narrow band filters that are like colored sunglasses. The colored discs are placed into one of seven holes in a computer-controlled wheel-type contraption that sits between the camera and the telescope. It positions the filter right in front of the camera’s chip, where the image is captured. Each filter only lets in one specific wavelength and therefore, color of light at a time and blocks out all others.

“With these narrow band filters, you block out most of the light pollution because I’m just letting through that one color,” he says.

The filters work especially well for photographing nebulae because they only emit specific gasses, which are specific colors. Vanderbei owns five or six different filters but mainly uses two, the hydrogen filter which lets in red light from hydrogen gas, and the oxygen filter, which is a blue-green color.

“So I just use those two filters. I take the hydrogen and make that my red frames, and I take my oxygen and I make that my blue and my green frames,” he says.

Vanderbei owns three telescopes and uses the biggest one for most of his photography. The telescope, with the camera attached to it, is mounted on a tripod, which is attached to a contraption called a wheelie bar that allows him to wheel it around. He bought and assembled the setup 15 years ago and has never taken it apart. He does most of his work from his driveway, and the telescope lives in his garage.

The telescope rotates automatically and is controlled by a laptop computer. The process starts with a polar alignment to ensure the axis of rotation on the telescope’s mount is aligned with the way the earth rotates. This allows the telescope to accurately track objects as they move through the night sky.

Vanderbei manually points the telescope to a particular landmark that is easily visible with the naked eye, such as a bright star. This time of year, he prefers to use the star Vega. “Sort of mid evening in June and July, it’s almost straight overhead,” he says. He inputs that starting point into his computer and can then program the software to move the telescope in different directions from there, depending on what he wants to photograph. “From then on, the rest of the evening, I can just use my computer to point at whatever I want.”

The final image is made by stacking all the individual pictures that were taken during the night in a software program called Maxim DL. Each individual picture in a sequence usually is taken over the course of a few minutes. For example, he may set the exposure for each picture to be two minutes and then take 100 pictures.

“I might start taking them at 11 or 12 at night and finish up at one or two in the morning,” Vanderbei says. He mostly creates still images but will occasionally create short animations by overlaying images taken on different nights. This allows him to easily see if there have been changes in an object over time.

One would think this type of photography would lend itself to surprises, perhaps even unexpected discoveries in the night sky. “I’ve been doing this for almost 20 years, and I tell people I take a lot fewer pictures per year now than I did in the early days, and the main reason is things don’t change. I’ve already got an awesome picture of that, you know? I could take another one, but it’s going to be like the last one I took before,” he said. But there are always exceptions.

Two years ago Vanderbei invited a group of students to his home for a demonstration. He chose to photograph one of his favorite astronomical objects, the Dumbbell nebula. He took the exposures of the dumbbell nebula over the next few hours using different filters. The next morning he got up early and used the Maxim DL software program to stack these images and make a color picture out of it. He was pleasantly surprised at how the picture turned out.

So he combined the picture with the one he took two years ago with the same telescope and camera. “The first thing you have to do is make sure [the pictures] align properly and the software does that. So I aligned the two pictures. Then you blink back and forth between them in the software to make sure you got the alignment right, and I’m like holy crap! There was a star two years ago in the dumbbell nebula and it’s gone. Completely gone. What happened? I spent the next week of my life investigating, learning, asking my friends in the astrophysics department, is there a variable star?”

A variable star is a star whose brightness fluctuates. They are objects of interests to astronomy researchers and to Vanderbei. But the variable stars he was interested in are more bluish in color and this was a red star. “I was like, I don’t know anything about variable stars that are red. And it’s in the dumbbell nebula.” He had never heard of a variable star in the dumbbell nebula and wondered if it was possible.

Vanderbei spent a week investigating and learned that the star was discovered in 1990 by an amateur astronomer who said he wasn’t even looking through his telescope.

“Back in the summer of 1990, this person had these two magazines sitting on his table. And he liked the dumbbell nebula, just like I do. And the dumbbell nebula, just by coincidence, was the cover story or the cover picture in both of those magazines that month. And he’s just got them sitting on his table. There’s the dumbbell. There’s the dumbbell, two different magazines. And he’s just kind of looking at them and he noticed that that star appeared in one of those pictures and not the other one. And he was the first person to notice that,” Vanderbei says.

Vanderbei wondered if the star may have disappeared because it exploded but found out that it’s a particular type of variable star called a Mira Variable. They brighten and dim by about a factor of 100. It dims down to one-one hundredth as bright for a week or two. Then it comes back and is bright for several months before briefly goings dim again.

The Crab Nebula is another interesting story. The crab nebula is a result of a super nova explosion that happened roughly a thousand years ago. If a supernova explosion happened in our galaxy in our lifetime, it would be so bright that it would for a time be visible in the daytime everywhere on Earth.

As it happens, the written records from the year 1054 both in China and in India indicate that people saw something strange in the sky that looked like a star in the daytime. That was the Crab Nebula as it formed.

Eventually the explosion leaves gas that continues to expand out forever, but gets dimmer and dimmer as it spreads. Professional astronomers determined many years ago that the Crab Nebula is still noticeably moving outward. Vanderbei took two pictures of the Crab Nebula 12 years apart and when he overlaid them he noticed that looks just a little bit bigger in the more recent picture.

Of course, for Vanderbei, this becomes a problem of applied math. “I actually have, just for fun, compared those two pictures and made an estimate of how long ago I think it exploded just from how much that second picture has expanded, and I get around the year 1050, plus or minus 50 years. But I get about the right answer,” he says. “It’s pretty cool.”

The photos are on display at Princeton Public Library until through Friday, September 6, on the second floor.

Stargazing Night at Mountain Lakes House, Mountain Avenue. Wednesday, August 7, 7:30 to 10 p.m. Bring a flashlight and lawn chair or blanket. Telescopes provided by the Amateur Astronomers Association of Princeton the university’s Department of Astrophysical Sciences.

“Brian Cox: Life of a Universe,” Princeton Public Library, 65 Witherspoon Street. Wednesday, August 14, 6:40 p.m. Join Robert Vanderbei for a screening of the two-part documentary followed by a discussion about the universe and night sky. Each part is 30 minutes long.