{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/4436","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/4436/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/4436/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/4436/events","html_url":"https://github.com/astropy/astropy/pull/4436","id":124814581,"number":4436,"title":"Implement auto-downloading of IERS-A data","user":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/astropy/astropy/labels/Affects-release","name":"Affects-release","color":"0052cc"},{"url":"https://api.github.com/repos/astropy/astropy/labels/coordinates","name":"coordinates","color":"c7def8"},{"url":"https://api.github.com/repos/astropy/astropy/labels/Enhancement","name":"Enhancement","color":"fad8c7"},{"url":"https://api.github.com/repos/astropy/astropy/labels/time","name":"time","color":"c7def8"},{"url":"https://api.github.com/repos/astropy/astropy/labels/utils","name":"utils","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/26","html_url":"https://github.com/astropy/astropy/milestones/v1.2.0","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/26/labels","id":1114049,"number":26,"title":"v1.2.0","description":"","creator":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":99,"state":"open","created_at":"2015-05-17T16:11:47Z","updated_at":"2016-05-11T17:04:01Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2016-01-04T18:45:21Z","updated_at":"2016-05-11T17:19:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/4436","html_url":"https://github.com/astropy/astropy/pull/4436","diff_url":"https://github.com/astropy/astropy/pull/4436.diff","patch_url":"https://github.com/astropy/astropy/pull/4436.patch"},"body":"This is a candidate implementation to resolve #3275.\r\n\r\nI'm putting this up prior to writing tests or even having it pass existing tests because it may be controversial.  :smile:  I've been thinking about this over the last week and have started at least four different versions.  The trick is maintaining possibly strict back-compatible behavior (for the minority with this requirement) while introducing a default, *SIMPLE* behavior that just works for the majority.  I find the existing IERS a bit confusing because of all the options that are supported.\r\n\r\nThe key is defaulting to auto-downloading and using IERS-A when required, by use of a new class `IERS_Auto`.  The exact caching mechanism is TBD, but as mentioned we *know* in advance exactly when the source file is updated, so it is a really easy problem in this case.  In this implementation I just put in a config var that specifies how old the cached file can be.  Don't worry about this bit.  However, I will say that I thought about fine-tuned optimizations like @mhvk suggested in #3275 and in the end rejected them as just too complicated.  I think it's better to have a simple scheme that can be explained and understood by users and developers in a sentence or two.\r\n\r\nWhat is more important is automatically using IERS-A via the `IERS_Auto` class in `Time` and `Coordinates`.  This means that when a user first requires IERS values the file will always get downloaded.  Supplying an IERS-A file with astropy is a bit pointless because it will always get superceded very shortly.  \r\n\r\nThe auto-download behavior can be fully reverted to the current 1.1 behavior by setting a config var `astropy.utils.data.iers.conf.auto_download` to False (default = True).  Users that require the legacy strict IERS-B can do this.\r\n\r\nAnother important idea: the `IERS_Auto` class is exempted from range checking because it is assured of having the most recent available data.  This means the (possibly-clipped) interpolation is always within the confidence bounds of current Earth rotation knowledge.  For actual use cases in astronomy (particularly observation planning) everything just works as well as it can given our best knowledge of Earth rotation.  All the adhoc workarounds currently suggested would go away.\r\n\r\nOf course the downside is that (in the default behavoir) reproducibility to numerical precision would go away.  But someone would be free to write a script with auto-download disabled and thus get reproducible behavior.  And in all cases reproducibility to within confidence limits of Earth rotation parameters would not be affected.\r\n"},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/218528077","html_url":"https://github.com/astropy/astropy/pull/4436#issuecomment-218528077","issue_url":"https://api.github.com/repos/astropy/astropy/issues/4436","id":218528077,"user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T17:19:22Z","updated_at":"2016-05-11T17:19:22Z","body":"@taldcroft - I've started looking at this.  Overall, it looks good, though I want to think a bit more whether it isn't possible to make more minimal changes to `IERS` itself, keeping additions mostly within the `IERS_Auto` class.\r\n\r\nOne annoyance: now that `IERS_A` turns out not to have correct `IERS_B` values, shouldn't we auto-update `IERS_B` too?!"}}