The most gut-clenching, psyche-rattling moment of Margee Kerr's 36 years on this planet came when she was 116 stories in the air above it, strapped into a harness so she could lean out from the top of Toronto's CN Tower.

For Kerr, it was partly an academic experience.

She studies fear for a living, and will speak about her work Wednesday night at the Franklin Institute, as part of Philadelphia's annual nine-day science festival.

Thus far, attendees have been gazing at stars, digging up fossils, exploring colonial-era medicine, and solving murder mysteries. Still on tap are events about chocolate, the state of science 150 years ago, and, on Saturday at Penn's Landing, the annual science carnival.

It all aspires to mix fun with the pursuit of knowledge. And in Kerr's case, a healthy dose of creepiness.

In 2009, when the Maryland native earned her Ph.D. in sociology from the University of Pittsburgh, she realized she was not cut out for the traditional academic career path.

Instead, because some of her research involved the study of fear, she took a consulting gig with a Pittsburgh haunted-house attraction called ScareHouse. That involved analyzing customer survey data and using science to ramp up the fright factor.

An example: Research has shown that a person's fear response is especially intense when they can see the whites of their aggressor's eyes, Kerr said. This finding comes from measuring activity in the amygdala, a primary fear-processing location of the brain.

So ScareHouse responded by adding characters with especially wide eyes, she said.

"It was so much fun," Kerr said. "I asked myself, 'OK, how can I make a living out of this?' "

She still teaches and does research at Pitt, but looks for ways to measure fear outside the lab as much as possible. For example, Kerr and a colleague recently measured the vital signs of people who were conducting a paranormal investigation, she said.

The Wednesday event is at the institute's Franklin Theater from 7 to 9 p.m. Tickets are $10, and registration is required (visit and search "fear").

Along with Kerr will be a variety of tarantulas and other creepy-crawlies from local museums and other institutions.

Mary Bailey, manager of public engagement at the Academy of Natural Sciences of Drexel University, is bringing the tarantulas, which she can barely handle herself.

"It took me maybe about a month to get comfortable actually picking one up," Bailey said. "Now, if I think about it too hard, I still go 'uuugggh.' "

Kerr said she will measure the "galvanic skin response" of visitors when they see the scary things up close, attaching sensors to two fingers and connecting them to a tablet computer.

She will speak about how fear was key to survival for our ancestors, leading the sympathetic nervous system to ramp up the flow of adrenaline, among other responses.

"Evolution did a really good job of making sure we could recognize threats and respond to them very quickly," Kerr said, though she added that chronic fear can have a toxic effect on health.

So how scary was leaning out from the top of the CN Tower, the third-tallest tower in the world?

"I knew rationally I would be fine, attached to the building," she said. "But my body was thinking, 'You're going to die.' "