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
  • /
  • FindChanAmps.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:0c24ae69e4dd2b9409eecf2c84d4ea77c72bfeb1

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 ...
FindChanAmps.m
%% Set up
clear;clc;
% open Excel File
excelFile = 'C:\Users\Public\RaymondLabCode\Projects\Max - CF Project\Monkey Metadata by Max.xlsx';
%excelFile = 'C:\Users\Public\RaymondLabCode\Projects\Max - CF Project\Monkey Metadata by Max (Akira).xlsx';
expmt_table = readtable(excelFile);

ExpmtDataFolder = 'D:\My Drive\Expmt Data\2019_05 - Max Climbing Fiber\Initial Data for testing';
%ExpmtDataFolder = 'G:\My Drive\Expmt Data\2019_05 - Akira and Sriram Complex Spikes';

%bFiles = dir([ExpmtDataFolder '\**\*.0*']);
bFiles = dir([ExpmtDataFolder '\**\*']);


%% Only Sine Waves
SineExpmts = expmt_table(contains(expmt_table.SineStep, {'Sine'}), :);
figure(1);
ha = tight_subplot(2,1,[.03 .03],[.03 .03],[.03 .03]);
for i = 1:height(SineExpmts)
    
    bPath = fullfile(bFiles(find(contains({bFiles.name}, SineExpmts.Filename(i)))).folder, ...
        bFiles(find(contains({bFiles.name}, SineExpmts.Filename(i)))).name);
    
    ePath = fullfile(bFiles(find(contains({bFiles.name}, SineExpmts.EphysFilename(i)))).folder, ...
        bFiles(find(contains({bFiles.name}, SineExpmts.EphysFilename(i)))).name);
    try
        
        [beh shiftAmt, shiftConfidence] = opensingleMAXEDIT(bPath, 0, ePath);
    catch
    end
    
    %% PLOT each channel
    OverviewPlot = 1;
    if OverviewPlot
        
        for q = 4:5

            axes(ha(q-3))

            if isempty(beh(q).data)
                title([beh(q).chanlabel, ' is empty'])
                continue
            end

                    
                    

                
            samplerate = beh(q).samplerate;
            timeVec = 0:( 1/samplerate ):( length(beh(q).data)-1 )/samplerate;
            timeVec2 = (1:length(beh(q).data))/samplerate;
            freq = SineExpmts.Freq_Duration(i);
            
            y1 = sin(2*pi*freq*timeVec2)';
            y2 = cos(2*pi*freq*timeVec2)';
            constant = ones(length(beh(q).data),1);
            vars = [y1 y2 constant];
            [b,~,~,~,stat] = regress(beh(q).data, vars);
            Amp(i) = sqrt(b(1)^2+b(2)^2);
            Phase = rad2deg(atan2(b(2), b(1)));

            % Plot
            %plot(timeVec, beh(q).data); hold on
            %title(beh(q).chanlabel)
            
            switch q
                case 1 % Horz Gaze Vel
                    ylim([-600 600])
                case 2
                case 3 % Horz Eye Pos
                    ylim([-600 600])
                case 4 % Horz Target Pos
                    ylim([-600 600])
                case 5 % Horz Head Vel
                    ylim([-600 600])
                case 6 % Horz D Vel
                    ylim([-600 600])
                case 7 % Horz Target Vel
                    ylim([-2000 2000])
                case 8
                    
            end
            % Only show Tick labels on bottom (Epyhs Channel)
            if q ~= length(ha)-1
                xticks([]);
            end
        end
        linkaxes(ha, 'x')
    end
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