{"action":"created","issue":{"url":"https://api.github.com/repos/voytekresearch/pacpy/issues/20","labels_url":"https://api.github.com/repos/voytekresearch/pacpy/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/voytekresearch/pacpy/issues/20/comments","events_url":"https://api.github.com/repos/voytekresearch/pacpy/issues/20/events","html_url":"https://github.com/voytekresearch/pacpy/issues/20","id":115785103,"number":20,"title":"Event-related PAC?","user":{"login":"choldgraf","id":1839645,"avatar_url":"https://avatars.githubusercontent.com/u/1839645?v=3","gravatar_id":"","url":"https://api.github.com/users/choldgraf","html_url":"https://github.com/choldgraf","followers_url":"https://api.github.com/users/choldgraf/followers","following_url":"https://api.github.com/users/choldgraf/following{/other_user}","gists_url":"https://api.github.com/users/choldgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/choldgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choldgraf/subscriptions","organizations_url":"https://api.github.com/users/choldgraf/orgs","repos_url":"https://api.github.com/users/choldgraf/repos","events_url":"https://api.github.com/users/choldgraf/events{/privacy}","received_events_url":"https://api.github.com/users/choldgraf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-09T03:35:22Z","updated_at":"2015-11-09T17:25:35Z","closed_at":null,"body":"What's the recommended way to adapt this code for event-related PAC? I assume that just running the functions on individual trials would be OK, but might run into trouble with edge artifacts, no? And moreover, what would be the best way to combine the PAC statistic across trials? You could just take the mean but that would throw out some information about the variability.\r\n\r\nMaybe a way to deal with that is to specify a `ix_begin` parameter where it will only use indices above `ix_begin` in the pac estimation. Or maybe it'd be worth just having a trials-based function that handles this under the hood. Have you guys thought about this at all?"},"comment":{"url":"https://api.github.com/repos/voytekresearch/pacpy/issues/comments/155131910","html_url":"https://github.com/voytekresearch/pacpy/issues/20#issuecomment-155131910","issue_url":"https://api.github.com/repos/voytekresearch/pacpy/issues/20","id":155131910,"user":{"login":"choldgraf","id":1839645,"avatar_url":"https://avatars.githubusercontent.com/u/1839645?v=3","gravatar_id":"","url":"https://api.github.com/users/choldgraf","html_url":"https://github.com/choldgraf","followers_url":"https://api.github.com/users/choldgraf/followers","following_url":"https://api.github.com/users/choldgraf/following{/other_user}","gists_url":"https://api.github.com/users/choldgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/choldgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choldgraf/subscriptions","organizations_url":"https://api.github.com/users/choldgraf/orgs","repos_url":"https://api.github.com/users/choldgraf/repos","events_url":"https://api.github.com/users/choldgraf/events{/privacy}","received_events_url":"https://api.github.com/users/choldgraf/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T17:25:35Z","updated_at":"2015-11-09T17:25:35Z","body":"You could always write some helper functions and call those (e.g.,\n`_prepare_filter_signal` or something). Or make it a function that's\navailable to the user if it's useful enough for people to use it in custom\nways.\n\nOn Mon, Nov 9, 2015 at 9:15 AM, Scott Cole <notifications@github.com> wrote:\n\n> @hoycw <https://github.com/hoycw> Right, I've been imagining #1\n> <https://github.com/voytekresearch/pacpy/issues/1> for this situation.\n> There is a bit of functionality built in to make this easier.\n> 'pac.pa_series' is a function that takes input similar to PAC functions but\n> just returns the phase time series and amplitude time series. Therefore, we\n> can do all the filtering on the long, continuous recordings. Then, we input\n> a subsection of these time serieses (the trial) into the main PAC function\n> (instead of the raw data), and by setting the kwarg 'filterfn = False', we\n> calculate PAC on this short time segment without doing the filtering.\n>\n> @roemervandermeij <https://github.com/roemervandermeij> Right. I should\n> go ahead and implement that ASAP. I was thinking we would just need to make\n> another function that calculates the filter length (used for filtering for\n> the phase time series), and then chop off that filter length from each end\n> of the signal. A few questions:\n> 1. Should we make the edge artifact cutting a kwarg with default on or\n> off?\n> 2. I think making a new filter length calculation function is cleaner than\n> the alternative of modifying the current filtering function to return the\n> filter length when desired, right?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/voytekresearch/pacpy/issues/20#issuecomment-155129208>\n> .\n>\n"}}