Skip to content

Implement TEME frame in astropy. - #10149

Merged
eteq merged 26 commits into
astropy:masterfrom
StuartLittlefair:TEME
May 1, 2020
Merged

eteq merged 26 commits into
astropy:masterfrom
StuartLittlefair:TEME

Conversation

@StuartLittlefair

Copy link
Copy Markdown
Contributor

Description

One frame missing from the builtin frames is the True Equator Mean Equinox frame, which is often used in combination with satellite data. This PR implements that frame, and provides some simple examples in using it.

Fixes #10141

@pep8speaks

pep8speaks commented Apr 15, 2020 •

Copy link
Copy Markdown

Hello @StuartLittlefair 👋! It looks like you've made some changes in your pull request, so I've checked the code again for style.

There are no PEP8 style issues with this pull request - thanks! 🎉

Comment last updated at 2020-05-01 17:13:34 UTC

@StuartLittlefair StuartLittlefair added this to the v4.1 milestone Apr 15, 2020
@pllim
pllim requested review from adrn and eteq April 15, 2020 15:21
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread CHANGES.rst Resolved
@pllim pllim added whatsnew-needed needs-copyediting Pull requests that need copyediting labels Apr 15, 2020
@pllim

pllim commented Apr 15, 2020

Copy link
Copy Markdown
Member

Thank you! cc @c3-14

@StuartLittlefair

Copy link
Copy Markdown
Contributor Author

If anyone can advise why the documentation is failing in the travis tests I'd appreciate the help. The python looks fine to me; can't understand why we are getting a SyntaxError

@ayshih

ayshih commented Apr 16, 2020

Copy link
Copy Markdown
Contributor

I believe the line after it (https://github.com/astropy/astropy/pull/10149/files#diff-58e29e965fccf81ca4bcf30af0bef3f6R38) needs ... instead of >>>.

@bsipocz

bsipocz commented Apr 16, 2020

Copy link
Copy Markdown
Member

Before merging this, please squash the last few commits about the rst docs into one.

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know much about TEME, which probably shows, but some comments nevertheless...

Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
@bsipocz

bsipocz commented Apr 21, 2020

Copy link
Copy Markdown
Member

something is not right with coverage, it thinks that none of the new code is tested, so the CI log needs to be double checked whether the new ones are indeed picked up.

@StuartLittlefair

Copy link
Copy Markdown
Contributor Author

something is not right with coverage, it thinks that none of the new code is tested, so the CI log needs to be double checked whether the new ones are indeed picked up.

Isn't the coverage issue the same one as with my previous PRs? That all the tests involving coordinate transforms need to be marked as remote_data if they use ut1 and these tests are not included in the coverage reports?

By-hand I can't find any new lines of code that are not covered by the provided tests...

@bsipocz

bsipocz commented Apr 22, 2020

Copy link
Copy Markdown
Member

But the coverage run uses remote-data=astropy, doesn't the required remote data live in astropy-data land?

@StuartLittlefair

Copy link
Copy Markdown
Contributor Author

@bsipocz no - i don't think so. Accessing ut1 time requires data from ftp://cddis.gsfc.nasa.gov/pub/products/iers/finals2000A.all or https://datacenter.iers.org/data/9/finals2000A.all

@bsipocz

bsipocz commented Apr 22, 2020

Copy link
Copy Markdown
Member

Ah ok, you are right of course. I wonder then whether we should switch it to that job, but it's certainly beyond the scope here.

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with only a tiny thing about the docs.

Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved

@eteq eteq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly speaking this looks good to me. I think we want to be a bit more explicit that this is a particular TEME (i.e. a specific equator/equinox definition), but given this is the definition assumed for TLEs, I think it's reasonable to have that in the docstring as opposed to baking it into the name or having a generator function or something.

Comment thread docs/coordinates/satellites.rst Resolved

@adrn adrn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! This looks good to me, but I had a few minor questions and suggestions.

We also likely want to have @lglattly review the text added to the documentation.

Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
@adrn
adrn requested a review from lglattly April 27, 2020 19:49

@lglattly lglattly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a few copy editing suggestions you can take or leave as you see fit! I would also suggest breaking up the example markup so that the "Transforming TEME to Other Coordinate Systems" heading (satellites.rst line 76) isn't in the middle of the flagged example but rather its own example.

Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
Comment thread docs/coordinates/satellites.rst Resolved
@StuartLittlefair

Copy link
Copy Markdown
Contributor Author

I made a few copy editing suggestions ...

Thanks @lglattly !

@StuartLittlefair

Copy link
Copy Markdown
Contributor Author

thanks @adrn. Should be fine now. Looks like I didn't muck up the commit history during rebase for once!

@StuartLittlefair
StuartLittlefair requested a review from adrn May 1, 2020 15:31
@StuartLittlefair StuartLittlefair added Ready-for-final-review and removed needs-copyediting Pull requests that need copyediting labels May 1, 2020

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while fixing the CI failures, please also squash the many single liner commits into one


>>> from astropy.coordinates import EarthLocation, AltAz
>>> siding_spring = EarthLocation.of_site('aao') # doctest: +REMOTE_DATA
>>> aa = teme.transform_to(AltAz(obstime=t, location=siding_spring)) # doctest: +REMOTE_DATA

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is that the examples should be standalone. So while this may pass the doctests for now, in the long term it have to be fixed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - I've been back and forth on this; no-one seems to know what the right way is!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the example directive is not working yet, but when it does, these examples will be extracted to a separate place, part of a gallery. I would be very surprised if they see outside of their directive container, but the infra is still in the works, so I cannot say this for certain.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will probably start with them needing to be stand-alone, but might expand to have ways to see wider context? But anyway, I think it doesn't need to block this PR

Comment thread CHANGES.rst Resolved
@eteq

eteq commented May 1, 2020

Copy link
Copy Markdown
Member

Alright this looks all good to me - I'm pretty sure the coverage is sort of a red herring in that the remote data tests are where this is being tested (and they are passing). I'll make an issue to suggest we re-work those tests into something that doesn't require remote data, but I think that's not critical so shouldn't block merging.

@eteq
eteq merged commit 1fb3612 into astropy:master May 1, 2020
vla22 pushed a commit to ska-telescope/katpoint that referenced this pull request Aug 18, 2020
Earth satellites described by the SGP4 model (and distributed as
Two-Line Elements) return positions and velocities relative to the
True Equator, Mean Equinox (TEME) frame, an Earth-centred inertial
frame somewhat like GCRS. This used to be handled by Pyorbital but
since version 4.1 Astropy will have builtin support for this frame
(see astropy/astropy#10149).

Since we don't need the (az, el) of an observer in this calculation
anymore, it is now safe to call `EarthSatelliteBody.compute` without
a location (it defaults to the centre of the Earth). Update the tests
to reflect this.

Add tests against Skyfield which has decent satellite support.
Consolidate the TLE test parameters as module constants in the process.

The new approach is within 0.25 arcseconds of Skyfield, instead of
1.7 arcseconds with the Pyorbital approach.

This addresses JIRA ticket SPAZA-120.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement true equator mean equinox transform

10 participants