{"action":"created","comment":{"url":"https://api.github.com/repos/sot/chandra_aca/pulls/comments/93779953","pull_request_review_id":14315958,"id":93779953,"diff_hunk":"@@ -36,3 +36,132 @@ ACA alignment drift\n .. automodule:: chandra_aca.drift\n    :members:\n \n+ACAImage class\n+--------------\n+\n+ACAImage is an ndarray subclass that supports functionality for the Chandra\n+ACA. Most importantly it allows image indexing and slicing in absolute\n+\"aca\" coordinates, where the image lower left coordinate is specified\n+by object ``row0`` and ``col0`` attributes.\n+\n+It also provides a ``meta`` dict that can be used to store additional useful\n+information.  Any keys which are all upper-case will be exposed as object\n+attributes, e.g. ``img.BGDAVG`` <=> ``img.meta['BGDAVG']``.  The ``row0``\n+attribute  is a proxy for ``img.meta['IMGROW0']``, and likewise for ``col0``.\n+\n+When initializing an ``ACAImage``, additional ``*args`` and ``**kwargs`` are\n+used to try initializing via ``np.array(*args, **kwargs)``.  If this fails\n+then ``np.zeros(*args, **kwargs)`` is tried.  In this way one can either\n+initialize from array data or create a new array of zeros.\n+\n+One can easily create a new ``ACAImage`` as shown below.  Note that it must\n+always be 2-dimensional.  The initial ``row0`` and ``col0`` values default\n+to zero.\n+::\n+\n+  >>> from chandra_aca.aca_image import ACAImage\n+  >>> im4 = np.arange(16).reshape(4, 4)\n+  >>> a = ACAImage(im4, row0=10, col0=20)\n+  >>> a\n+  <ACAImage row0=10 col0=20\n+  array([[ 0,  1,  2,  3],\n+         [ 4,  5,  6,  7],\n+         [ 8,  9, 10, 11],\n+         [12, 13, 14, 15]])>\n+\n+One could also initialize by providing a ``meta`` dict::\n+\n+  >>> a = ACAImage(im4, meta={'IMGROW0': 10, 'IMGCOL0': 20, 'BGDAVG': 5.2})\n+  >>> a\n+  <ACAImage row0=10 col0=20\n+  array([[ 0,  1,  2,  3],\n+         [ 4,  5,  6,  7],\n+         [ 8,  9, 10, 11],\n+         [12, 13, 14, 15]])>\n+\n+You can access array elements as usual, and in fact do any normal numpy array operations::\n+\n+  >>> a[3, 3]\n+  15\n+\n+The special nature of ``ACAImage`` comes by doing array access via the ``aca`` attribute.\n+In this case all index values are in absolute coordinates, which might be negative.  In\n+this case we can the pixel at ACA coordinates row=13, col=23, which is equal to ``a[3,","path":"docs/index.rst","position":54,"original_position":54,"commit_id":"026dee9022dc14f434dcdaf83748146d1b1e9c17","original_commit_id":"026dee9022dc14f434dcdaf83748146d1b1e9c17","user":{"login":"jeanconn","id":791508,"avatar_url":"https://avatars.githubusercontent.com/u/791508?v=3","gravatar_id":"","url":"https://api.github.com/users/jeanconn","html_url":"https://github.com/jeanconn","followers_url":"https://api.github.com/users/jeanconn/followers","following_url":"https://api.github.com/users/jeanconn/following{/other_user}","gists_url":"https://api.github.com/users/jeanconn/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanconn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanconn/subscriptions","organizations_url":"https://api.github.com/users/jeanconn/orgs","repos_url":"https://api.github.com/users/jeanconn/repos","events_url":"https://api.github.com/users/jeanconn/events{/privacy}","received_events_url":"https://api.github.com/users/jeanconn/received_events","type":"User","site_admin":false},"body":"Typo \"can the pixel\"","created_at":"2016-12-23T16:02:55Z","updated_at":"2016-12-23T16:02:55Z","html_url":"https://github.com/sot/chandra_aca/pull/19#discussion_r93779953","pull_request_url":"https://api.github.com/repos/sot/chandra_aca/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/sot/chandra_aca/pulls/comments/93779953"},"html":{"href":"https://github.com/sot/chandra_aca/pull/19#discussion_r93779953"},"pull_request":{"href":"https://api.github.com/repos/sot/chandra_aca/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/sot/chandra_aca/pulls/19","id":99156122,"html_url":"https://github.com/sot/chandra_aca/pull/19","diff_url":"https://github.com/sot/chandra_aca/pull/19.diff","patch_url":"https://github.com/sot/chandra_aca/pull/19.patch","issue_url":"https://api.github.com/repos/sot/chandra_aca/issues/19","number":19,"state":"open","locked":false,"title":"Add ACAImage class for manipulating ACA images","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},"body":"This class should make it easier to manipulate ACA images, simulated or real.  Please check it out @malgosias and @jeanconn !\r\n\r\nThe idea is to make a variant of `mica.aca_l0.get_slot_data` which returns the data as a list of these objects.  Not quite as memory efficient or performant, but I think for typical applications this won't be a problem.  As you can see the API was designed with L0 data in mind.\r\n\r\nA future enhancement could be adding a method to do first moment centroiding (or even gaussian centroiding if we want).","created_at":"2016-12-22T19:18:32Z","updated_at":"2016-12-23T16:02:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5952de2401f63c35e381e163474bc5419ce23b79","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sot/chandra_aca/pulls/19/commits","review_comments_url":"https://api.github.com/repos/sot/chandra_aca/pulls/19/comments","review_comment_url":"https://api.github.com/repos/sot/chandra_aca/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sot/chandra_aca/issues/19/comments","statuses_url":"https://api.github.com/repos/sot/chandra_aca/statuses/026dee9022dc14f434dcdaf83748146d1b1e9c17","head":{"label":"sot:acaimage","ref":"acaimage","sha":"026dee9022dc14f434dcdaf83748146d1b1e9c17","user":{"login":"sot","id":781587,"avatar_url":"https://avatars.githubusercontent.com/u/781587?v=3","gravatar_id":"","url":"https://api.github.com/users/sot","html_url":"https://github.com/sot","followers_url":"https://api.github.com/users/sot/followers","following_url":"https://api.github.com/users/sot/following{/other_user}","gists_url":"https://api.github.com/users/sot/gists{/gist_id}","starred_url":"https://api.github.com/users/sot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sot/subscriptions","organizations_url":"https://api.github.com/users/sot/orgs","repos_url":"https://api.github.com/users/sot/repos","events_url":"https://api.github.com/users/sot/events{/privacy}","received_events_url":"https://api.github.com/users/sot/received_events","type":"Organization","site_admin":false},"repo":{"id":12712163,"name":"chandra_aca","full_name":"sot/chandra_aca","owner":{"login":"sot","id":781587,"avatar_url":"https://avatars.githubusercontent.com/u/781587?v=3","gravatar_id":"","url":"https://api.github.com/users/sot","html_url":"https://github.com/sot","followers_url":"https://api.github.com/users/sot/followers","following_url":"https://api.github.com/users/sot/following{/other_user}","gists_url":"https://api.github.com/users/sot/gists{/gist_id}","starred_url":"https://api.github.com/users/sot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sot/subscriptions","organizations_url":"https://api.github.com/users/sot/orgs","repos_url":"https://api.github.com/users/sot/repos","events_url":"https://api.github.com/users/sot/events{/privacy}","received_events_url":"https://api.github.com/users/sot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sot/chandra_aca","description":"Chandra Aspect Camera Tools","fork":false,"url":"https://api.github.com/repos/sot/chandra_aca","forks_url":"https://api.github.com/repos/sot/chandra_aca/forks","keys_url":"https://api.github.com/repos/sot/chandra_aca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sot/chandra_aca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sot/chandra_aca/teams","hooks_url":"https://api.github.com/repos/sot/chandra_aca/hooks","issue_events_url":"https://api.github.com/repos/sot/chandra_aca/issues/events{/number}","events_url":"https://api.github.com/repos/sot/chandra_aca/events","assignees_url":"https://api.github.com/repos/sot/chandra_aca/assignees{/user}","branches_url":"https://api.github.com/repos/sot/chandra_aca/branches{/branch}","tags_url":"https://api.github.com/repos/sot/chandra_aca/tags","blobs_url":"https://api.github.com/repos/sot/chandra_aca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sot/chandra_aca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sot/chandra_aca/git/refs{/sha}","trees_url":"https://api.github.com/repos/sot/chandra_aca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sot/chandra_aca/statuses/{sha}","languages_url":"https://api.github.com/repos/sot/chandra_aca/languages","stargazers_url":"https://api.github.com/repos/sot/chandra_aca/stargazers","contributors_url":"https://api.github.com/repos/sot/chandra_aca/contributors","subscribers_url":"https://api.github.com/repos/sot/chandra_aca/subscribers","subscription_url":"https://api.github.com/repos/sot/chandra_aca/subscription","commits_url":"https://api.github.com/repos/sot/chandra_aca/commits{/sha}","git_commits_url":"https://api.github.com/repos/sot/chandra_aca/git/commits{/sha}","comments_url":"https://api.github.com/repos/sot/chandra_aca/comments{/number}","issue_comment_url":"https://api.github.com/repos/sot/chandra_aca/issues/comments{/number}","contents_url":"https://api.github.com/repos/sot/chandra_aca/contents/{+path}","compare_url":"https://api.github.com/repos/sot/chandra_aca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sot/chandra_aca/merges","archive_url":"https://api.github.com/repos/sot/chandra_aca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sot/chandra_aca/downloads","issues_url":"https://api.github.com/repos/sot/chandra_aca/issues{/number}","pulls_url":"https://api.github.com/repos/sot/chandra_aca/pulls{/number}","milestones_url":"https://api.github.com/repos/sot/chandra_aca/milestones{/number}","notifications_url":"https://api.github.com/repos/sot/chandra_aca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sot/chandra_aca/labels{/name}","releases_url":"https://api.github.com/repos/sot/chandra_aca/releases{/id}","deployments_url":"https://api.github.com/repos/sot/chandra_aca/deployments","created_at":"2013-09-09T20:39:56Z","updated_at":"2016-10-27T14:38:13Z","pushed_at":"2016-12-22T19:24:47Z","git_url":"git://github.com/sot/chandra_aca.git","ssh_url":"git@github.com:sot/chandra_aca.git","clone_url":"https://github.com/sot/chandra_aca.git","svn_url":"https://github.com/sot/chandra_aca","homepage":"http://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc/chandra_aca/","size":128,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"sot:master","ref":"master","sha":"ca0442f35b35da208d9ddb64f4db911e95a42ea6","user":{"login":"sot","id":781587,"avatar_url":"https://avatars.githubusercontent.com/u/781587?v=3","gravatar_id":"","url":"https://api.github.com/users/sot","html_url":"https://github.com/sot","followers_url":"https://api.github.com/users/sot/followers","following_url":"https://api.github.com/users/sot/following{/other_user}","gists_url":"https://api.github.com/users/sot/gists{/gist_id}","starred_url":"https://api.github.com/users/sot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sot/subscriptions","organizations_url":"https://api.github.com/users/sot/orgs","repos_url":"https://api.github.com/users/sot/repos","events_url":"https://api.github.com/users/sot/events{/privacy}","received_events_url":"https://api.github.com/users/sot/received_events","type":"Organization","site_admin":false},"repo":{"id":12712163,"name":"chandra_aca","full_name":"sot/chandra_aca","owner":{"login":"sot","id":781587,"avatar_url":"https://avatars.githubusercontent.com/u/781587?v=3","gravatar_id":"","url":"https://api.github.com/users/sot","html_url":"https://github.com/sot","followers_url":"https://api.github.com/users/sot/followers","following_url":"https://api.github.com/users/sot/following{/other_user}","gists_url":"https://api.github.com/users/sot/gists{/gist_id}","starred_url":"https://api.github.com/users/sot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sot/subscriptions","organizations_url":"https://api.github.com/users/sot/orgs","repos_url":"https://api.github.com/users/sot/repos","events_url":"https://api.github.com/users/sot/events{/privacy}","received_events_url":"https://api.github.com/users/sot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sot/chandra_aca","description":"Chandra Aspect Camera Tools","fork":false,"url":"https://api.github.com/repos/sot/chandra_aca","forks_url":"https://api.github.com/repos/sot/chandra_aca/forks","keys_url":"https://api.github.com/repos/sot/chandra_aca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sot/chandra_aca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sot/chandra_aca/teams","hooks_url":"https://api.github.com/repos/sot/chandra_aca/hooks","issue_events_url":"https://api.github.com/repos/sot/chandra_aca/issues/events{/number}","events_url":"https://api.github.com/repos/sot/chandra_aca/events","assignees_url":"https://api.github.com/repos/sot/chandra_aca/assignees{/user}","branches_url":"https://api.github.com/repos/sot/chandra_aca/branches{/branch}","tags_url":"https://api.github.com/repos/sot/chandra_aca/tags","blobs_url":"https://api.github.com/repos/sot/chandra_aca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sot/chandra_aca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sot/chandra_aca/git/refs{/sha}","trees_url":"https://api.github.com/repos/sot/chandra_aca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sot/chandra_aca/statuses/{sha}","languages_url":"https://api.github.com/repos/sot/chandra_aca/languages","stargazers_url":"https://api.github.com/repos/sot/chandra_aca/stargazers","contributors_url":"https://api.github.com/repos/sot/chandra_aca/contributors","subscribers_url":"https://api.github.com/repos/sot/chandra_aca/subscribers","subscription_url":"https://api.github.com/repos/sot/chandra_aca/subscription","commits_url":"https://api.github.com/repos/sot/chandra_aca/commits{/sha}","git_commits_url":"https://api.github.com/repos/sot/chandra_aca/git/commits{/sha}","comments_url":"https://api.github.com/repos/sot/chandra_aca/comments{/number}","issue_comment_url":"https://api.github.com/repos/sot/chandra_aca/issues/comments{/number}","contents_url":"https://api.github.com/repos/sot/chandra_aca/contents/{+path}","compare_url":"https://api.github.com/repos/sot/chandra_aca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sot/chandra_aca/merges","archive_url":"https://api.github.com/repos/sot/chandra_aca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sot/chandra_aca/downloads","issues_url":"https://api.github.com/repos/sot/chandra_aca/issues{/number}","pulls_url":"https://api.github.com/repos/sot/chandra_aca/pulls{/number}","milestones_url":"https://api.github.com/repos/sot/chandra_aca/milestones{/number}","notifications_url":"https://api.github.com/repos/sot/chandra_aca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sot/chandra_aca/labels{/name}","releases_url":"https://api.github.com/repos/sot/chandra_aca/releases{/id}","deployments_url":"https://api.github.com/repos/sot/chandra_aca/deployments","created_at":"2013-09-09T20:39:56Z","updated_at":"2016-10-27T14:38:13Z","pushed_at":"2016-12-22T19:24:47Z","git_url":"git://github.com/sot/chandra_aca.git","ssh_url":"git@github.com:sot/chandra_aca.git","clone_url":"https://github.com/sot/chandra_aca.git","svn_url":"https://github.com/sot/chandra_aca","homepage":"http://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc/chandra_aca/","size":128,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sot/chandra_aca/pulls/19"},"html":{"href":"https://github.com/sot/chandra_aca/pull/19"},"issue":{"href":"https://api.github.com/repos/sot/chandra_aca/issues/19"},"comments":{"href":"https://api.github.com/repos/sot/chandra_aca/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/sot/chandra_aca/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/sot/chandra_aca/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sot/chandra_aca/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/sot/chandra_aca/statuses/026dee9022dc14f434dcdaf83748146d1b1e9c17"}}}}
{"actor":{"display_login":"jeanconn"}}