{"action":"created","issue":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/649","labels_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/649/labels{/name}","comments_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/649/comments","events_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/649/events","html_url":"https://github.com/GalSim-developers/GalSim/pull/649","id":58487842,"number":649,"title":"#639 TopHat profile","user":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-22T02:58:52Z","updated_at":"2015-02-22T21:52:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/pulls/649","html_url":"https://github.com/GalSim-developers/GalSim/pull/649","diff_url":"https://github.com/GalSim-developers/GalSim/pull/649.diff","patch_url":"https://github.com/GalSim-developers/GalSim/pull/649.patch"},"body":"This PR is mostly to enable a circular top-hat profile, as requested by @chazshapiro.  That's all pretty straightforward, and the new class is called `TopHat` in python, and `SBTopHat` in C++.\r\n\r\nHowever, along the way, I noticed a bug in our implementation of the `SBBox` class, which I was using as a template for my implementation of `SBTopHat`.  \r\n\r\nFor all other classes, our implementation of real-space drawing is to render the surface brightness at the pixel center.  However, `SBBox`'s real-space rendering along the edge of the box had been to draw plateau height times the fraction of the pixel area that falls inside the box.  \r\n\r\nThis isn't consistent with our description of how profiles are supposed to be rendered, so I'm pretty sure this was an incorrect implementation.  It evaded notice, because no one ever really calls this function, so nobody cared.  But I fixed the function to draw either the full plateau height or zero according to whether the pixel center is inside the box or not.  This is also the nature of the implementation of the `TopHat` rendering in real space.\r\n\r\nI believe the old implementation is essentially what you get when you convolve a `Box` by a `Pixel`.  In other words the action of `box.drawImage(...)` with default arguments, which is unchanged by the edits on this branch."},"comment":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/comments/75464860","html_url":"https://github.com/GalSim-developers/GalSim/pull/649#issuecomment-75464860","issue_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/649","id":75464860,"user":{"login":"rmandelb","id":1454906,"avatar_url":"https://avatars.githubusercontent.com/u/1454906?v=3","gravatar_id":"","url":"https://api.github.com/users/rmandelb","html_url":"https://github.com/rmandelb","followers_url":"https://api.github.com/users/rmandelb/followers","following_url":"https://api.github.com/users/rmandelb/following{/other_user}","gists_url":"https://api.github.com/users/rmandelb/gists{/gist_id}","starred_url":"https://api.github.com/users/rmandelb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmandelb/subscriptions","organizations_url":"https://api.github.com/users/rmandelb/orgs","repos_url":"https://api.github.com/users/rmandelb/repos","events_url":"https://api.github.com/users/rmandelb/events{/privacy}","received_events_url":"https://api.github.com/users/rmandelb/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T21:52:23Z","updated_at":"2015-02-22T21:52:23Z","body":"> Considering that real top hats are circular, I thought the name was rather apt.\r\n\r\nYeah, I think it would be great if I weren't used to talking about mathematical top-hats defined in Cartesian coordinates.  And I'm willing to buy the argument that nobody but me would be confused by this.  Of the other options, i could deal with Pinhole or Disk.\r\n"}}