Syndynes plots and fixes#434
Draft
mkelley wants to merge 51 commits intoNASA-Planetary-Science:mainfrom
Draft
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.
|
Member
Author
|
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*
Member
Author
|
Updated comment with API-breaking change in to_ephem. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.