{"action":"created","comment":{"url":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/comments/74457156","id":74457156,"diff_hunk":"@@ -337,3 +339,104 @@ def apply(self, strain, detector_name, f_lower=None, distance_scale=1):\n             add_injection(lalstrain, signal_lal, None)\n \n         strain.data[:] = lalstrain.data.data[:]\n+\n+class RingdownInjectionSet(object):\n+    \"\"\"Manages a ringdown injection: reads injection from hdf file\n+    and injects it into time series.\n+\n+    Parameters\n+    ----------\n+    hdf_file : string\n+        Path to hdf file containing injection definitions.\n+\n+    Attributes\n+    ----------\n+    table\n+    \"\"\"\n+\n+    def __init__(self, hdf_file):\n+        self.name = hdf_file\n+\n+        injfile = h5py.File(hdf_file,'r')\n+        pnames = map(str, injfile.keys())\n+        self.table = dict([(p, injfile[p].value) for p in pnames])\n+        injfile.close()\n+\n+    def apply(self, strain, detector_name):\n+        \"\"\"Add injection (as seen by a particular detector) to a time series.\n+\n+        Parameters\n+        ----------\n+        strain : TimeSeries\n+            Time series to inject signals into, of type float32 or float64.\n+        detector_name : string\n+            Name of the detector used for projecting injections.\n+        distance_scale: {1, float}, optional\n+            Factor to scale the distance of an injection with. The default is \n+            no scaling. ","path":"pycbc/inject.py","position":48,"original_position":48,"commit_id":"b586c034b4efe61440f1740e443333e8eeaaeab3","original_commit_id":"b586c034b4efe61440f1740e443333e8eeaaeab3","user":{"login":"cdcapano","id":8258446,"avatar_url":"https://avatars.githubusercontent.com/u/8258446?v=3","gravatar_id":"","url":"https://api.github.com/users/cdcapano","html_url":"https://github.com/cdcapano","followers_url":"https://api.github.com/users/cdcapano/followers","following_url":"https://api.github.com/users/cdcapano/following{/other_user}","gists_url":"https://api.github.com/users/cdcapano/gists{/gist_id}","starred_url":"https://api.github.com/users/cdcapano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdcapano/subscriptions","organizations_url":"https://api.github.com/users/cdcapano/orgs","repos_url":"https://api.github.com/users/cdcapano/repos","events_url":"https://api.github.com/users/cdcapano/events{/privacy}","received_events_url":"https://api.github.com/users/cdcapano/received_events","type":"User","site_admin":false},"body":"Remove `distance_scale` from the doc string.","created_at":"2016-08-11T16:36:37Z","updated_at":"2016-08-11T16:36:37Z","html_url":"https://github.com/ligo-cbc/pycbc/pull/1005#discussion_r74457156","pull_request_url":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005","_links":{"self":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/comments/74457156"},"html":{"href":"https://github.com/ligo-cbc/pycbc/pull/1005#discussion_r74457156"},"pull_request":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005"}}},"pull_request":{"url":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005","id":79872423,"html_url":"https://github.com/ligo-cbc/pycbc/pull/1005","diff_url":"https://github.com/ligo-cbc/pycbc/pull/1005.diff","patch_url":"https://github.com/ligo-cbc/pycbc/pull/1005.patch","issue_url":"https://api.github.com/repos/ligo-cbc/pycbc/issues/1005","number":1005,"state":"open","locked":false,"title":"Script to create ringdown injections","user":{"login":"micamu","id":13962481,"avatar_url":"https://avatars.githubusercontent.com/u/13962481?v=3","gravatar_id":"","url":"https://api.github.com/users/micamu","html_url":"https://github.com/micamu","followers_url":"https://api.github.com/users/micamu/followers","following_url":"https://api.github.com/users/micamu/following{/other_user}","gists_url":"https://api.github.com/users/micamu/gists{/gist_id}","starred_url":"https://api.github.com/users/micamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micamu/subscriptions","organizations_url":"https://api.github.com/users/micamu/orgs","repos_url":"https://api.github.com/users/micamu/repos","events_url":"https://api.github.com/users/micamu/events{/privacy}","received_events_url":"https://api.github.com/users/micamu/received_events","type":"User","site_admin":false},"body":"Currently most of my ringdown parameter estimation runs are not reproducible because I had to hack pycbc_inference to perform ringdown injections. This script is a ringdown version of lalapps_inspinj, and the first step to make ringdown injections compatible with the master version of pycbc_inference. \r\npycbc_ringinj takes the parameters of the injection as input, checks that all the required arguments are there (which are approximant dependent) and writes an hdf5 file with the parameters of the injection.\r\nWhen this script is reviewed and merged, I will make the necessary changes in inject.py and strain.py to read this kind of files.","created_at":"2016-08-03T09:13:59Z","updated_at":"2016-08-11T16:36:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8eb79716def8e586426f80fa6e78e70329f405b","assignee":{"login":"ahnitz","id":2206534,"avatar_url":"https://avatars.githubusercontent.com/u/2206534?v=3","gravatar_id":"","url":"https://api.github.com/users/ahnitz","html_url":"https://github.com/ahnitz","followers_url":"https://api.github.com/users/ahnitz/followers","following_url":"https://api.github.com/users/ahnitz/following{/other_user}","gists_url":"https://api.github.com/users/ahnitz/gists{/gist_id}","starred_url":"https://api.github.com/users/ahnitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahnitz/subscriptions","organizations_url":"https://api.github.com/users/ahnitz/orgs","repos_url":"https://api.github.com/users/ahnitz/repos","events_url":"https://api.github.com/users/ahnitz/events{/privacy}","received_events_url":"https://api.github.com/users/ahnitz/received_events","type":"User","site_admin":false},"assignees":[{"login":"ahnitz","id":2206534,"avatar_url":"https://avatars.githubusercontent.com/u/2206534?v=3","gravatar_id":"","url":"https://api.github.com/users/ahnitz","html_url":"https://github.com/ahnitz","followers_url":"https://api.github.com/users/ahnitz/followers","following_url":"https://api.github.com/users/ahnitz/following{/other_user}","gists_url":"https://api.github.com/users/ahnitz/gists{/gist_id}","starred_url":"https://api.github.com/users/ahnitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahnitz/subscriptions","organizations_url":"https://api.github.com/users/ahnitz/orgs","repos_url":"https://api.github.com/users/ahnitz/repos","events_url":"https://api.github.com/users/ahnitz/events{/privacy}","received_events_url":"https://api.github.com/users/ahnitz/received_events","type":"User","site_admin":false},{"login":"cdcapano","id":8258446,"avatar_url":"https://avatars.githubusercontent.com/u/8258446?v=3","gravatar_id":"","url":"https://api.github.com/users/cdcapano","html_url":"https://github.com/cdcapano","followers_url":"https://api.github.com/users/cdcapano/followers","following_url":"https://api.github.com/users/cdcapano/following{/other_user}","gists_url":"https://api.github.com/users/cdcapano/gists{/gist_id}","starred_url":"https://api.github.com/users/cdcapano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdcapano/subscriptions","organizations_url":"https://api.github.com/users/cdcapano/orgs","repos_url":"https://api.github.com/users/cdcapano/repos","events_url":"https://api.github.com/users/cdcapano/events{/privacy}","received_events_url":"https://api.github.com/users/cdcapano/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005/commits","review_comments_url":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005/comments","review_comment_url":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ligo-cbc/pycbc/issues/1005/comments","statuses_url":"https://api.github.com/repos/ligo-cbc/pycbc/statuses/b586c034b4efe61440f1740e443333e8eeaaeab3","head":{"label":"micamu:ringdown_injs","ref":"ringdown_injs","sha":"b586c034b4efe61440f1740e443333e8eeaaeab3","user":{"login":"micamu","id":13962481,"avatar_url":"https://avatars.githubusercontent.com/u/13962481?v=3","gravatar_id":"","url":"https://api.github.com/users/micamu","html_url":"https://github.com/micamu","followers_url":"https://api.github.com/users/micamu/followers","following_url":"https://api.github.com/users/micamu/following{/other_user}","gists_url":"https://api.github.com/users/micamu/gists{/gist_id}","starred_url":"https://api.github.com/users/micamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micamu/subscriptions","organizations_url":"https://api.github.com/users/micamu/orgs","repos_url":"https://api.github.com/users/micamu/repos","events_url":"https://api.github.com/users/micamu/events{/privacy}","received_events_url":"https://api.github.com/users/micamu/received_events","type":"User","site_admin":false},"repo":{"id":42664154,"name":"pycbc","full_name":"micamu/pycbc","owner":{"login":"micamu","id":13962481,"avatar_url":"https://avatars.githubusercontent.com/u/13962481?v=3","gravatar_id":"","url":"https://api.github.com/users/micamu","html_url":"https://github.com/micamu","followers_url":"https://api.github.com/users/micamu/followers","following_url":"https://api.github.com/users/micamu/following{/other_user}","gists_url":"https://api.github.com/users/micamu/gists{/gist_id}","starred_url":"https://api.github.com/users/micamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micamu/subscriptions","organizations_url":"https://api.github.com/users/micamu/orgs","repos_url":"https://api.github.com/users/micamu/repos","events_url":"https://api.github.com/users/micamu/events{/privacy}","received_events_url":"https://api.github.com/users/micamu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/micamu/pycbc","description":"Python CBC Tools","fork":true,"url":"https://api.github.com/repos/micamu/pycbc","forks_url":"https://api.github.com/repos/micamu/pycbc/forks","keys_url":"https://api.github.com/repos/micamu/pycbc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/micamu/pycbc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/micamu/pycbc/teams","hooks_url":"https://api.github.com/repos/micamu/pycbc/hooks","issue_events_url":"https://api.github.com/repos/micamu/pycbc/issues/events{/number}","events_url":"https://api.github.com/repos/micamu/pycbc/events","assignees_url":"https://api.github.com/repos/micamu/pycbc/assignees{/user}","branches_url":"https://api.github.com/repos/micamu/pycbc/branches{/branch}","tags_url":"https://api.github.com/repos/micamu/pycbc/tags","blobs_url":"https://api.github.com/repos/micamu/pycbc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/micamu/pycbc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/micamu/pycbc/git/refs{/sha}","trees_url":"https://api.github.com/repos/micamu/pycbc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/micamu/pycbc/statuses/{sha}","languages_url":"https://api.github.com/repos/micamu/pycbc/languages","stargazers_url":"https://api.github.com/repos/micamu/pycbc/stargazers","contributors_url":"https://api.github.com/repos/micamu/pycbc/contributors","subscribers_url":"https://api.github.com/repos/micamu/pycbc/subscribers","subscription_url":"https://api.github.com/repos/micamu/pycbc/subscription","commits_url":"https://api.github.com/repos/micamu/pycbc/commits{/sha}","git_commits_url":"https://api.github.com/repos/micamu/pycbc/git/commits{/sha}","comments_url":"https://api.github.com/repos/micamu/pycbc/comments{/number}","issue_comment_url":"https://api.github.com/repos/micamu/pycbc/issues/comments{/number}","contents_url":"https://api.github.com/repos/micamu/pycbc/contents/{+path}","compare_url":"https://api.github.com/repos/micamu/pycbc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/micamu/pycbc/merges","archive_url":"https://api.github.com/repos/micamu/pycbc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/micamu/pycbc/downloads","issues_url":"https://api.github.com/repos/micamu/pycbc/issues{/number}","pulls_url":"https://api.github.com/repos/micamu/pycbc/pulls{/number}","milestones_url":"https://api.github.com/repos/micamu/pycbc/milestones{/number}","notifications_url":"https://api.github.com/repos/micamu/pycbc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/micamu/pycbc/labels{/name}","releases_url":"https://api.github.com/repos/micamu/pycbc/releases{/id}","deployments_url":"https://api.github.com/repos/micamu/pycbc/deployments","created_at":"2015-09-17T15:22:49Z","updated_at":"2016-07-28T12:45:11Z","pushed_at":"2016-08-11T12:35:29Z","git_url":"git://github.com/micamu/pycbc.git","ssh_url":"git@github.com:micamu/pycbc.git","clone_url":"https://github.com/micamu/pycbc.git","svn_url":"https://github.com/micamu/pycbc","homepage":null,"size":50872,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ligo-cbc:master","ref":"master","sha":"4fb69769864b6becb5b9fd9f1b352e74f1c1270a","user":{"login":"ligo-cbc","id":11262917,"avatar_url":"https://avatars.githubusercontent.com/u/11262917?v=3","gravatar_id":"","url":"https://api.github.com/users/ligo-cbc","html_url":"https://github.com/ligo-cbc","followers_url":"https://api.github.com/users/ligo-cbc/followers","following_url":"https://api.github.com/users/ligo-cbc/following{/other_user}","gists_url":"https://api.github.com/users/ligo-cbc/gists{/gist_id}","starred_url":"https://api.github.com/users/ligo-cbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ligo-cbc/subscriptions","organizations_url":"https://api.github.com/users/ligo-cbc/orgs","repos_url":"https://api.github.com/users/ligo-cbc/repos","events_url":"https://api.github.com/users/ligo-cbc/events{/privacy}","received_events_url":"https://api.github.com/users/ligo-cbc/received_events","type":"Organization","site_admin":false},"repo":{"id":31596861,"name":"pycbc","full_name":"ligo-cbc/pycbc","owner":{"login":"ligo-cbc","id":11262917,"avatar_url":"https://avatars.githubusercontent.com/u/11262917?v=3","gravatar_id":"","url":"https://api.github.com/users/ligo-cbc","html_url":"https://github.com/ligo-cbc","followers_url":"https://api.github.com/users/ligo-cbc/followers","following_url":"https://api.github.com/users/ligo-cbc/following{/other_user}","gists_url":"https://api.github.com/users/ligo-cbc/gists{/gist_id}","starred_url":"https://api.github.com/users/ligo-cbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ligo-cbc/subscriptions","organizations_url":"https://api.github.com/users/ligo-cbc/orgs","repos_url":"https://api.github.com/users/ligo-cbc/repos","events_url":"https://api.github.com/users/ligo-cbc/events{/privacy}","received_events_url":"https://api.github.com/users/ligo-cbc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ligo-cbc/pycbc","description":"Python CBC Tools","fork":false,"url":"https://api.github.com/repos/ligo-cbc/pycbc","forks_url":"https://api.github.com/repos/ligo-cbc/pycbc/forks","keys_url":"https://api.github.com/repos/ligo-cbc/pycbc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ligo-cbc/pycbc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ligo-cbc/pycbc/teams","hooks_url":"https://api.github.com/repos/ligo-cbc/pycbc/hooks","issue_events_url":"https://api.github.com/repos/ligo-cbc/pycbc/issues/events{/number}","events_url":"https://api.github.com/repos/ligo-cbc/pycbc/events","assignees_url":"https://api.github.com/repos/ligo-cbc/pycbc/assignees{/user}","branches_url":"https://api.github.com/repos/ligo-cbc/pycbc/branches{/branch}","tags_url":"https://api.github.com/repos/ligo-cbc/pycbc/tags","blobs_url":"https://api.github.com/repos/ligo-cbc/pycbc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ligo-cbc/pycbc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ligo-cbc/pycbc/git/refs{/sha}","trees_url":"https://api.github.com/repos/ligo-cbc/pycbc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ligo-cbc/pycbc/statuses/{sha}","languages_url":"https://api.github.com/repos/ligo-cbc/pycbc/languages","stargazers_url":"https://api.github.com/repos/ligo-cbc/pycbc/stargazers","contributors_url":"https://api.github.com/repos/ligo-cbc/pycbc/contributors","subscribers_url":"https://api.github.com/repos/ligo-cbc/pycbc/subscribers","subscription_url":"https://api.github.com/repos/ligo-cbc/pycbc/subscription","commits_url":"https://api.github.com/repos/ligo-cbc/pycbc/commits{/sha}","git_commits_url":"https://api.github.com/repos/ligo-cbc/pycbc/git/commits{/sha}","comments_url":"https://api.github.com/repos/ligo-cbc/pycbc/comments{/number}","issue_comment_url":"https://api.github.com/repos/ligo-cbc/pycbc/issues/comments{/number}","contents_url":"https://api.github.com/repos/ligo-cbc/pycbc/contents/{+path}","compare_url":"https://api.github.com/repos/ligo-cbc/pycbc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ligo-cbc/pycbc/merges","archive_url":"https://api.github.com/repos/ligo-cbc/pycbc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ligo-cbc/pycbc/downloads","issues_url":"https://api.github.com/repos/ligo-cbc/pycbc/issues{/number}","pulls_url":"https://api.github.com/repos/ligo-cbc/pycbc/pulls{/number}","milestones_url":"https://api.github.com/repos/ligo-cbc/pycbc/milestones{/number}","notifications_url":"https://api.github.com/repos/ligo-cbc/pycbc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ligo-cbc/pycbc/labels{/name}","releases_url":"https://api.github.com/repos/ligo-cbc/pycbc/releases{/id}","deployments_url":"https://api.github.com/repos/ligo-cbc/pycbc/deployments","created_at":"2015-03-03T12:19:19Z","updated_at":"2016-07-19T10:23:36Z","pushed_at":"2016-08-11T14:41:58Z","git_url":"git://github.com/ligo-cbc/pycbc.git","ssh_url":"git@github.com:ligo-cbc/pycbc.git","clone_url":"https://github.com/ligo-cbc/pycbc.git","svn_url":"https://github.com/ligo-cbc/pycbc","homepage":null,"size":150953,"stargazers_count":44,"watchers_count":44,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":79,"mirror_url":null,"open_issues_count":49,"forks":79,"open_issues":49,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005"},"html":{"href":"https://github.com/ligo-cbc/pycbc/pull/1005"},"issue":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/issues/1005"},"comments":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/issues/1005/comments"},"review_comments":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005/comments"},"review_comment":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/pulls/1005/commits"},"statuses":{"href":"https://api.github.com/repos/ligo-cbc/pycbc/statuses/b586c034b4efe61440f1740e443333e8eeaaeab3"}}}}
{"actor":{"display_login":"cdcapano"}}