{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astroplan/issues/165","repository_url":"https://api.github.com/repos/astropy/astroplan","labels_url":"https://api.github.com/repos/astropy/astroplan/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astroplan/issues/165/comments","events_url":"https://api.github.com/repos/astropy/astroplan/issues/165/events","html_url":"https://github.com/astropy/astroplan/pull/165","id":159629258,"number":165,"title":"Constraint broadcasting","user":{"login":"StuartLittlefair","id":4570807,"avatar_url":"https://avatars.githubusercontent.com/u/4570807?v=3","gravatar_id":"","url":"https://api.github.com/users/StuartLittlefair","html_url":"https://github.com/StuartLittlefair","followers_url":"https://api.github.com/users/StuartLittlefair/followers","following_url":"https://api.github.com/users/StuartLittlefair/following{/other_user}","gists_url":"https://api.github.com/users/StuartLittlefair/gists{/gist_id}","starred_url":"https://api.github.com/users/StuartLittlefair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuartLittlefair/subscriptions","organizations_url":"https://api.github.com/users/StuartLittlefair/orgs","repos_url":"https://api.github.com/users/StuartLittlefair/repos","events_url":"https://api.github.com/users/StuartLittlefair/events{/privacy}","received_events_url":"https://api.github.com/users/StuartLittlefair/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/astropy/astroplan/labels/bugfix","name":"bugfix","color":"f7c6c7"},{"url":"https://api.github.com/repos/astropy/astroplan/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"eteq","id":346587,"avatar_url":"https://avatars.githubusercontent.com/u/346587?v=3","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},"assignees":[{"login":"eteq","id":346587,"avatar_url":"https://avatars.githubusercontent.com/u/346587?v=3","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},{"login":"bmorris3","id":3497584,"avatar_url":"https://avatars.githubusercontent.com/u/3497584?v=3","gravatar_id":"","url":"https://api.github.com/users/bmorris3","html_url":"https://github.com/bmorris3","followers_url":"https://api.github.com/users/bmorris3/followers","following_url":"https://api.github.com/users/bmorris3/following{/other_user}","gists_url":"https://api.github.com/users/bmorris3/gists{/gist_id}","starred_url":"https://api.github.com/users/bmorris3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmorris3/subscriptions","organizations_url":"https://api.github.com/users/bmorris3/orgs","repos_url":"https://api.github.com/users/bmorris3/repos","events_url":"https://api.github.com/users/bmorris3/events{/privacy}","received_events_url":"https://api.github.com/users/bmorris3/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-06-10T12:56:27Z","updated_at":"2016-06-24T04:51:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/astropy/astroplan/pulls/165","html_url":"https://github.com/astropy/astroplan/pull/165","diff_url":"https://github.com/astropy/astroplan/pull/165.diff","patch_url":"https://github.com/astropy/astroplan/pull/165.patch"},"body":"If I have understood the ```is_observable``` and ```is_always_observable``` routines correctly, then the ```compute_constraint``` function of a constraint should always return an array with shape ```(targets, times)```.\r\n\r\nPresently, this is not true, with different constraints returning arrays of different shapes depending on what the shapes of the ```targets``` and ```times``` inputs. This makes the ```is_observable``` and ```is_always_observable``` routines fail when multiple ```targets``` and ```times``` are supplied and the list of constraints include constraints that return inconsistent shapes.\r\n\r\nThis PR fixes this by ensuring that all constraints return the correct shaped array. I've also added a test for this, but it is not ideal since it won't catch similar bugs in any future ```Constraints``` which are added.\r\n\r\nOther changes included in this PR, which may be more properly factored out into separate PRs are:\r\n\r\n- make the Moon illumination constraint return ```True``` if the moon has set. Even at full moon, the R-band night sky brightness is >21 if the moon has set (see [here](https://confluence.lsstcorp.org/display/SIM/Sky+Brightness+Observations)), so it doesn't make sense for an illumination constraint not to care if the moon is up\r\n\r\n- added constraints on UTC date and a constraint to avoid meridian transits (which is very useful for observers with a German Equatorial Mounted telescope). \r\n\r\n- reverted the workaround which had been put in place because the ```separation``` method of ```SkyCoord``` objects has a bug, which is now fixed."},"comment":{"url":"https://api.github.com/repos/astropy/astroplan/issues/comments/228257626","html_url":"https://github.com/astropy/astroplan/pull/165#issuecomment-228257626","issue_url":"https://api.github.com/repos/astropy/astroplan/issues/165","id":228257626,"user":{"login":"StuartLittlefair","id":4570807,"avatar_url":"https://avatars.githubusercontent.com/u/4570807?v=3","gravatar_id":"","url":"https://api.github.com/users/StuartLittlefair","html_url":"https://github.com/StuartLittlefair","followers_url":"https://api.github.com/users/StuartLittlefair/followers","following_url":"https://api.github.com/users/StuartLittlefair/following{/other_user}","gists_url":"https://api.github.com/users/StuartLittlefair/gists{/gist_id}","starred_url":"https://api.github.com/users/StuartLittlefair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuartLittlefair/subscriptions","organizations_url":"https://api.github.com/users/StuartLittlefair/orgs","repos_url":"https://api.github.com/users/StuartLittlefair/repos","events_url":"https://api.github.com/users/StuartLittlefair/events{/privacy}","received_events_url":"https://api.github.com/users/StuartLittlefair/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T04:51:04Z","updated_at":"2016-06-24T04:51:04Z","body":"This PR would fix #185. If I can't work out how to fix the MeridianTransitConstraint it might be best to split those out and just merge the constraint broadcasting changes. "}}
{"actor":{"display_login":"StuartLittlefair"}}