Optimization of CCd Charge Transfer for Ground and Spacebased Astronomy