Skip to content

Conversation

@StuartLittlefair
Copy link
Contributor

The era routines for calculating rotation matrices and earth rotation angle are specific about which timescale they want their inputs in. This pull request make sure that these transforms use the correct timescales.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is not a huge deal, since the erfa routine is fairly slow on its own, but this way the scale conversion to tt gets done twice, which costs a few 100 micro-sec for a single-element time on my laptop. So, maybe replace with

time = time.tt
return erfa.c2i06a(time.jd1, time.jd2)

or, to speed it up even more for the case the time already is TT,

if time.scale != 'tt':
    time = time.tt
return erfa.c2i06a(time.jd1, time.jd2)

@mhvk
Copy link
Contributor

mhvk commented Nov 4, 2015

I'm a little worried there may be further problems along these lines. E.g., while trying to understand the usage of get_dut1utc, I found routines in circ_observed_transforms that seem to assume obstime is always in UTC. @eteq: are these oversights, and should we go through carefully for other Time instances?

@eteq eteq added this to the v1.1.0 milestone Nov 9, 2015
@eteq eteq added the Bug label Nov 9, 2015
@eteq eteq self-assigned this Nov 9, 2015
@eteq
Copy link
Member

eteq commented Nov 9, 2015

@mhvk - yes, there are pretty much all oversights - in most places the typical use cases involve providing the right kind of Time, but it's absolutely right that @StuartLittlefair's approach should be used in all these other situations.

I'll go through and find all these ASAP, and then make a PR building from this one to address them all at once (we could merge this now, but something's odd with the tests that I don't see locally. And I'll want to try to do all of them consistenly anyway so it'll probably just be simpler to do a new PR)

@mhvk
Copy link
Contributor

mhvk commented Nov 9, 2015

Sounds good!

@StuartLittlefair
Copy link
Contributor Author

While this is being done, can you sanity check the gcrs to icrs transform?

You use the erfa routine aticq with gcrs RA and Dec as inputs but I thought this was supposed to take cirs coordinates?

@eteq
Copy link
Member

eteq commented Nov 9, 2015

@StuartLittlefair - Ah, yeah, that's not at all obvious, but my read of the docs is that same function to do the transform works for both CIRS<->ICRS and GCRS<->ICRS. The key is what you pass in as the astrom context: if you look at the docs for e.g. apcs/apcg, you'll see that that's intended to be used with aticq/atciq, even though the aticq/atciq functions don't mention GCRS at all. (Note #5 in the apcs docs gives a good overview of the various options)

P.S. @StuartLittlefair , this discussion makes me think you'd be an excellent candidate for at least some part of #4268 ... just sayin ;)

@StuartLittlefair
Copy link
Contributor Author

@eteq I see - that's clever. I'll certainly do my best with #4268.

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.

4 participants