-
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #434 +/- ##
==========================================
- Coverage 84.72% 82.09% -2.63%
==========================================
Files 92 53 -39
Lines 8459 4335 -4124
==========================================
- Hits 7167 3559 -3608
+ Misses 1292 776 -516 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* Move to_ephem to StateBase * compute coordinates if an observer is given * put frame in Ephem metadata
to_ephem: * Remove coords column from to_ephem due to problem vstacking SkyCoords columns when frame contains obstime * Use StateBase's to_ephem for most of the work. plot() * Fix cosine correction * Allow spherical coords other than RA/Dec Fix SourceOrbit.epoch SynCollection: * __getitem__ should return SynCollections for tuples and slices * Use Ephem's vstack in to_ephem
Replace random_syn* with fake_syn*
|
Updated comment with API-breaking change in to_ephem. |
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 with int, slice, or tuple
Indexing
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 (or tuple) will return a
SyndynesorSynchronesobject, and we can immediately plot the results:Drop "coords" from
to_ephem()resultThe heliocentric ecliptic IAU76 reference frame needs observation time. When creating an
Ephemobject fromSynchronesin that frame, the coordinates of each synchrone could not be concatenated. I think it is because the observation times in the reference frame did not match, so astropy thought the reference frames were different, and in a way that is right. Rather than hack something here, just drop the coords column. RA, Dec, etc. are already included as separate columns, so there is no loss of information.