Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 1def5532c3cefeba955129117e8c23abb7643cf8 authored by Max's Office PC on 20 November 2019, 03:30:51 UTC, committed by Max's Office PC on 20 November 2019, 03:30:51 UTC
Merge branch 'Master' of https://github.com/RaymondLab/Code into Master
2 parent s 08f15ff + 964f3bd
  • Files
  • Changes
  • 4d2e3a8
  • /
  • Projects
  • /
  • Max - CF Project
  • /
  • getEphysChanMatFile.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:1def5532c3cefeba955129117e8c23abb7643cf8
directory badge Iframe embedding
swh:1:dir:cac382edddef562293d4732575a6b36b3536f9b6
content badge Iframe embedding
swh:1:cnt:852067c2518c5df5247647b1966b62916b46daf7

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
getEphysChanMatFile.m
%{
Maxwell Gagnon - September 2019
- This function finds all Maestro files in a directory, opens them, and saves
them as a .mat file.
- .mat files are easier to work with than the Maestro files.
- The .mat files are also renamed to be more similiar to their behavior
recording file counterparts.
%}

%% Set up
clear;clc;

expmtDataFolder = 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\Jennifer Data\jennifer_arch\Jennifer_Arch';
Files = dir([expmtDataFolder '\**\*']);

%% Filters
% Remove directories
Files([Files.isdir]) = [];
Files(contains({Files.folder}, {'backup'})) = [];

%Files(strlength(Files.name) ~= 10) = [];
tic
for j = length(Files):-1:1
    if strlength(Files(j).name) ~= 10
        Files(j) = [];
    end
end
toc

% Remove zip files
%Files(contains({Files.name}, {'.zip'})) = [];
% Remove non-ephys files - only works for Jenifer's data
%Files(~contains({Files.name}, {'du'})) = [];

%% Find, open, rename, and save ephys files
for i = 1:length(Files)
    
    disp(['(', num2str(i), '/', num2str(length(Files)), ')'])
    try
        % Open the Maestro file (the ephys file)
        ephysData = openmaestro(fullfile(Files(i).folder, Files(i).name));
        
        % Plot
%            figure(1);clf
%            plot(ephysData)
%            title(Files(i).name)
           %xlim([0 50000])
        
        % Rename
        newName = [strrep(Files(i).name, '.', '_0') 'ephys.mat'];
        if contains(newName, 'du')
            newName = strrep(newName, 'du', 'da');
        elseif contains(newName, 'eu')
            newName = strrep(newName, 'eu', 'el');
        end
        
        
        % Save as a .mat with a single varibale inside of it
        disp(fullfile(Files(i).folder, newName))
        save(fullfile(Files(i).folder, newName), 'ephysData')
    end
    fclose('all');
end
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API