A methodology to design optical systems with curved sensors