carlson-lab / lpne-data-analysis

1 stars 0 forks source link

added toRemove field for dataOpts #4

Closed jackgoffinet closed 3 years ago

jackgoffinet commented 3 years ago

Here's a fix to the problem in #2 . I putting 0's next to channels I didn't want to include in the CHANACTIVE excel file. It turns out formatWindows.m just leaves those channels as all NaNs, and then they get caught in averageAreas because too many timepoints are NaNs. I think the NaNs checked here are intended to be the NaNs introduced when detecting saturation, but they also catch the CHANACTIVE NaNs by mistake.

One option to fix this would be to change the behavior of formatWindows.m so it doesn't save any data for the non-active channels. Instead I added a new field to dataOpts called toRemove, a string array of all the channels to be removed. I think this requires fewer changes to the code and I don't know what else relies on the NaNs introduced by non-active channels in formatWindows.m, so this extra field in dataOpts could be redundant with CHANACTIVE.

@mhunterklein , could you review this?