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 bc6bc5271ca8c2cbf8107bdf243352e543f64b8e authored by Brian Angeles (Desktop) on 20 March 2023, 22:34:45 UTC, committed by Brian Angeles (Desktop) on 20 March 2023, 22:34:45 UTC
Added .gitignore file and removed RigChoice.s2s
As a first step to generalizing the code, we removed the need to
comment/uncomment the appropriate rig-specific parameters file and
replace it with a local rig_config.s2s file that is ignored by Git. This
way, changes can be made to this simple file without affecting the
Github repository at all.
1 parent 3d78fa7
  • Files
  • Changes
  • 9b50c67
  • /
  • Projects
  • /
  • Boris - Photometry
  • /
  • Max Code
  • /
  • segMean.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:bc6bc5271ca8c2cbf8107bdf243352e543f64b8e
directory badge
swh:1:dir:233eac2eaf9fd131d6456a478c2013586df2a5cd
content badge
swh:1:cnt:ff746393fc09215b977d7a558769f03bcfb17d4e

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
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
segMean.m
%% this script is used to takes a segments, or chunks of data, and organize
% them in a useful way.
%
% max.gagnon11@gmail.com 5/18

%% Import data
clear
data = 1:1000;

%% setup 

% Define start time
startT = 10;

% CHOOSE ONE: total amount of segments, or end time of the segments
endT = 80;
%segNum = 4;

% Define length of each segment, and the gap between them
segLen = 12;
gapLen = 2;

% if segNum is given, find endT
if ~exist('endT', 'var')
    segSum = segLen * segNum;
    gapSum = gapLen * (segNum -1);
    endT = startT + segSum + gapSum;
end

startTList = startT:segLen+gapLen:endT;

% if endT is given, find the segNum
if ~exist('segNum', 'var')
    segNum = length(startTList);
end

%% create matrix with rows for each segment

% pre-Allocate matrix
segMatrix = zeros(segNum, segLen);

row = 1;

for i = startTList
  
    if row == segNum
         % on the final segment, fill in the rest of the values with NaN, as the
        % final segment is likely to be only a partial cycle.
        finalSeg = data( i : endT);
        finalSeg = [finalSeg NaN(1, segLen - length(finalSeg))];
        segMatrix(row,:) = finalSeg;
    else
        % add to matrix normally
        segMatrix(row,:) = data(i:i+segLen-1);
    end
    
    row = row + 1;
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–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