I think as long as you kept your mouth shut about doctrinal matters, you'd be fine. Almost all of the scientists who go in trouble with the church were busy writing commentary on religious doctrine outside of their scientific work, and that's what got them in trouble generally speaking. The Catholic Church for its faults funded a lot of astronomers and other scientists in the medieval period and into the Renaissance.