Sidereal time calculation gives error due to IERS table

554 views
Skip to first unread message

Joe Philip Ninan

unread,
Jan 27, 2015, 11:14:00 AM1/27/15
to astro...@googlegroups.com
Hi,
When using recent dates to calculate sidereal time (using astropy.time's Time.sidereal_time() function), i am getting the following error.

IndexError: (some) times are outside of range covered by IERS table.

Following will reproduce the error.
######
import astropy.time
DateString = '2014-11-18T0:1:1'

t = astropy.time.Time(DateString,format='isot',scale='utc',location=('78.9641d','32.77944d'))

print t.sidereal_time('apparent')

#######

If i understand correctly this table contains UT1-UTC differences from IERS Bulletins A and/or B.
Since accuracy is not that important to me, i tried using scale='ut1' instead of 'utc'
Still the error exists.

Which time scale should i create the time object with, so that i can calculate sidereal time?
Accuracy is not an important factor for my calculation.

-cheers
joe




--
/---------------------------------------------------------------
"GNU/Linux: because a PC is a terrible thing to waste" -  GNU Generation

************************************************
Joe Philip Ninan      
Research Scholar        /________________\
DAA,                            | Vadakeparambil |
TIFR,                           | Pullad P.O.         |
Mumbai-05, India.      | Kerala, India      |
Ph: +917738438212   | PIN:689548       |
------------------------------\_______________/--------------
My GnuPG Public Key: www.tifr.res.in/~ninan/JPN_public.key

Marten van Kerkwijk

unread,
Jan 27, 2015, 1:37:30 PM1/27/15
to astro...@googlegroups.com
Hi Joe,

Yes, currently an exception is raised if you try to get the sidereal time outside the range of the IERS table. There are two options: use UT1 and use a precession model that does not require UTC:

```
In [8]: t = astropy.time.Time(DateString,format='isot',scale='ut1',location=('78.9641d','32.77944d'))

In [9]: t.sidereal_time('apparent', model='IAU1994')
Out[9]: <Longitude 9.078744702123544 hourangle>
```

Or explicitly set the UT1-UTC difference:
```
In [10]: t.delta_ut1_utc = 0.

In [11]: t.sidereal_time('apparent')
Out[11]: <Longitude 9.078744173140766 hourangle>
```

Alternatively, you can download and use the IERS A table following the instructions in
http://docs.astropy.org/en/latest/time/index.html#transformation-offsets

Hope this helps,

Marten

p.s.  We are considering calculating sidereal time assuming UT1=UTC if one is outside the IERS table, and only raising a warning not an exception. Your case adds another argument that that might be a good idea...

Joe Philip Ninan

unread,
Jan 27, 2015, 2:22:03 PM1/27/15
to astro...@googlegroups.com
Hi Marten,
Thanks a lot for the explanation.
It makes sense now.

I think, it will be good to explain this work around in the documentation page, since as per the conversion diagram which is there in documentation now, the UT1 to UTC conversion does not come between UT1 and Sidereal Time box.
So I was really confused why the error occurs even when scale was defined to be ut1.

-cheers
joe


--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marten van Kerkwijk

unread,
Jan 27, 2015, 3:19:41 PM1/27/15
to astro...@googlegroups.com
Hi Joe,

Indeed, it should be documented better, as I had to look back at the actual precession models to remind myself why it depended not just on UT1 (and I wrote this part!).
Unfortunately, I have no time to update the documentation right now, but I thought I should at least put in a new issue to remind us that really we should (if you have time and are interested, you are of course most welcome!).  See https://github.com/astropy/astropy/issues/3373

Anyway, please do let us know if you find other issues (perhaps preferably via github, but this is fine as well).

Thanks!

Marten

Erik Tollerud

unread,
Jan 27, 2015, 11:53:32 PM1/27/15
to astropy-dev
Definitely it makes sense to document this better, but there is a relevant change in v1.0: the error message should now give explicit instructions to download the IERS A table.  So from v1.0 on, you should at least see a message indicating how to fix this instead of just stating that an error occurred.

--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Erik T
Reply all
Reply to author
Forward
0 new messages