Putting code from pmReadoutCombine here, so that it can also be used by pmShutterCorrectionGenerate, without copy/paste.