Original sentence:The astronomer completed the calculation at the observatory that he had been working on for nearly a decade.

Here is my corrected sentence:
The astronomer completed the calculations that he had been working carefully at the observatory for nearly a decade.

Yours is better.