{"action":"created","issue":{"url":"https://api.github.com/repos/lucabaldini/ximpol/issues/151","repository_url":"https://api.github.com/repos/lucabaldini/ximpol","labels_url":"https://api.github.com/repos/lucabaldini/ximpol/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/lucabaldini/ximpol/issues/151/comments","events_url":"https://api.github.com/repos/lucabaldini/ximpol/issues/151/events","html_url":"https://github.com/lucabaldini/ximpol/issues/151","id":163342344,"number":151,"title":"Add to the xPointSpreadFunction class a draw_aplpy_circle() method","user":{"login":"lucabaldini","id":8972541,"avatar_url":"https://avatars.githubusercontent.com/u/8972541?v=3","gravatar_id":"","url":"https://api.github.com/users/lucabaldini","html_url":"https://github.com/lucabaldini","followers_url":"https://api.github.com/users/lucabaldini/followers","following_url":"https://api.github.com/users/lucabaldini/following{/other_user}","gists_url":"https://api.github.com/users/lucabaldini/gists{/gist_id}","starred_url":"https://api.github.com/users/lucabaldini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucabaldini/subscriptions","organizations_url":"https://api.github.com/users/lucabaldini/orgs","repos_url":"https://api.github.com/users/lucabaldini/repos","events_url":"https://api.github.com/users/lucabaldini/events{/privacy}","received_events_url":"https://api.github.com/users/lucabaldini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-01T08:12:13Z","updated_at":"2016-07-02T10:55:32Z","closed_at":null,"body":"This is not completely trivial, as there's some coordinate conversion involved, but it should not be too hard.\r\n\r\nA relevant snippet:\r\n```\r\nRAD_PSF = 11/60.\r\nfig.show_circles(239.5414, 27.2812, RAD_PSF/60., lw=2, color='white')\r\nfig.add_label(0.825,0.91, 'PSF', relative=True, size='x-large', color='white',  horizontalalignment='left')\r\n```"},"comment":{"url":"https://api.github.com/repos/lucabaldini/ximpol/issues/comments/230096086","html_url":"https://github.com/lucabaldini/ximpol/issues/151#issuecomment-230096086","issue_url":"https://api.github.com/repos/lucabaldini/ximpol/issues/151","id":230096086,"user":{"login":"ndilalla","id":16223421,"avatar_url":"https://avatars.githubusercontent.com/u/16223421?v=3","gravatar_id":"","url":"https://api.github.com/users/ndilalla","html_url":"https://github.com/ndilalla","followers_url":"https://api.github.com/users/ndilalla/followers","following_url":"https://api.github.com/users/ndilalla/following{/other_user}","gists_url":"https://api.github.com/users/ndilalla/gists{/gist_id}","starred_url":"https://api.github.com/users/ndilalla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndilalla/subscriptions","organizations_url":"https://api.github.com/users/ndilalla/orgs","repos_url":"https://api.github.com/users/ndilalla/repos","events_url":"https://api.github.com/users/ndilalla/events{/privacy}","received_events_url":"https://api.github.com/users/ndilalla/received_events","type":"User","site_admin":false},"created_at":"2016-07-02T10:55:32Z","updated_at":"2016-07-02T10:55:32Z","body":"I added a first version of the draw_psf_circle() function in xPointSpreadFunction class:\r\n\r\n```\r\n    def draw_psf_circle(self, image, x, y, text='PSF', color='white', lw=2):\r\n        \"\"\"Add the PSF circle to the image with labels. This function must be\r\n        called after the (possible) image recenter.\r\n\r\n        Note the x and y are coordinates relative to the figure axes (0.0 is\r\n        left or bottom and 1.0 is right or top).\r\n        \"\"\"\r\n        psf_rad = self.hew/(2.*60.**2) #degrees\r\n        xpix_low, xpix_high = image._ax1.get_xbound()\r\n        ypix_low, ypix_high = image._ax1.get_ybound()\r\n        xpix_circ = x*(xpix_high-xpix_low) + xpix_low\r\n        ypix_circ = y*(ypix_high-ypix_low) + ypix_low\r\n        ra_circ, dec_circ = image.pixel2world(xpix_circ, ypix_circ)\r\n        dec_text_up = dec_circ+1.7*psf_rad\r\n        dec_text_down = dec_circ-1.9*psf_rad\r\n        image.add_label(ra_circ, dec_text_up, text, size='x-large', color=color,\r\n                        horizontalalignment='center')\r\n        image.show_circles(ra_circ, dec_circ, psf_rad, lw=lw, color=color)\r\n        text_psf = '%d\"' %round(self.hew)\r\n        image.add_label(ra_circ, dec_text_down, text_psf, size='large',\r\n                        color=color, horizontalalignment='center')\r\n```\r\nThis is probably not the most elegant or compact way to do this but it works. I tried to use some of the transformations defined inside matplotlib (e.g. ax1.transAxes or similar), but I did not succeed.\r\n\r\nAnd this is the output for the xipe_mirror-30s-f4_psf-jetx-rescaled-hew30_gpd-baseline.psf:\r\n![figure_1](https://cloud.githubusercontent.com/assets/16223421/16539927/1082f9d0-4052-11e6-90d9-45ba0309e659.png)\r\n\r\n"}}
{"actor":{"display_login":"ndilalla"}}