Trapped in rough, forbidding terrain with its solar panels draped in shadow, the Philae comet lander raced the clock Friday to carry out high-priority science operations, including an attempt to drill into the surface of the nucleus, before exhausting its on-board batteries and effectively losing consciousness.

The lander was dutifully executing commands uplinked earlier in the day when the European Space Agency's Rosetta orbiter, serving as a relay between Philae and flight controllers in Germany, moved out of view in its convoluted path around Comet 67P/Churyumov-Gerasimenko. Whether Philae would have enough power left to phone home when Rosetta came back into view later Friday was unknown. But barring a miracle, engineers said, the end was near.

"Last night, we had calculated we needed 80 watt-hours to complete the block (of commands) that's running right now," said Valentina Lommatsch at the lander control center. "We thought we might have about 100 left if the primary battery if the temperature stays up.

Get Breaking News Delivered to Your Inbox

"The one thing that is a bit unfortunate is that the one (command) that didn't reach the lander was a command that would have put it into low power mode, which uses about 2 watts less energy than standard mode. ... It's going to be really close whether we make it to the (next) link or not. Hopefully, we will make it."

If so, engineers planned to downlink the data collected by the lander's science instruments while it was out of contact earlier in the day. If enough residual power was available, they could opt to uplink commands to re-orient or even attempt to move the lander to increase illumination on its solar cells and improve the chances of recharging a secondary battery to extend the lander's life.

But that appeared to be a long shot.

"For the short term, I'm afraid there's little hope," said Stephan Ulamec, lander operations director. "For long term, we have one solar generator that is illuminated every cometary day, (for a) short (period) but it is illuminated. So there is some hope that at some stage when we're closer to the sun that Philae wakes up again and talks to us. But we need to be very lucky that this happens."

Rosetta released Philae early Wednesday for a seven-hour descent to the surface of 67P/Churyumov-Gerasimenko. The lander was equipped with harpoons and ice screws to anchor itself to the nucleus at the moment of touchdown, but the systems failed to operate and Philae bounced back up into space, reaching an altitude of more than 3,000 feet before coming back down again two hours later.

The lander then bounced away again, finally coming to rest more than half a mile from its original touchdown point. Or so the telemetry indicates. Engineers do not yet know precisely where the spacecraft ended up, whether the initial two-hour bounce was mostly vertical and how that played in with the comet's 12.4-hour rotation.

Wherever it is, frames from a panorama taken after it came to rest revealed nearby cliffs and a chaotic jumble of dark rock-like debris casting long shadows and allowing only minimal sunlight to reach Philae's solar cells.

"We are not toppled over," Lommatsch said. "It looks like we're kind of surrounded by rocks. ... But pictures show all three legs on the ground, and I can confirm from the solar data we have not moved at all since the first set of panorama images after the third landing. So we are on the ground, we just have really (been) unlucky in a corner surrounded by rocks."

The lander was launched with 50 to 60 hours of charge in its primary and secondary batteries. By Friday morning, most of that was depleted.

In Philae's current orientation sunlight reaches the solar panels during a roughly 90-minute period each 12.4-hour "day." For most of that time, less than 1 watt is available, but power output climbs to 3 or 4 watts for about 20 minutes.

"The lander needs 5.1 watts to boot, so we have to at least get that," Lommatsch said. "After we have that, in order to charge the batteries we have to heat it up to zero degrees Celsius. In the simulations that we've run, that would mean that we'd need about 50 to 60 watt-hours a day in order to reach zero degrees and still have some of the daylight left to charge the battery. So it doesn't look that great."

But even if Philae batteries drain and the spacecraft drops off line, all may not be lost. Echoing Ulamec, Lommatsch said as 67P/Churyumov-Gerasimenko moves closer to the sun and warms up, the amount of sunlight hitting the spacecraft will intensify enough to possibly rouse the lander from its slumber.

But it would take a considerable amount of luck. Rosetta would need go be within line of sight and the lander would need enough power to drive is computer and radio gear.

"Having a link would need additional power again, so we'd have to have something in the battery in order to have a link or be extremely lucky that Rosetta is looking for us in the moment that sunlight reaches the solar panels," Lommatsch said.

While "it looks a bit bad," she said, "we can only hope that as we approach the sun, maybe in August if we don't have too much dust or a huge coma blocking the sun, perhaps there would be a chance that at some point we could come back and at least see how the lander's doing. "So cross your fingers, or press your thumbs if you're German, perhaps we'll hear something from the lander again."