{"size": 994, "ext": "js", "max_stars_repo_path": "packages/spectra-data/src/analysis/filters.js", "max_stars_repo_name": "jobo322/spectra", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "packages/spectra-data/src/analysis/filters.js", "max_issues_repo_name": "jobo322/spectra", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/spectra-data/src/analysis/filters.js", "max_forks_repo_name": "jobo322/spectra", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.2352941176, "max_line_length": 64, "alphanum_fraction": 0.5623742455}
export default function getSignals(pdata, maxShiftDiference) {
  let signals = [];
  let signalsTemp = [];
  if (maxShiftDiference === undefined) maxShiftDiference = 0.06;

  for (var k = 0; k < pdata[0].peakPicking.length; k++) {
    signals.push(pdata[0].peakPicking[k].signal[0].delta);
    signalsTemp.push(pdata[0].peakPicking[k].signal[0].delta);
  }

  for (let i = 0; i < pdata.length; i++) {
    // console.log("i: "+i)
    let peaks = pdata[i].peakPicking;
    for (k = 0; k < peaks.length; k++) {
      let newSignal = true;
      for (let j = 0; j < signals.length; j++) {
        if (
          Math.abs(peaks[k].signal[0].delta - signalsTemp[j]) <=
          maxShiftDiference
        ) {
          signalsTemp[j] = peaks[k].signal[0].delta;
          newSignal = false;
          j = signals.length;
        }
      }
      if (newSignal) {
        signals.push(peaks[k].signal[0].delta);
        signalsTemp.push(peaks[k].signal[0].delta);
      }
    }
  }
  return signals;
}
