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

https://github.com/RaymondLab/Code
25 June 2024, 13:39:08 UTC
  • Code
  • Branches (12)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/Calibration
    • refs/heads/Calibration2
    • refs/heads/Master
    • refs/heads/VerticalTracking
    • refs/heads/code_generalization
    • refs/heads/consolidation_project_241B
    • refs/heads/local_configuration_241B
    • refs/heads/revert-2-consolidation_project_241B
    • refs/heads/rig241b_driftfix_sign
    • refs/heads/smr_to_smrx
    • refs/heads/tracking_dev
    • refs/tags/v1.0.0
    No releases to show
  • c602b73
  • /
  • Tools
  • /
  • Program_Maestro_and_CX
  • /
  • alignCXandMaestro.m
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

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.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:d5dd7f3a8c954d3c97ed1e100345c8fd91a00232
origin badgedirectory badge
swh:1:dir:9944363461928a8964f61c345661adced0a4f553
origin badgerevision badge
swh:1:rev:9261b1e083022ac6e07fc4c84d727c94167aa984
origin badgesnapshot badge
swh:1:snp:5000b5dcf61aa2cac987bbe6af9204d011668dda

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.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 9261b1e083022ac6e07fc4c84d727c94167aa984 authored by D253 on 14 October 2019, 17:47:56 UTC
Merge branch 'tracking_dev' of https://github.com/RaymondLab/Code into tracking_dev
Tip revision: 9261b1e
alignCXandMaestro.m
function [behaviorDat, shiftAmt, shiftConfidence] = alignCXandMaestro(behaviorDat, ephysDat, plotOn)

    % Don't plot by default
    if ~exist('plotOn','var')
        plotOn = 0;
    end
    
    
    eSamplerate = ephysDat.samplerate;
    ephysData = datchandata(ephysDat,'Ephys');
    timeEphys = 0:1/eSamplerate:(length(ephysData)-1)/eSamplerate;
    
    %% Allign Ephys Data
    spikesForAlignment = 100:150;
    
    timeofsimplespikes = datchandata(behaviorDat,'ss');    
    eventsSampleTime = timeofsimplespikes * eSamplerate;
    eventsSampleTime = eventsSampleTime(spikesForAlignment);
    eventsSampleTime = round(eventsSampleTime);
    eventsSampleTime = eventsSampleTime - eventsSampleTime(1);
    
    sumofthings = nan(length(ephysData),1);
    
    for x = 1:length(ephysData)
        if max(eventsSampleTime + x) > length(ephysData)
            break
        end
        sumofthings(x) = sum(ephysData(eventsSampleTime + x));
    end
    
    %% Modify ephys
    maxMatchValue = max(abs(sumofthings));
    maxSumLoc = timeEphys(find(abs(sumofthings) == maxMatchValue));
    
    if maxMatchValue > 30
        shiftAmt = -(maxSumLoc - timeofsimplespikes(100));
        timeEphys = timeEphys + shiftAmt;
        shiftConfidence = maxMatchValue;
        
        if plotOn
            figure(9);clf
            plot(timeEphys, abs(sumofthings))
            ylim([0 100])
            if ~isempty(maxSumLoc)
                vline(maxSumLoc + shiftAmt)
                xlim([maxSumLoc-1 maxSumLoc+1])
            end

            figure(10); clf
            plot(timeEphys, ephysData);
            vline(timeofsimplespikes(1:100))
            xlim([.5 1])
        end
        

    else
        shiftAmt = 0;
        shiftConfidence = 0;
    end
    
    %% add shifted ephys channel to behavior structure
    behaviorDat(end+1) = dat(ephysData, 'Ephys', length(behaviorDat)+1, eSamplerate, timeEphys(1),timeEphys(end),'mV?');

back to top

Software Heritage — Copyright (C) 2015–2026, 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