code to align PSFs