About 400 people applied this year to live, work, and sleep in nasa’s Human Exploration Research Analog, a three-story habitat built to mimic the confinement of space missions and study human behavior and teamwork dynamics. The space agency has spent the last several months shuffling groups of four volunteers in and out of the habitat, which sits inside a warehouse at the Johnson Space Center in Houston. The groups live in the habitat for 45-day stays designed to simulate a round-trip journey to an asteroid to collect and return soil samples. The latest group emerged this month, were greeted with sparkling fruit juice, and returned to their daily lives, with some much-needed privacy.

The participants are essentially lab rats, the test subjects that will inform the procedures and protocols necessary for future missions to Mars and deep space. Everything that happens to them in that metal tube—their physiological changes, mood swings, interpersonal interactions—will someday be folded into guidelines for keeping astronauts happy and healthy on long-term missions. Similar campaigns to study human behavior for space journeys are underway elsewhere, including a University of Hawaii program called hi-seas that put six people in a fake Mars habitat in Hawaii for eight months this year.