{"action":"created","comment":{"url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments/28703373","id":28703373,"diff_hunk":"@@ -30,15 +30,27 @@ object ScalaGuideProbeUtil {\n           area.add(new Area(s))\n           area\n       }\n+\n+      // Base position coordinates.\n+      val baseX = ctx.getBaseCoordinates.getRa.toArcsecs.getMagnitude\n+      val baseY = ctx.getBaseCoordinates.getDec.toArcsecs.getMagnitude\n+\n       val vignettingSum = ctx.getSciencePositions.toList.foldLeft(0.0){\n         case (currentSum,offset) =>\n           // Find the probe arm adjustment, which consists of the arm angle and guide star location in arcsec.\n           // If an adjustment exists, calculate the vignetting for this offset.\n           val vignetting = probeArmGeometry.armAdjustment(ctx, coordinates, offset).map { armAdjustment =>\n             // Adjust the science area for the current offset.\n-            val x = -(offset.p.toNewModel.toNormalizedArcseconds)\n-            val y = -(offset.q.toNewModel.toNormalizedArcseconds * flip)\n-            val trans = AffineTransform.getTranslateInstance(x, y)\n+            val offX = -(offset.p.toNewModel.toNormalizedArcseconds)\n+            val offY = -(offset.q.toNewModel.toNormalizedArcseconds * flip)\n+\n+            // Instead of performing the intersection of the science area at its real position of (base pos + sci offset)\n+            // and the probe arm at its real position of (base pos + guide star offset), we instead perform the\n+            // intersection by factoring out the base position from both and translating the science area to sci offset\n+            // and the probe arm position at guide star offset. This should always be equivalent.\n+            // Since FeatureGeometry.transformScienceAreaForContext moves the science area to the base position, we\n+            // move it back to (0,0) + offset in order to factor out the base position.","path":"bundle/edu.gemini.pot/src/main/scala/edu/gemini/spModel/guide/ScalaGuideProbeUtil.scala","position":26,"original_position":26,"commit_id":"2ef590339735de2a5cc53d03320967186572d35f","original_commit_id":"2ef590339735de2a5cc53d03320967186572d35f","user":{"login":"swalker2m","id":4906023,"avatar_url":"https://avatars.githubusercontent.com/u/4906023?v=3","gravatar_id":"","url":"https://api.github.com/users/swalker2m","html_url":"https://github.com/swalker2m","followers_url":"https://api.github.com/users/swalker2m/followers","following_url":"https://api.github.com/users/swalker2m/following{/other_user}","gists_url":"https://api.github.com/users/swalker2m/gists{/gist_id}","starred_url":"https://api.github.com/users/swalker2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swalker2m/subscriptions","organizations_url":"https://api.github.com/users/swalker2m/orgs","repos_url":"https://api.github.com/users/swalker2m/repos","events_url":"https://api.github.com/users/swalker2m/events{/privacy}","received_events_url":"https://api.github.com/users/swalker2m/received_events","type":"User","site_admin":false},"body":"Trying these changes out, with offset positions I'm still seeing 0 vignetting for selections that clearly vignette.","created_at":"2015-04-20T16:16:03Z","updated_at":"2015-04-20T16:16:03Z","html_url":"https://github.com/gemini-hlsw/ocs/pull/325#discussion_r28703373","pull_request_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325","_links":{"self":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments/28703373"},"html":{"href":"https://github.com/gemini-hlsw/ocs/pull/325#discussion_r28703373"},"pull_request":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325"}}},"pull_request":{"url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325","id":33601769,"html_url":"https://github.com/gemini-hlsw/ocs/pull/325","diff_url":"https://github.com/gemini-hlsw/ocs/pull/325.diff","patch_url":"https://github.com/gemini-hlsw/ocs/pull/325.patch","issue_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/325","number":325,"state":"open","locked":false,"title":"OCSADV-256: Fixed bug with regards to vignetting calculation","user":{"login":"sraaphorst","id":8795653,"avatar_url":"https://avatars.githubusercontent.com/u/8795653?v=3","gravatar_id":"","url":"https://api.github.com/users/sraaphorst","html_url":"https://github.com/sraaphorst","followers_url":"https://api.github.com/users/sraaphorst/followers","following_url":"https://api.github.com/users/sraaphorst/following{/other_user}","gists_url":"https://api.github.com/users/sraaphorst/gists{/gist_id}","starred_url":"https://api.github.com/users/sraaphorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sraaphorst/subscriptions","organizations_url":"https://api.github.com/users/sraaphorst/orgs","repos_url":"https://api.github.com/users/sraaphorst/repos","events_url":"https://api.github.com/users/sraaphorst/events{/privacy}","received_events_url":"https://api.github.com/users/sraaphorst/received_events","type":"User","site_admin":false},"body":"Science area was translated to base position + science offset, but guide stars were only translated to their offset from the base position, thus resulting in vignetting of 0 when base position was not near (0,0).\r\n\r\nThis breaks the previous test cases for AGS, probably because the brightest guide star is no longer picked for GMOS and F2 since guide stars are binned by image quality and then picked by min vignetting, with ties broken by brightness. I don't have time to fix this, though, before leaving for vacation, and I wanted to make sure that these changes were available for the next build, hence the PR.\r\n\r\nI will have limited e-mail access as of Sunday evening should anything come up.","created_at":"2015-04-18T13:03:10Z","updated_at":"2015-04-20T16:16:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ebeeacea646aa1c0af2dfcba1d2099329835c9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325/commits","review_comments_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325/comments","review_comment_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/325/comments","statuses_url":"https://api.github.com/repos/gemini-hlsw/ocs/statuses/2ef590339735de2a5cc53d03320967186572d35f","head":{"label":"sraaphorst:sraaphorst-feature/OCSADV-256","ref":"sraaphorst-feature/OCSADV-256","sha":"2ef590339735de2a5cc53d03320967186572d35f","user":{"login":"sraaphorst","id":8795653,"avatar_url":"https://avatars.githubusercontent.com/u/8795653?v=3","gravatar_id":"","url":"https://api.github.com/users/sraaphorst","html_url":"https://github.com/sraaphorst","followers_url":"https://api.github.com/users/sraaphorst/followers","following_url":"https://api.github.com/users/sraaphorst/following{/other_user}","gists_url":"https://api.github.com/users/sraaphorst/gists{/gist_id}","starred_url":"https://api.github.com/users/sraaphorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sraaphorst/subscriptions","organizations_url":"https://api.github.com/users/sraaphorst/orgs","repos_url":"https://api.github.com/users/sraaphorst/repos","events_url":"https://api.github.com/users/sraaphorst/events{/privacy}","received_events_url":"https://api.github.com/users/sraaphorst/received_events","type":"User","site_admin":false},"repo":{"id":24112855,"name":"ocs","full_name":"sraaphorst/ocs","owner":{"login":"sraaphorst","id":8795653,"avatar_url":"https://avatars.githubusercontent.com/u/8795653?v=3","gravatar_id":"","url":"https://api.github.com/users/sraaphorst","html_url":"https://github.com/sraaphorst","followers_url":"https://api.github.com/users/sraaphorst/followers","following_url":"https://api.github.com/users/sraaphorst/following{/other_user}","gists_url":"https://api.github.com/users/sraaphorst/gists{/gist_id}","starred_url":"https://api.github.com/users/sraaphorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sraaphorst/subscriptions","organizations_url":"https://api.github.com/users/sraaphorst/orgs","repos_url":"https://api.github.com/users/sraaphorst/repos","events_url":"https://api.github.com/users/sraaphorst/events{/privacy}","received_events_url":"https://api.github.com/users/sraaphorst/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sraaphorst/ocs","description":"","fork":true,"url":"https://api.github.com/repos/sraaphorst/ocs","forks_url":"https://api.github.com/repos/sraaphorst/ocs/forks","keys_url":"https://api.github.com/repos/sraaphorst/ocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sraaphorst/ocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sraaphorst/ocs/teams","hooks_url":"https://api.github.com/repos/sraaphorst/ocs/hooks","issue_events_url":"https://api.github.com/repos/sraaphorst/ocs/issues/events{/number}","events_url":"https://api.github.com/repos/sraaphorst/ocs/events","assignees_url":"https://api.github.com/repos/sraaphorst/ocs/assignees{/user}","branches_url":"https://api.github.com/repos/sraaphorst/ocs/branches{/branch}","tags_url":"https://api.github.com/repos/sraaphorst/ocs/tags","blobs_url":"https://api.github.com/repos/sraaphorst/ocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sraaphorst/ocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sraaphorst/ocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/sraaphorst/ocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sraaphorst/ocs/statuses/{sha}","languages_url":"https://api.github.com/repos/sraaphorst/ocs/languages","stargazers_url":"https://api.github.com/repos/sraaphorst/ocs/stargazers","contributors_url":"https://api.github.com/repos/sraaphorst/ocs/contributors","subscribers_url":"https://api.github.com/repos/sraaphorst/ocs/subscribers","subscription_url":"https://api.github.com/repos/sraaphorst/ocs/subscription","commits_url":"https://api.github.com/repos/sraaphorst/ocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/sraaphorst/ocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/sraaphorst/ocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/sraaphorst/ocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/sraaphorst/ocs/contents/{+path}","compare_url":"https://api.github.com/repos/sraaphorst/ocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sraaphorst/ocs/merges","archive_url":"https://api.github.com/repos/sraaphorst/ocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sraaphorst/ocs/downloads","issues_url":"https://api.github.com/repos/sraaphorst/ocs/issues{/number}","pulls_url":"https://api.github.com/repos/sraaphorst/ocs/pulls{/number}","milestones_url":"https://api.github.com/repos/sraaphorst/ocs/milestones{/number}","notifications_url":"https://api.github.com/repos/sraaphorst/ocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sraaphorst/ocs/labels{/name}","releases_url":"https://api.github.com/repos/sraaphorst/ocs/releases{/id}","created_at":"2014-09-16T18:48:19Z","updated_at":"2015-04-17T20:36:57Z","pushed_at":"2015-04-18T13:00:50Z","git_url":"git://github.com/sraaphorst/ocs.git","ssh_url":"git@github.com:sraaphorst/ocs.git","clone_url":"https://github.com/sraaphorst/ocs.git","svn_url":"https://github.com/sraaphorst/ocs","homepage":null,"size":262399,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"gemini-hlsw:develop","ref":"develop","sha":"01c7bd8fbf08c6772ca412007f7abe85ed5724e2","user":{"login":"gemini-hlsw","id":8593735,"avatar_url":"https://avatars.githubusercontent.com/u/8593735?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-hlsw","html_url":"https://github.com/gemini-hlsw","followers_url":"https://api.github.com/users/gemini-hlsw/followers","following_url":"https://api.github.com/users/gemini-hlsw/following{/other_user}","gists_url":"https://api.github.com/users/gemini-hlsw/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-hlsw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-hlsw/subscriptions","organizations_url":"https://api.github.com/users/gemini-hlsw/orgs","repos_url":"https://api.github.com/users/gemini-hlsw/repos","events_url":"https://api.github.com/users/gemini-hlsw/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-hlsw/received_events","type":"Organization","site_admin":false},"repo":{"id":23963494,"name":"ocs","full_name":"gemini-hlsw/ocs","owner":{"login":"gemini-hlsw","id":8593735,"avatar_url":"https://avatars.githubusercontent.com/u/8593735?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-hlsw","html_url":"https://github.com/gemini-hlsw","followers_url":"https://api.github.com/users/gemini-hlsw/followers","following_url":"https://api.github.com/users/gemini-hlsw/following{/other_user}","gists_url":"https://api.github.com/users/gemini-hlsw/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-hlsw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-hlsw/subscriptions","organizations_url":"https://api.github.com/users/gemini-hlsw/orgs","repos_url":"https://api.github.com/users/gemini-hlsw/repos","events_url":"https://api.github.com/users/gemini-hlsw/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-hlsw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gemini-hlsw/ocs","description":"Observatory Control Software","fork":false,"url":"https://api.github.com/repos/gemini-hlsw/ocs","forks_url":"https://api.github.com/repos/gemini-hlsw/ocs/forks","keys_url":"https://api.github.com/repos/gemini-hlsw/ocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gemini-hlsw/ocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gemini-hlsw/ocs/teams","hooks_url":"https://api.github.com/repos/gemini-hlsw/ocs/hooks","issue_events_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/events{/number}","events_url":"https://api.github.com/repos/gemini-hlsw/ocs/events","assignees_url":"https://api.github.com/repos/gemini-hlsw/ocs/assignees{/user}","branches_url":"https://api.github.com/repos/gemini-hlsw/ocs/branches{/branch}","tags_url":"https://api.github.com/repos/gemini-hlsw/ocs/tags","blobs_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gemini-hlsw/ocs/statuses/{sha}","languages_url":"https://api.github.com/repos/gemini-hlsw/ocs/languages","stargazers_url":"https://api.github.com/repos/gemini-hlsw/ocs/stargazers","contributors_url":"https://api.github.com/repos/gemini-hlsw/ocs/contributors","subscribers_url":"https://api.github.com/repos/gemini-hlsw/ocs/subscribers","subscription_url":"https://api.github.com/repos/gemini-hlsw/ocs/subscription","commits_url":"https://api.github.com/repos/gemini-hlsw/ocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/gemini-hlsw/ocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/gemini-hlsw/ocs/contents/{+path}","compare_url":"https://api.github.com/repos/gemini-hlsw/ocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gemini-hlsw/ocs/merges","archive_url":"https://api.github.com/repos/gemini-hlsw/ocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gemini-hlsw/ocs/downloads","issues_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues{/number}","pulls_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls{/number}","milestones_url":"https://api.github.com/repos/gemini-hlsw/ocs/milestones{/number}","notifications_url":"https://api.github.com/repos/gemini-hlsw/ocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gemini-hlsw/ocs/labels{/name}","releases_url":"https://api.github.com/repos/gemini-hlsw/ocs/releases{/id}","created_at":"2014-09-12T14:20:23Z","updated_at":"2015-04-17T18:37:25Z","pushed_at":"2015-04-19T21:37:57Z","git_url":"git://github.com/gemini-hlsw/ocs.git","ssh_url":"git@github.com:gemini-hlsw/ocs.git","clone_url":"https://github.com/gemini-hlsw/ocs.git","svn_url":"https://github.com/gemini-hlsw/ocs","homepage":"","size":269982,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":6,"forks":9,"open_issues":6,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325"},"html":{"href":"https://github.com/gemini-hlsw/ocs/pull/325"},"issue":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/issues/325"},"comments":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/issues/325/comments"},"review_comments":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325/comments"},"review_comment":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/325/commits"},"statuses":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/statuses/2ef590339735de2a5cc53d03320967186572d35f"}}}}