nmrium 0.38.0 → 0.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +4 -5
- package/lib/component/NMRium.js +11 -14
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/PreferencesContext.d.ts +6 -6
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +1 -1
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +35 -66
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +43 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +1 -6
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -25
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +1 -2
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.d.ts +2 -1
- package/lib/data/PredictionManager.js +16 -2
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +8 -11
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +43 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -27
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -27
- package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +16 -2
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +25 -25
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapIntegrals = void 0;
|
|
4
|
-
const uuid_1 = require("@lukeed/uuid");
|
|
5
|
-
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
6
|
-
const getShiftX_1 = require("../getShiftX");
|
|
7
|
-
function getRange(integral, shiftTarget, shift) {
|
|
8
|
-
const { originFrom, originTo, from, to } = integral;
|
|
9
|
-
if (shiftTarget === 'origin') {
|
|
10
|
-
return {
|
|
11
|
-
originFrom: from - shift,
|
|
12
|
-
originTo: to - shift,
|
|
13
|
-
from,
|
|
14
|
-
to,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return {
|
|
19
|
-
originFrom,
|
|
20
|
-
originTo,
|
|
21
|
-
from: originFrom + shift,
|
|
22
|
-
to: originTo + shift,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function mapIntegrals(integrals, spectrum, shiftTarget = 'origin') {
|
|
27
|
-
const { x, re } = spectrum.data;
|
|
28
|
-
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
29
|
-
return integrals.map((integral) => {
|
|
30
|
-
const integralBoundary = getRange(integral, shiftTarget, shiftX);
|
|
31
|
-
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: integralBoundary.from, to: integralBoundary.to, reverse: true });
|
|
32
|
-
return {
|
|
33
|
-
...integral,
|
|
34
|
-
id: integral.id || (0, uuid_1.v4)(),
|
|
35
|
-
...integralBoundary,
|
|
36
|
-
absolute,
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
exports.mapIntegrals = mapIntegrals;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateIntegrals = void 0;
|
|
4
|
-
const mapIntegrals_1 = require("./mapIntegrals");
|
|
5
|
-
const updateIntegralsRelativeValues_1 = require("./updateIntegralsRelativeValues");
|
|
6
|
-
function updateIntegrals(spectrum) {
|
|
7
|
-
spectrum.integrals.values = (0, mapIntegrals_1.mapIntegrals)(spectrum.integrals.values, spectrum, 'current');
|
|
8
|
-
(0, updateIntegralsRelativeValues_1.updateIntegralsRelativeValues)(spectrum, true);
|
|
9
|
-
}
|
|
10
|
-
exports.updateIntegrals = updateIntegrals;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateIntegralsRelativeValues = void 0;
|
|
4
|
-
const checkIntegralKind_1 = require("./checkIntegralKind");
|
|
5
|
-
const updateRelatives_1 = require("./updateRelatives");
|
|
6
|
-
function updateIntegralsRelativeValues(spectrum, forceCalculateIntegral = false) {
|
|
7
|
-
(0, updateRelatives_1.updateRelatives)(spectrum.integrals, 'integral', checkIntegralKind_1.checkIntegralKind, forceCalculateIntegral);
|
|
8
|
-
}
|
|
9
|
-
exports.updateIntegralsRelativeValues = updateIntegralsRelativeValues;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateRelatives = void 0;
|
|
4
|
-
const getSum_1 = require("../../../utilities/getSum");
|
|
5
|
-
function updateRelatives(data, key, check, forceCalculateIntegral = false) {
|
|
6
|
-
const { values, options } = data;
|
|
7
|
-
const currentSum = (0, getSum_1.getSum)(values, 'absolute', check);
|
|
8
|
-
let factor = 0;
|
|
9
|
-
if (options?.sum) {
|
|
10
|
-
if (options.isSumConstant || forceCalculateIntegral) {
|
|
11
|
-
factor = currentSum > 0 ? options.sum / currentSum : 0;
|
|
12
|
-
}
|
|
13
|
-
else if (values?.[0]) {
|
|
14
|
-
const item = values[0];
|
|
15
|
-
factor = (item[key] || options.sum) / item.absolute;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
data.values = values.map((value) => {
|
|
19
|
-
return {
|
|
20
|
-
...value,
|
|
21
|
-
...(check(value) && {
|
|
22
|
-
[key]: value.absolute * factor,
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
if (!options.isSumConstant && !forceCalculateIntegral) {
|
|
27
|
-
options.sum = (0, getSum_1.getSum)(values, key, check);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.updateRelatives = updateRelatives;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapPeaks = void 0;
|
|
4
|
-
const uuid_1 = require("@lukeed/uuid");
|
|
5
|
-
const getShiftX_1 = require("../getShiftX");
|
|
6
|
-
const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
|
|
7
|
-
function isExists(peak, spectrum, error) {
|
|
8
|
-
// check if the Peak is already exists
|
|
9
|
-
for (const { x } of spectrum.peaks?.values || []) {
|
|
10
|
-
if (Math.abs(peak.x - x) < error) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
function getPeakDelta(peak, shiftTarget, shift) {
|
|
17
|
-
const { originalX = 0, x } = peak;
|
|
18
|
-
if (shiftTarget === 'origin') {
|
|
19
|
-
return {
|
|
20
|
-
originalX: x - shift,
|
|
21
|
-
x,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return {
|
|
26
|
-
originalX,
|
|
27
|
-
x: originalX + shift,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function mapPeaks(peaks, spectrum, options = {}) {
|
|
32
|
-
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
33
|
-
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
34
|
-
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
|
|
35
|
-
let newPeaks = [];
|
|
36
|
-
for (const peak of peaks) {
|
|
37
|
-
const peakDelta = getPeakDelta(peak, shiftTarget, shiftX);
|
|
38
|
-
if (!checkIsExisting ||
|
|
39
|
-
(checkIsExisting && !isExists(peak, spectrum, error))) {
|
|
40
|
-
newPeaks.push({
|
|
41
|
-
...peak,
|
|
42
|
-
id: peak?.id || (0, uuid_1.v4)(),
|
|
43
|
-
...peakDelta,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return newPeaks;
|
|
48
|
-
}
|
|
49
|
-
exports.mapPeaks = mapPeaks;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updatePeaks = void 0;
|
|
4
|
-
const mapPeaks_1 = require("./mapPeaks");
|
|
5
|
-
function updatePeaks(spectrum) {
|
|
6
|
-
spectrum.peaks.values = (0, mapPeaks_1.mapPeaks)(spectrum.peaks.values, spectrum, {
|
|
7
|
-
checkIsExisting: false,
|
|
8
|
-
shiftTarget: 'current',
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
exports.updatePeaks = updatePeaks;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapRanges = void 0;
|
|
4
|
-
const uuid_1 = require("@lukeed/uuid");
|
|
5
|
-
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
6
|
-
const SignalsKinds_1 = require("../../../constants/SignalsKinds");
|
|
7
|
-
const getShiftX_1 = require("../getShiftX");
|
|
8
|
-
const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
|
|
9
|
-
function checkRange(range, spectrum, error) {
|
|
10
|
-
// check if the range is already exists
|
|
11
|
-
for (const { from, to } of spectrum.ranges?.values || []) {
|
|
12
|
-
if (Math.abs(range.from - from) < error &&
|
|
13
|
-
Math.abs(range.to - to) < error) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function getRange(range, shiftTarget, shift) {
|
|
19
|
-
const { originFrom, originTo, from, to } = range;
|
|
20
|
-
if (shiftTarget === 'origin') {
|
|
21
|
-
return {
|
|
22
|
-
originFrom: from - shift,
|
|
23
|
-
originTo: to - shift,
|
|
24
|
-
from,
|
|
25
|
-
to,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return {
|
|
30
|
-
originFrom,
|
|
31
|
-
originTo,
|
|
32
|
-
from: (originFrom || 0) + shift,
|
|
33
|
-
to: (originTo || 0) + shift,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function getSignalDelta(signal, shiftTarget, shift) {
|
|
38
|
-
const { delta, originDelta } = signal;
|
|
39
|
-
if (shiftTarget === 'origin') {
|
|
40
|
-
return {
|
|
41
|
-
originDelta: delta - shift,
|
|
42
|
-
delta,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return {
|
|
47
|
-
originDelta,
|
|
48
|
-
delta: (originDelta || 0) + shift,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function mapRanges(ranges, spectrum, options = {}) {
|
|
53
|
-
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
54
|
-
const { x, re } = spectrum.data;
|
|
55
|
-
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
56
|
-
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
|
|
57
|
-
if (checkIsExisting) {
|
|
58
|
-
ranges = ranges.filter((r) => (checkIsExisting && !checkRange(r, spectrum, error)) || r.id === 'new');
|
|
59
|
-
}
|
|
60
|
-
return ranges.map((range) => {
|
|
61
|
-
const rangeBoundary = getRange(range, shiftTarget, shiftX);
|
|
62
|
-
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: rangeBoundary.from, to: rangeBoundary.to, reverse: true });
|
|
63
|
-
const signals = range.signals.map((signal) => {
|
|
64
|
-
const { kind = null, id, ...resSignal } = signal;
|
|
65
|
-
return {
|
|
66
|
-
kind: kind || 'signal',
|
|
67
|
-
id: id || (0, uuid_1.v4)(),
|
|
68
|
-
...resSignal,
|
|
69
|
-
...getSignalDelta(signal, shiftTarget, shiftX),
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
return {
|
|
73
|
-
...range,
|
|
74
|
-
id: range.id || (0, uuid_1.v4)(),
|
|
75
|
-
kind: signals?.[0].kind || SignalsKinds_1.DatumKind.signal,
|
|
76
|
-
...rangeBoundary,
|
|
77
|
-
absolute,
|
|
78
|
-
signals,
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
exports.mapRanges = mapRanges;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateRanges = void 0;
|
|
4
|
-
const mapRanges_1 = require("./mapRanges");
|
|
5
|
-
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
6
|
-
function updateRanges(spectrum) {
|
|
7
|
-
spectrum.ranges.values = (0, mapRanges_1.mapRanges)(spectrum.ranges.values, spectrum, {
|
|
8
|
-
checkIsExisting: false,
|
|
9
|
-
shiftTarget: 'current',
|
|
10
|
-
});
|
|
11
|
-
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(spectrum, true);
|
|
12
|
-
}
|
|
13
|
-
exports.updateRanges = updateRanges;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateRangesRelativeValues = void 0;
|
|
4
|
-
const updateRelatives_1 = require("../integrals/updateRelatives");
|
|
5
|
-
const checkRangeKind_1 = require("./checkRangeKind");
|
|
6
|
-
function updateRangesRelativeValues(spectrum, forceCalculateIntegral = false) {
|
|
7
|
-
(0, updateRelatives_1.updateRelatives)(spectrum.ranges, 'integration', checkRangeKind_1.checkRangeKind, forceCalculateIntegral);
|
|
8
|
-
}
|
|
9
|
-
exports.updateRangesRelativeValues = updateRangesRelativeValues;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apodizationFilter = exports.reduce = exports.isApplicable = exports.apply = exports.defaultApodizationOptions = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
|
-
const nmr_processing_1 = require("nmr-processing");
|
|
5
|
-
exports.id = 'apodization';
|
|
6
|
-
exports.name = 'Apodization';
|
|
7
|
-
exports.DOMAIN_UPDATE_RULES = {
|
|
8
|
-
updateXDomain: true,
|
|
9
|
-
updateYDomain: false,
|
|
10
|
-
};
|
|
11
|
-
exports.defaultApodizationOptions = {
|
|
12
|
-
lineBroadening: 1,
|
|
13
|
-
gaussBroadening: 0,
|
|
14
|
-
lineBroadeningCenter: 0,
|
|
15
|
-
};
|
|
16
|
-
function apply(datum1D, options = {}) {
|
|
17
|
-
const { lineBroadening = 1, gaussBroadening = 0, lineBroadeningCenter = 0, } = options;
|
|
18
|
-
// if no options is set, we add the default value to filter
|
|
19
|
-
if (Object.keys(options).length === 0) {
|
|
20
|
-
const filter = datum1D.filters.find((filter) => filter.name === exports.id);
|
|
21
|
-
if (filter) {
|
|
22
|
-
filter.value = { lineBroadening, gaussBroadening, lineBroadeningCenter };
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const newData = apodizationFilter(datum1D, {
|
|
26
|
-
lineBroadening,
|
|
27
|
-
gaussBroadening,
|
|
28
|
-
lineBroadeningCenter,
|
|
29
|
-
});
|
|
30
|
-
datum1D.data = {
|
|
31
|
-
...datum1D.data,
|
|
32
|
-
re: newData.re,
|
|
33
|
-
im: newData.im,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
exports.apply = apply;
|
|
37
|
-
function isApplicable(datum1D) {
|
|
38
|
-
if (datum1D.info.isComplex && datum1D.info.isFid)
|
|
39
|
-
return true;
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
exports.isApplicable = isApplicable;
|
|
43
|
-
function reduce(previousValue, newValue) {
|
|
44
|
-
return {
|
|
45
|
-
once: true,
|
|
46
|
-
reduce: newValue,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
exports.reduce = reduce;
|
|
50
|
-
function apodizationFilter(datum1D, options = {}) {
|
|
51
|
-
const { lineBroadening = 1, gaussBroadening = 0, lineBroadeningCenter = 0, } = options;
|
|
52
|
-
let grpdly = datum1D.info?.digitalFilter || 0;
|
|
53
|
-
let pointsToShift;
|
|
54
|
-
if (grpdly > 0) {
|
|
55
|
-
pointsToShift = Math.floor(grpdly);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
pointsToShift = 0;
|
|
59
|
-
}
|
|
60
|
-
const data = datum1D.data;
|
|
61
|
-
const re = data.re;
|
|
62
|
-
const im = data.im;
|
|
63
|
-
const t = data.x;
|
|
64
|
-
const length = re.length;
|
|
65
|
-
const dw = (t[length - 1] - t[0]) / (length - 1); //REPLACE CONSTANT with calculated value... : for this we need AQ or DW to set it right...
|
|
66
|
-
return (0, nmr_processing_1.apodization)({ re, im }, {
|
|
67
|
-
pointsToShift,
|
|
68
|
-
compose: {
|
|
69
|
-
length,
|
|
70
|
-
shapes: [
|
|
71
|
-
{
|
|
72
|
-
start: 0,
|
|
73
|
-
shape: {
|
|
74
|
-
kind: 'lorentzToGauss',
|
|
75
|
-
options: {
|
|
76
|
-
length,
|
|
77
|
-
dw,
|
|
78
|
-
exponentialHz: gaussBroadening > 0 ? lineBroadening : -lineBroadening,
|
|
79
|
-
gaussianHz: gaussBroadening,
|
|
80
|
-
center: lineBroadeningCenter,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
exports.apodizationFilter = apodizationFilter;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
7
|
-
const ml_airpls_1 = __importDefault(require("ml-airpls"));
|
|
8
|
-
const ml_array_xy_equally_spaced_1 = __importDefault(require("ml-array-xy-equally-spaced"));
|
|
9
|
-
const ml_baseline_correction_regression_1 = __importDefault(require("ml-baseline-correction-regression"));
|
|
10
|
-
exports.id = 'baselineCorrection';
|
|
11
|
-
exports.name = 'Baseline correction';
|
|
12
|
-
exports.DOMAIN_UPDATE_RULES = {
|
|
13
|
-
updateXDomain: false,
|
|
14
|
-
updateYDomain: true,
|
|
15
|
-
};
|
|
16
|
-
function apply(datum1D, options) {
|
|
17
|
-
if (!isApplicable(datum1D)) {
|
|
18
|
-
throw new Error('baselineCorrection not applicable on this data');
|
|
19
|
-
}
|
|
20
|
-
const { algorithm } = options;
|
|
21
|
-
let { x, re } = datum1D.data;
|
|
22
|
-
let corrected;
|
|
23
|
-
switch (algorithm) {
|
|
24
|
-
case 'airpls':
|
|
25
|
-
corrected = (0, ml_airpls_1.default)(x, re, options).corrected;
|
|
26
|
-
break;
|
|
27
|
-
case 'polynomial':
|
|
28
|
-
{
|
|
29
|
-
const { degree, zones } = options;
|
|
30
|
-
let reduced = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { numberOfPoints: 4096, zones });
|
|
31
|
-
let result = (0, ml_baseline_correction_regression_1.default)(reduced.x, reduced.y, {
|
|
32
|
-
regressionOptions: degree,
|
|
33
|
-
});
|
|
34
|
-
let { regression } = result;
|
|
35
|
-
corrected = new Float64Array(x.length);
|
|
36
|
-
for (let i = 0; i < re.length; i++) {
|
|
37
|
-
corrected[i] = re[i] - regression.predict(x[i]);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
break;
|
|
41
|
-
default:
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
43
|
-
throw new Error(`baselineCorrection: algorithm unknown: ${algorithm}`);
|
|
44
|
-
}
|
|
45
|
-
Object.assign(datum1D.data, { re: corrected });
|
|
46
|
-
}
|
|
47
|
-
exports.apply = apply;
|
|
48
|
-
function isApplicable(datum1D) {
|
|
49
|
-
if (!datum1D.info.isFid)
|
|
50
|
-
return true;
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
exports.isApplicable = isApplicable;
|
|
54
|
-
function reduce(previousValue, newValue) {
|
|
55
|
-
return {
|
|
56
|
-
once: true,
|
|
57
|
-
reduce: newValue,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
exports.reduce = reduce;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
|
-
exports.id = 'digitalFilter';
|
|
5
|
-
exports.name = 'Digital filter';
|
|
6
|
-
exports.DOMAIN_UPDATE_RULES = {
|
|
7
|
-
updateXDomain: true,
|
|
8
|
-
updateYDomain: true,
|
|
9
|
-
};
|
|
10
|
-
function apply(spectrum, options = {}) {
|
|
11
|
-
if (!isApplicable(spectrum)) {
|
|
12
|
-
throw new Error('Digital Filter is not applicable on this data');
|
|
13
|
-
}
|
|
14
|
-
let { digitalFilterValue } = options;
|
|
15
|
-
if (!digitalFilterValue) {
|
|
16
|
-
digitalFilterValue = spectrum.info.digitalFilter || 0;
|
|
17
|
-
const filter = spectrum.filters.find((filter) => filter.name === exports.id);
|
|
18
|
-
if (filter) {
|
|
19
|
-
filter.value = { digitalFilterValue };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
let re = new Float64Array(spectrum.data.re);
|
|
23
|
-
let im = new Float64Array(spectrum.data.im);
|
|
24
|
-
let pointsToShift = Math.floor(digitalFilterValue);
|
|
25
|
-
const skip = 0;
|
|
26
|
-
pointsToShift += 0;
|
|
27
|
-
const newRe = new Float64Array(re.length);
|
|
28
|
-
const newIm = new Float64Array(im.length);
|
|
29
|
-
newRe.set(re.slice(pointsToShift));
|
|
30
|
-
newRe.set(re.slice(skip, pointsToShift), re.length - pointsToShift);
|
|
31
|
-
newIm.set(im.slice(pointsToShift));
|
|
32
|
-
newIm.set(im.slice(skip, pointsToShift), im.length - pointsToShift);
|
|
33
|
-
spectrum.data.re = newRe;
|
|
34
|
-
spectrum.data.im = newIm;
|
|
35
|
-
}
|
|
36
|
-
exports.apply = apply;
|
|
37
|
-
function isApplicable(spectrum) {
|
|
38
|
-
if (spectrum.info.isComplex && spectrum.info.isFid) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
exports.isApplicable = isApplicable;
|
|
44
|
-
function reduce() {
|
|
45
|
-
return {
|
|
46
|
-
once: true,
|
|
47
|
-
reduce: undefined,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
exports.reduce = reduce;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
7
|
-
const ml_array_xy_equally_spaced_1 = __importDefault(require("ml-array-xy-equally-spaced"));
|
|
8
|
-
exports.id = 'equallySpaced';
|
|
9
|
-
exports.name = 'Equally spaced';
|
|
10
|
-
/**
|
|
11
|
-
* Equally Spaced
|
|
12
|
-
* **
|
|
13
|
-
* Function that returns a Number array of equally spaced numberOfPoints
|
|
14
|
-
* containing a representation of intensities of the spectra arguments x
|
|
15
|
-
* and y.
|
|
16
|
-
*
|
|
17
|
-
* The options parameter contains an object in the following form:
|
|
18
|
-
* from: starting point
|
|
19
|
-
* to: last point
|
|
20
|
-
* numberOfPoints: number of points between from and to
|
|
21
|
-
* variant: "slot" or "smooth" - smooth is the default option
|
|
22
|
-
*
|
|
23
|
-
* The slot variant consist that each point in the new array is calculated
|
|
24
|
-
* averaging the existing points between the slot that belongs to the current
|
|
25
|
-
* value. The smooth variant is the same but takes the integral of the range
|
|
26
|
-
* of the slot and divide by the step size between two points in the new array.
|
|
27
|
-
*
|
|
28
|
-
* @param {Spectrum1D} spectrum
|
|
29
|
-
* @param {Object} options.from
|
|
30
|
-
* @param {number} options.to
|
|
31
|
-
* @param {number} options.numberOfPoints
|
|
32
|
-
* @param {Array<{from:number;to:number}>} options.exclusions
|
|
33
|
-
*/
|
|
34
|
-
function apply(spectrum, options = {}) {
|
|
35
|
-
if (!isApplicable(spectrum)) {
|
|
36
|
-
throw new Error('Equally Spaced is not applicable on this data');
|
|
37
|
-
}
|
|
38
|
-
const { from, to, numberOfPoints, exclusions } = options;
|
|
39
|
-
const { x, re, im } = spectrum.data;
|
|
40
|
-
const XREdata = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { from, to, numberOfPoints, exclusions });
|
|
41
|
-
spectrum.data.x = XREdata.x;
|
|
42
|
-
spectrum.data.re = XREdata.y;
|
|
43
|
-
if (im) {
|
|
44
|
-
const XIMdata = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { from, to, numberOfPoints, exclusions });
|
|
45
|
-
spectrum.data.im = XIMdata.y;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.apply = apply;
|
|
49
|
-
function isApplicable(spectrum) {
|
|
50
|
-
if (spectrum.info.isComplex && !spectrum.info.isFid)
|
|
51
|
-
return true;
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
exports.isApplicable = isApplicable;
|
|
55
|
-
function reduce() {
|
|
56
|
-
return {
|
|
57
|
-
once: false,
|
|
58
|
-
reduce: null,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
exports.reduce = reduce;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
|
-
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
|
-
exports.id = 'exclusionZones';
|
|
6
|
-
exports.name = 'Exclusion zones';
|
|
7
|
-
exports.DOMAIN_UPDATE_RULES = {
|
|
8
|
-
updateXDomain: false,
|
|
9
|
-
updateYDomain: false,
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {Spectrum1D} spectrum
|
|
14
|
-
*/
|
|
15
|
-
function apply(spectrum, zones = []) {
|
|
16
|
-
if (!isApplicable(spectrum)) {
|
|
17
|
-
throw new Error('Exclusion Zones filter not applicable on this data');
|
|
18
|
-
}
|
|
19
|
-
const { x, re, im } = spectrum.data;
|
|
20
|
-
spectrum.data.re = Float64Array.from((0, ml_spectra_processing_1.xySetYValue)({ x, y: re }, { zones }).y);
|
|
21
|
-
spectrum.data.im = im
|
|
22
|
-
? Float64Array.from((0, ml_spectra_processing_1.xySetYValue)({ x, y: re }, { zones }).y)
|
|
23
|
-
: im;
|
|
24
|
-
}
|
|
25
|
-
exports.apply = apply;
|
|
26
|
-
function isApplicable(spectrum) {
|
|
27
|
-
if (spectrum.info.isFt)
|
|
28
|
-
return true;
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
exports.isApplicable = isApplicable;
|
|
32
|
-
function reduce(previousValue, newValue) {
|
|
33
|
-
return {
|
|
34
|
-
once: true,
|
|
35
|
-
reduce: (0, ml_spectra_processing_1.zonesNormalize)(previousValue.concat(newValue)),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
exports.reduce = reduce;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
|
-
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
|
-
const padDataToNextPowerOfTwo_1 = require("./utils/padDataToNextPowerOfTwo");
|
|
6
|
-
exports.id = 'fft';
|
|
7
|
-
exports.name = 'FFT';
|
|
8
|
-
exports.DOMAIN_UPDATE_RULES = {
|
|
9
|
-
updateXDomain: true,
|
|
10
|
-
updateYDomain: true,
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {Spectrum1D} spectrum
|
|
15
|
-
*/
|
|
16
|
-
function apply(spectrum) {
|
|
17
|
-
if (!isApplicable(spectrum)) {
|
|
18
|
-
throw new Error('fft not applicable on this data');
|
|
19
|
-
}
|
|
20
|
-
checkSameLength(spectrum);
|
|
21
|
-
let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
|
|
22
|
-
const { info: { aqMod }, } = spectrum;
|
|
23
|
-
if (aqMod === 1) {
|
|
24
|
-
removeDCOffset(spectrum, digitalFilterApplied);
|
|
25
|
-
}
|
|
26
|
-
if (!isPowerOfTwo(spectrum.data.x.length)) {
|
|
27
|
-
(0, padDataToNextPowerOfTwo_1.padDataToNextPowerOfTwo)(spectrum, digitalFilterApplied);
|
|
28
|
-
}
|
|
29
|
-
const { data, info } = spectrum;
|
|
30
|
-
Object.assign(data, (0, ml_spectra_processing_1.reimFFT)({
|
|
31
|
-
re: data.re,
|
|
32
|
-
im: data.im,
|
|
33
|
-
}, { applyZeroShift: true }));
|
|
34
|
-
if (digitalFilterApplied) {
|
|
35
|
-
let { digitalFilter = 0 } = info;
|
|
36
|
-
let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
|
|
37
|
-
Object.assign(data, (0, ml_spectra_processing_1.reimPhaseCorrection)(data, 0, -ph1, { reverse: true }));
|
|
38
|
-
}
|
|
39
|
-
data.x = generateXAxis(spectrum);
|
|
40
|
-
spectrum.info = { ...info, isFid: false, isFt: true };
|
|
41
|
-
}
|
|
42
|
-
exports.apply = apply;
|
|
43
|
-
function isApplicable(spectrum) {
|
|
44
|
-
if (spectrum.info.isComplex && spectrum.info.isFid)
|
|
45
|
-
return true;
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
exports.isApplicable = isApplicable;
|
|
49
|
-
function reduce() {
|
|
50
|
-
return {
|
|
51
|
-
once: true,
|
|
52
|
-
reduce: undefined,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.reduce = reduce;
|
|
56
|
-
function generateXAxis(datum1D) {
|
|
57
|
-
const info = datum1D.info;
|
|
58
|
-
const baseFrequency = Number.parseFloat(info.baseFrequency);
|
|
59
|
-
const frequencyOffset = Number.parseFloat(info.frequencyOffset);
|
|
60
|
-
const spectralWidth = Number.parseFloat(info.spectralWidth);
|
|
61
|
-
const offset = frequencyOffset / baseFrequency;
|
|
62
|
-
let spectralHalfWidth = 0.5 * spectralWidth;
|
|
63
|
-
let nbPoints = datum1D.data.x.length;
|
|
64
|
-
let firstPoint = offset - spectralHalfWidth;
|
|
65
|
-
let dx = spectralWidth / (nbPoints - 1);
|
|
66
|
-
const xAxis = new Float64Array(nbPoints);
|
|
67
|
-
for (let i = 0; i < nbPoints; i++) {
|
|
68
|
-
xAxis[i] = firstPoint;
|
|
69
|
-
firstPoint += dx;
|
|
70
|
-
}
|
|
71
|
-
return xAxis;
|
|
72
|
-
}
|
|
73
|
-
function isPowerOfTwo(n) {
|
|
74
|
-
return n !== 0 && (n & (n - 1)) === 0;
|
|
75
|
-
}
|
|
76
|
-
function removeDCOffset(spectrum, digitalFilterApplied) {
|
|
77
|
-
let { digitalFilter = 0 } = digitalFilterApplied ? spectrum.info : {};
|
|
78
|
-
const data = spectrum.data;
|
|
79
|
-
const nbPoints = data.re.length;
|
|
80
|
-
const newRe = new Float64Array(data.re);
|
|
81
|
-
const newIm = new Float64Array(data.im);
|
|
82
|
-
const averageRe = (0, ml_spectra_processing_1.xMean)(data.re.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
|
|
83
|
-
const averageIm = (0, ml_spectra_processing_1.xMean)(data.im.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
|
|
84
|
-
for (let i = digitalFilterApplied ? 0 : digitalFilter; i < nbPoints - digitalFilter; i++) {
|
|
85
|
-
newRe[i] -= averageRe;
|
|
86
|
-
newIm[i] -= averageIm;
|
|
87
|
-
}
|
|
88
|
-
Object.assign(spectrum.data, { re: newRe, im: newIm });
|
|
89
|
-
return spectrum;
|
|
90
|
-
}
|
|
91
|
-
function checkSameLength(spectrum) {
|
|
92
|
-
const { data } = spectrum;
|
|
93
|
-
if (data.x.length !== data.re.length || data.x.length !== data.im?.length) {
|
|
94
|
-
throw new Error('The length of data should be equal');
|
|
95
|
-
}
|
|
96
|
-
}
|