Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Astrometry & SolarSystemShapiro faster #1748

Merged
merged 10 commits into from
May 1, 2024

Conversation

abhisrkckl
Copy link
Contributor

@abhisrkckl abhisrkckl commented Apr 29, 2024

Avoid creating SkyCoord objects during Astrometry computations. This was partly implemented in #1646 for models with proper motion. This PR does the same thing for cases without proper motion. This has a significant performance advantage.
The tests introduced by #1646 also cover these changes.

In SolarSystemShapiro, avoid doing expensive and unnecessary slices of the TOAs table.

Spun off from #1743, to make testing easier.

@abhisrkckl
Copy link
Contributor Author

abhisrkckl commented Apr 29, 2024

Performance

Here is the profiling code:

from pint.models import get_model_and_toas
from pint.config import examplefile
from pint.residuals import Residuals

m, t = get_model_and_toas(examplefile("NGC6440E.par.good"), examplefile("NGC6440E.tim"))
res = Residuals(t, m)

%timeit res.calc_phase_resids()

Before: 13.3 ms ± 45 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

After: 5.5 ms ± 33.4 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

@abhisrkckl abhisrkckl added the awaiting review This PR needs someone to review it so it can be merged label Apr 29, 2024
@dlakaplan
Copy link
Contributor

I think this looks good. Is any explicit new testing required, or is the fact that all of the usual tests passed here sufficient (I suspect the latter since you haven't yet changed the precision)?

Any changes wrt skipping the SkyCoord creation that need tests?

@abhisrkckl
Copy link
Contributor Author

I think the existing tests are sufficient.

@dlakaplan
Copy link
Contributor

So I can merge?

@abhisrkckl
Copy link
Contributor Author

Yes.

@dlakaplan dlakaplan merged commit 68701b9 into nanograv:master May 1, 2024
7 checks passed
@abhisrkckl abhisrkckl deleted the fast-astro branch May 14, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review This PR needs someone to review it so it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants