-
Notifications
You must be signed in to change notification settings - Fork 35
Syndynes plots and fixes #434
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
base: main
Are you sure you want to change the base?
Syndynes plots and fixes #434
Conversation
This reverts commit a5903e2.
|
Thank you for your contribution to sbpy, an Astropy affiliated package! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
Keeping this a draft until #427 is done. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #434 +/- ##
==========================================
- Coverage 84.72% 82.01% -2.72%
==========================================
Files 92 53 -39
Lines 8459 4325 -4134
==========================================
- Hits 7167 3547 -3620
+ Misses 1292 778 -514 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
plot()methods to syndyne and synchrone classesSourceOrbitclass to encapsulate a collection of states that make up an orbit.SynGenerator.source_orbitto use the newSourceOrbitclass.Stateobjects from Horizons viaEphem.from_horizons.Ephem.from_horizonsis populated with masked quantities, butWCScan crash trying to convert masked coordinates to pixels. Added a newsbpy.utils._unmaskedfunction which will return an unmasked object using an astropy 7.0 function (or fall back on an internal method for astropy < 7).State.to_ephemwas in the documentation, but not the code! Added this function..plot()methodsSyndyne and synchrone plotting is simplified. Previously one might have written:
Now, much of that is incorporated into sbpy:
See the documentation for more examples.
API changes with
SourceOrbitSynGenerator.source_orbitreturned a tuple including the states and coordinates of the orbit at the requested times. But these can be collected into a single object, just likeSyndyneandSynchroneinclude their own particle states and coordinates. Furthermore, it would be great to use the newplot()approach thatSyndyneandSynchroneuse. To that end, I've created the newSourceOrbitclass.Previously:
Now with
SourceOrbitthe same machinery behindSyndynesandSynchronescan be used:API changes with
SyndynesandSynchronesIndexing
SyndynesorSynchroneswould return singleSyndyne/Synchroneobjects, or a list thereof:This behavior was OK, but with the new
.plot()methods, returning a list drops the fancy machinery behind, e.g.,Synchrones.plot(). As a result we would have to use the individual plot methods, which also means the label needs to be specified to achieve the same behavior:Now indexing with a slice with return a
SyndynesorSynchronesobject, and we can immediately plot the results: