If you loved the inspiring rescue drama of “The Martian” — and who did not? — you’ll surely enjoy “The 33.” The two films would make a great double feature. They are thematically identical but different enough to feel fresh side by side.

Who knew disasters could be so enjoyable? Way to go, triumph of the human spirit!

Based on a real incident in 2010, when a deep Chilean shaft collapsed, trapping 33 miners far underground, “The 33” capably dramatizes the catastrophe at the San Jose Mine. In an era when women are rarely asked to direct sizable thrillers, Patricia Riggen lifts the genre to rousing heights. Her film tells its months-long story with a shrewd blend of facts, dramatic tension and entertainment. Stunningly shot in Chile’s vast Atacama Desert by cinematographer Checco Varese, it offers mystical aerial views of the otherworldly landscape balanced against close attention to the impressive cast.

Among the main players are Lou Diamond Phillips as the anxious safety supervisor whose warnings are ignored by the gold and copper mine’s owner, who values precious metals more than protecting workers. Antonio Banderas plays the upbeat de facto leader of the imprisoned group, Juliette Binoche is the mercurial sister of one of the trapped men, and Gabriel Byrne appears as an excavating expert who can discuss the complexities of drill bits and rock formations in vivid terms.

Riggen gives all her players ample time in the limelight, whether they are veteran stars or walk-on performers. “The 33” focuses on the men trapped beneath 2,000 feet of rock, their distraught and protesting families, the politicians trying to avert a further tragedy (thereby saving their own careers), and even the worldwide attention the emergency received. The focus takes some wild turns, such as the hair-pulling rivalry between the wife and mistress of one worker over whom he will love more when he’s released. It might feel like exaggeration, but it is stranger-than-fiction reality well worth including.

Those complications might lead some filmmakers into a narrative maze, but Riggen never loses the story’s center or the viewer’s concentration. While the trapped workers face silicosis lung disease, malnutrition from the minimal rations stored in the mine and mental breakdowns, they’re also amiable and warm companions able to laugh at the absurdity of their confinement.

The film is poised as well, providing a delightfully funny dream sequence in which the starving crew members imagine themselves in a high-spirited last supper, and sprinkling water from the deep drilling rigs that resemble christening baptisms.

It’s common for films to save a surprise for the end credits, but rare for them to provide surprises as touching as the realistic epilogue shown here. It reminds us how faithfully many of the film’s characters have been presented.

“The 33” is in small ways an imperfect film, with female players resembling fashion models, 10 minutes’ worth of emotional embracing scenes and a never-give-up tone that could use a bit more docudrama tension and conflict. But there are no serious complaints when the icing on the cake is as sweet as this.