temporary column: TIME = EXPOSURE:FRAME[0] FOR EACH i,j such that (FRAME[i] == EXPOSURE:FRAME[j]): TIME[i] = EXPOSURE:TIME[j] new column: PI IF (datamode == Spectroscopy): PI = EnergyCorrector::offsetCorrect(TIME,RAWX,RAWY,SHAPE,CCDNODE,ENERGY) ELSE: PI = EnergyCorrector::offsetCorrect(TIME,RAWX,CCDNODE,ENERGY) IF (*withgain): PI = EnergyCorrector::gainCorrect(TIME,CCDNODE,PI) IF (*withcti): temporary column: SEP = 1000 IF (datamode == Spectroscopy): PI = CtiCorrector::ctiCorrect(TIME,RAWX,RAWY,SHAPE,SEP,CCDNODE,PI) ELSE: PI = CtiCorrector::ctiCorrect(TIME,RAWX,RAWY,CCDNODE,PI)