The science behind Matt Damon’s upcoming science-fiction movie "The Martian" received a thumbs up from Jim Green, NASA’s director of planetary science at a press event earlier this month.

The movie is based on the book of the same name by Andy Weir, who, since he had a lot of science geeks as readers, took care to get it right. Weir’s writing process was very interactive. The book began as a blog in which Weir presented astronaut hero Mark Watney (Damon’s character) with a life-threatening problem, and then spend a couple of weeks researching its solution just to write the next two sentences of the story. If his readers told him he had something wrong, he would fix it.

Watney is the botanist on an expedition to Mars, who gets left behind when his fellow astronauts think he is dead following a severe dust storm. Botany may be Watney's primary vocation, but his astronaut training prepares him for survival. He's a jack of all trades — he’s into electronics, repairs equipment, gets NASA’s Pathfinder up and running, and figures out a way to grow food. All of this is done with the goal in mind of surviving until the next spaceship arrives on Mars four years down the line.

Related: Buzz Aldrin joins university, developing 'master plan' for Mars settlement

Why so long? He has no way to communicate with Earth and let NASA know he is alive, so unless he can figure out a way to send a signal, it's going to be a long wait. As Watney says in the movie, he has to “science the hell out of” his unexpected stay on the red planet. So, how real is it? Very. And Green fills us in on how.

Water/Oxygen

One of the biggest issues facing Watney is producing enough water to keep himself hydrated and to grow crops. He uses a process known as electrolysis. And even though he has a rocky start, setting off a small explosion and singeing his eyebrows, he soon gets it right and condensation forms on the inside of the habitat where he is growing his crop.

"We're actually using that same basic principle to create oxygen in our next rover," Green told FoxNews.com. "We have a rover that's going to Mars in 2020 with this little instrument that's going to bring in air and then it's going to do electrolysis. It's going to shock the carbon dioxide, pop off oxygen, and then throw away the carbon dioxide. Then we can take the oxygen and do a variety of things with it from rocket fuel to actually breathing it."

Since the book was written, scientists have discovered that the dirt on Mars actually contains more water than initially thought, so in the future, it could be possible to extract the water through evaporation, an easier process than electrolysis.

Related: India's Mars orbiter captures beautiful 3D images of the red planet

Heat

Watney's survival would not have been possible without the existence of the RTG [radioisotope thermoelectric generator] that had been buried and left behind. These are not uncommon. There is one on Curiosity, and the Mars 2020 rover is going to have one, so the fact that Watney was able to dig it up and use it to heat the interior of the rover was good science.

"The RTGs generate about a 120 watts of power. Then they actually charge up a battery, and then you run your experiments off the battery, but it's the heat … these can be quite hot -- more than 150 degrees," Green added. "And so consequently, that's what he wanted the RTG for.  He wanted that for the heat it had. He didn't want to use the electricity from the batteries that he had to generate to move the rover to heat its interior."

Food

Most of the processed food left behind on Mars when the team took off wasn't anything that could be used for growing crops. But, since Thanksgiving was going to happen during the mission, NASA had included a package of potatoes, which Watney is able to cut up, plant and water. Of course, the Mars soil didn't contain the appropriate nutrients to promote growth, so what Whatney did was to use human excrement as fertilizer. Combine that with the water he made, and – presto — he had a garden on Mars.

Solar power/the dust factor

Solar panels have been essential to running spacecraft since the beginning of the space age. They take the sunlight and charge up essential batteries, and power the habitat. Initially, the scientists at NASA thought that Mars rovers, which were powered by solar panels, would work for maybe 90 days, figuring the planet’s dusty atmosphere would quickly block out the sun, causing the rovers to freeze. They were surprised when that didn't happen.

"When we got down on the surface and we were running the rovers around, we found out that the atmosphere, one, at certain places at certain times, wasn't as dusty as we thought, and, two, the little atmospheric dust devils would come and sweep the dust off the solar panels on the rover and bring them back to life,” Green said. “Right now, we have one called Opportunity that's been on the surface of Mars more than ten years, and we thought it was only going to survive 90 days."

Why the space program is necessary

From watching “The Martian,” it is obvious that making another planet habitable is a monumental task. But Green explained that the reason it is important for man to go into space, rather than robots, is that a single-planet species is not going to survive long-term.

"We really have to move off this planet," he suggested. "The sun is warming up. It's warmed up at least 25-30 percent since it really started kicking out heat, and it's going to continue that way. So what we call the habitable zone, places around the sun that you can actually survive, are going to continue to move outward and the Earth is going to get harder to live on.”

"Combine that with the fact that there are near-Earth objects that are planet killers that cross our orbit -- and there's about 950 of them -- and this planet's going to continue to get hit,” he said. “In the last 500 million years, we've had five mass extinctions, and the last one, we now know, is indeed from an impact from a near-Earth object that was probably six kilometers in size."

"The Martian" rockets into theaters October 2.