Skip to content

Commit

Permalink
fix: round data to dataPoints reported (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobo322 committed Aug 11, 2022
1 parent 3f9d128 commit f271ade
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/component/reducer/actions/FiltersActions.ts
Expand Up @@ -15,17 +15,17 @@ import { updateShift as update2dShift } from '../../../data/data2d/Spectrum2D';
import { Datum1D } from '../../../data/types/data1d';
import { Datum2D } from '../../../data/types/data2d';
import generateID from '../../../data/utilities/generateID';
import { options } from '../../toolbar/ToolTypes';
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
import nucleusToString from '../../utility/nucleusToString';
import { ActiveSpectrum, State } from '../Reducer';
import zoomHistoryManager from '../helper/ZoomHistoryManager';
import getRange from '../helper/getRange';
import { getStrongestPeak } from '../helper/getStrongestPeak';

import { setDomain, setMode } from './DomainActions';
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
import { resetSelectedTool } from './ToolsActions';
import { getStrongestPeak } from '../helper/getStrongestPeak';
import { options } from '../../toolbar/ToolTypes';

function shiftSpectrumAlongXAxis(draft: Draft<State>, shiftValue) {
//apply filter into the spectrum
Expand Down
10 changes: 5 additions & 5 deletions src/data/data1d/Data1DManager.ts
Expand Up @@ -41,11 +41,11 @@ export function fromCSD(result, options = {}, usedColors = {}) {
let offset = dimension.coordinatesOffset.magnitude;

let buffer = dependentVariables[0].components[0];
let re: number[] = [];
let im: number[] = [];
for (let i = buffer.length - 1; i > 0; i -= 2) {
re.push(buffer[i - 1]);
im.push(buffer[i]);
const re = new Float64Array(n);
const im = new Float64Array(n);
for (let i = buffer.length - 1, index = 0; i > 0; i -= 2) {
re[index] = buffer[i - 1];
im[index++] = buffer[i];
}

let data: any = {};
Expand Down

0 comments on commit f271ade

Please sign in to comment.