I received an email this morning from Mike Caplinger, who's involved with all the Mars cameras past and present that have come out of Malin Space Science Systems (this includes things like MOC on Mars Global Surveyor, CTX on Mars Reconnaissance Orbiter, and MARDI, MAHLI, and Mastcam on Mars Science Laboratory. Congratulations to the team at Malin, by the way, for their timely delivery of MARDI and MAHLI to the Jet Propulsion Laboratory for integration onto the future Mars rover.)
Mike clarified a few things that I didn't understand about why space images can sometimes come out backwards when you open them in commercial software (as happened with publicly released Chandrayaan-1 and Rosetta images of Earth). Mike said: "Commercial image sensors usually have a defined readout direction. The sensor can typically be oriented in one of two ways on the circuit board, and we pick the one that makes the most sense electrically (has the pins closest to where the signals are coming from or going to). The optics design usually inverts the image, as most telescopes do," that is, it makes the image upside-down, "though some also flip it (I think HiRISE does this because it has three mirrors, not two like CTX)." That is, because the set of prisms and mirrors within CTX reflect the image once and then reflect it again, it winds up not being mirror-reversed, but Mike thinks HiRISE images are (I didn't check to confirm this).
Mike went on: "For a line-scan camera," that is, a pushbroom camera that sweeps out an image along the spacecraft's path, not a framing camera -- I explained the distinction in this post -- "the spacecraft may be going north-to-south or south-to-north (or, like Mars Global Surveyor, it may do one for a while and then the other for a while, and/or they may chose to fly backwards). And for cruise observations, since the spacecraft has to be slewed instead of relying on orbital motion, it could be backwards from normal mapping anyway." Cruise is the part of a spacecraft's mission where it's traveling to its destination, before it enters orbit. Chandrayaan-1 is still in its cruise phase. Orbital motion isn't sweeping its camera detector across Earth; the spacecraft has to be rotated (slewed) while an image is taken to set up the same sort of geometry that orbital motion would produce.
"So it's not really a question of 'convention' but of a bunch of unrelated factors each of which can make one inversion and/or flip. Then, when the data products are generated, we might or might not decide to flip the image to put it into some preferred orientation. In general I never do this with raw data because I want 'raw' to mean 'without any processing at all.'
Mike concluded, "Based on current testing, I think raw MSL Mastcam images will happen to be the right way around, though I reserve the right to be wrong. And that's only because [the cameras] are mounted 'upside down' on the remote sensing mast."
Fascinating. Not being any kind of an engineer myself, I have only the haziest understanding of what goes in to making the pretty pictures that are returned from spacecraft. Now that Mike mentioned Deimos, I recall that a goodly proportion of the Mars Express images of Phobos and Deimos that I dug out of ESA's Planetary Science Archive were mirror-reversed, and now I understand why. Mars Express' HRSC camera is, like most orbiting Mars cameras, a pushbroom camera, so Mars Express would have to slew in order to simulate the right geometry to capture images of Mars' moons. Depending on the relative positions and velocities of Mars Express and the moons at the time they were attempting a photo, it might need to slew in one direction or in the opposite direction, which would explain why some of the images appeared the right way around, and some were backwards.
I was able to figure out which were reversed at the time because Mars Express' camera system includes a "super-high-resolution channel" or SRC, which is a framing camera, not a pushbroom camera. Mars Express usually took an SRC image at the same time that it took an HRSC image, and the SRC image (being like a snapshot, not requiring any slewing of the spacecraft) was never reversed. All I had to do was to compare the images as they appeared to HRSC and SRC, and if they were mirror images, I flipped the HRSC image. I knew this had something to do with the pushbroom style of HRSC imaging, but I didn't really understand why before Mike explained this.