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/dianadima/mot_action
16 February 2026, 15:46:27 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 117e2b6
  • /
  • analysis
  • /
  • multiple_arrangement
  • /
  • wrappers
  • /
  • sim_readdata_exp1.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:20511a7efddbda6086c8d99acec8b084284ebb20
origin badgedirectory badge
swh:1:dir:c11f8debb20f1cdfb24c64c83fc243e5367f9853
origin badgerevision badge
swh:1:rev:af9eede56f27215ca38ddd32564017f1f90417d0
origin badgesnapshot badge
swh:1:snp:f2f99c4dd69e729c6fef806b76906abac5078ffe

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
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 ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: af9eede56f27215ca38ddd32564017f1f90417d0 authored by Diana Dima on 20 November 2021, 02:04:32 UTC
final clean up fixes
Tip revision: af9eede
sim_readdata_exp1.m
function [rdm] = sim_readdata_exp1(datapath,savefile)
% read and save Meadows multiple arrangement data from json files - Experiment 1
% datapath: data directory
% savefile: data file to be saved
% DC Dima 2020 (diana.c.dima@gmail.com)

nstim = 152; %hard-coded

%find the datafile in the directory
files = dir(datapath);
files = {files(:).name};
files = files{contains(files, '.json')};

data = jsondecode(fileread(fullfile(datapath,files)));

%append datasets in which people didn't hit 'submit'
data = sim_appenddata(data, fullfile(datapath,'additional'));

%save all data as a .mat file
save(fullfile(datapath,'data.mat'),'data')

subnames = fieldnames(data);
nsub = numel(subnames);

incompl_idx = false(nsub,1); %mark incomplete participants
exclude_idx = false(nsub,1); %mark participants excluded after QC

rdm = nan(nsub,nstim,nstim);
rdm_qc = nan(nsub,7,7); %7 stimuli per training

catch_answers = cell(nsub,3);
feedback = cell(nsub,1);
mturk_id = cell(nsub,1);

for isub = 1:nsub
    
    %check if MA task was finished
    datasub = getfield(data,subnames{isub});
    mturk_id{isub} = datasub.tasks{1}.mTurkID;
    
    %first check that they finished the MA task
    if ~strcmp(datasub.tasks{8}.status, 'finished')
        
        incompl_idx(isub) = 1;
        
    else
        
        if isub==1 %get stimulus list in order
            stimlist = datasub.tasks{1}.stimuli;
            stimlist = {stimlist(:).name};
            stimlist = sort(stimlist);
        end
        
        %display catch trials and select participants based on them
        ct = datasub.tasks{7};
        catch_answers{isub,1} = ct.Video1;
        catch_answers{isub,2} = ct.Video2;
        catch_answers{isub,3} = ct.Video3;
        feedback{isub} = datasub.tasks{9}.Feedback;
        
        fprintf('Catch answers for sub %d\n, %s\n,%s\n,%s\n', isub, ct.Video1, ct.Video2, ct.Video3);
        fprintf('\nFeedback: %s\n', feedback{isub})
        x = input('Exclude? Y/N: ', 's');
        
        %no point extracting data for excluded subjects
        if strcmp(x,'Y')
        
            exclude_idx(isub) = 1;
        
        else
            
            %training matrix
            qc = datasub.tasks{5};
            qcstim = {qc.stimuli(:).name};
            [stimlist_qc,idx] = sort(qcstim);
            rdmqcsub = squareform(qc.rdm);
            rdm_qc(isub,:,:) = rdmqcsub(idx,idx);
            
            %full matrix - sort & normalize
            df = datasub.tasks{8};
            rdm(isub,:,:) = sim_assignrdm(df,stimlist);            
            
            
        end
        
    end
    
end

%remove participants who did not complete or were excluded
idx = incompl_idx|exclude_idx;
rdm_qc(idx,:,:) = [];
rdm(idx,:,:) = [];

%save training & MA data
qc = [];
qc.stimlist = stimlist_qc;
qc.rdm = rdm_qc;

save(savefile, 'qc', 'rdm', 'exclude_idx', 'incompl_idx', 'stimlist','catch_answers', 'feedback','mturk_id')




















end

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