nmrium 0.34.0 → 0.35.0
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/LinesSeries.js +4 -5
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +5 -7
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +142 -160
- 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 +4 -4
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +11 -0
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +11 -0
- package/lib/component/1d/ranges/Range.d.ts +3 -10
- package/lib/component/1d/ranges/Range.js +30 -45
- package/lib/component/1d/ranges/Ranges.js +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -2
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +2 -2
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +2 -2
- package/lib/component/2d/Chart2D.d.ts +2 -2
- package/lib/component/2d/ft/Contours.js +13 -13
- package/lib/component/2d/ft/FTContainer.d.ts +2 -2
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib/component/2d/zones/Zone.d.ts +2 -2
- package/lib/component/NMRium.d.ts +2 -5
- package/lib/component/NMRium.js +10 -2
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -2
- package/lib/component/assignment/actions/removeAssignment.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +10 -21
- package/lib/component/context/PreferencesContext.js +4 -7
- package/lib/component/elements/Button.d.ts +4 -2
- package/lib/component/elements/Button.js +26 -15
- package/lib/component/elements/Input.js +38 -46
- package/lib/component/elements/NumberInput.d.ts +4 -12
- package/lib/component/elements/NumberInput.js +10 -40
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -4
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +7 -6
- package/lib/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib/component/elements/ReactTable/Style.js +0 -8
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib/component/header/ApodizationOptionsPanel.js +2 -12
- package/lib/component/header/AutoPeakPickingOptionPanel.js +11 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -12
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/PhaseCorrectionPanel.d.ts +2 -0
- package/lib/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +23 -22
- package/lib/component/header/RangesPickingOptionPanel.js +17 -28
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -2
- package/lib/component/header/Zones2DOptionPanel.js +16 -23
- package/lib/component/highlight/index.d.ts +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +2 -3
- package/lib/component/hooks/useFilter.d.ts +1 -1
- package/lib/component/hooks/useSpectraPerNucleus.d.ts +2 -3
- package/lib/component/hooks/useSpectrum.d.ts +2 -3
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/ExportAsJcampModal.d.ts +8 -0
- package/lib/component/modal/ExportAsJcampModal.js +62 -0
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +2 -3
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/PanelNoData.d.ts +6 -0
- package/lib/component/panels/PanelNoData.js +24 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +4 -5
- package/lib/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -4
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +6 -5
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +37 -33
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +8 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- 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/SpectraPanelHeader.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +65 -17
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.d.ts +2 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -13
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +77 -7
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +17 -9
- package/lib/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +0 -1
- package/lib/component/reducer/Reducer.d.ts +4 -960
- package/lib/component/reducer/Reducer.js +3 -7
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +5 -6
- package/lib/component/reducer/actions/DomainActions.js +17 -11
- package/lib/component/reducer/actions/FiltersActions.d.ts +14 -19
- package/lib/component/reducer/actions/FiltersActions.js +257 -152
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -3
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -1
- package/lib/component/reducer/actions/PeaksActions.js +6 -2
- package/lib/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +19 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +15 -13
- package/lib/component/reducer/actions/ToolsActions.d.ts +6 -2
- package/lib/component/reducer/actions/ToolsActions.js +41 -38
- package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +7 -3
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -4843
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib/component/reducer/types/Types.d.ts +0 -2
- package/lib/component/reducer/types/Types.js +0 -2
- package/lib/component/toolbar/BasicToolBar.js +3 -3
- package/lib/component/toolbar/FunctionToolBar.js +2 -2
- package/lib/component/toolbar/ToolTypes.d.ts +1 -2
- package/lib/component/toolbar/ToolTypes.js +13 -13
- package/lib/component/utility/getSpectraByNucleus.d.ts +2 -3
- package/lib/component/utility/getSpectraObjectPaths.d.ts +2 -3
- package/lib/component/workspaces/Workspace.d.ts +1 -0
- package/lib/component/workspaces/assignment.js +1 -1
- package/lib/component/workspaces/basic.js +1 -1
- package/lib/component/workspaces/embedded.js +1 -1
- package/lib/component/workspaces/exercise.js +1 -1
- package/lib/component/workspaces/prediction.js +1 -1
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +0 -4
- package/lib/data/Filters.js +0 -4
- package/lib/data/FiltersManager.d.ts +17 -5
- package/lib/data/FiltersManager.js +21 -14
- package/lib/data/PredictionManager.d.ts +2 -3
- package/lib/data/SpectraManager.d.ts +11 -0
- package/lib/data/SpectraManager.js +47 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +3 -4
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/isSpectrum1D.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +8 -9
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +10 -9
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib/data/data1d/filter1d/apodization.d.ts +8 -6
- package/lib/data/data1d/filter1d/apodization.js +4 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +6 -4
- package/lib/data/data1d/filter1d/baselineCorrection.js +4 -0
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +7 -6
- package/lib/data/data1d/filter1d/digitalFilter.js +15 -11
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +5 -5
- package/lib/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +7 -5
- package/lib/data/data1d/filter1d/exclusionZones.js +13 -9
- package/lib/data/data1d/filter1d/fft.d.ts +6 -4
- package/lib/data/data1d/filter1d/fft.js +27 -23
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +6 -5
- package/lib/data/data1d/filter1d/phaseCorrection.js +22 -17
- package/lib/data/data1d/filter1d/shiftX.d.ts +5 -3
- package/lib/data/data1d/filter1d/shiftX.js +7 -3
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +7 -5
- package/lib/data/data1d/filter1d/signalProcessing.js +15 -11
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +7 -6
- package/lib/data/data1d/filter1d/zeroFilling.js +15 -11
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +4 -5
- package/lib/data/data2d/Spectrum2D/contours.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/getShift.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +4 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +4 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib/data/data2d/Spectrum2D/zones/updateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib/data/data2d/filter2d/shiftX.d.ts +6 -4
- package/lib/data/data2d/filter2d/shiftX.js +10 -6
- package/lib/data/data2d/filter2d/shiftY.d.ts +5 -3
- package/lib/data/data2d/filter2d/shiftY.js +5 -1
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +2 -2
- package/lib/data/parseMeta/linkMetaWithSpectra.d.ts +2 -3
- package/lib/data/types/common/Info.d.ts +1 -0
- package/lib/data/types/data1d/ComplexData1D.d.ts +1 -1
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/types/data1d/index.d.ts +0 -11
- package/lib/data/types/data2d/index.d.ts +0 -7
- package/lib/data/utilities/FindUtilities.d.ts +7 -9
- package/lib/data/utilities/RangeUtilities.d.ts +7 -2
- package/lib/data/utilities/RangeUtilities.js +9 -16
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.js +6 -6
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -3
- package/lib/data/utilities/convertSpectraListToObject.d.ts +2 -3
- package/lib/data/utilities/generateColor.d.ts +1 -1
- package/lib/types/NMRiumDataReturn.d.ts +2 -3
- package/lib/types/NMRiumToolBarPreferences.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +4 -5
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +144 -160
- package/lib-cjs/component/1d/ranges/AssignmentActionsButtons.js +18 -0
- package/lib-cjs/component/1d/ranges/Range.js +29 -44
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/2d/ft/Contours.js +13 -13
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib-cjs/component/NMRium.js +10 -2
- package/lib-cjs/component/assignment/actions/removeAssignment.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +4 -7
- package/lib-cjs/component/elements/Button.js +26 -15
- package/lib-cjs/component/elements/Input.js +37 -45
- package/lib-cjs/component/elements/NumberInput.js +8 -38
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib-cjs/component/elements/ReactTable/Style.js +0 -8
- package/lib-cjs/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +1 -11
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +33 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +1 -11
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +24 -23
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +38 -26
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +0 -1
- package/lib-cjs/component/header/Zones2DOptionPanel.js +37 -21
- package/lib-cjs/component/modal/ExportAsJcampModal.js +67 -0
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/PanelNoData.js +28 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +15 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +36 -32
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +12 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +63 -15
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -12
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +76 -6
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +15 -7
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
- package/lib-cjs/component/reducer/Reducer.js +3 -7
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +17 -11
- package/lib-cjs/component/reducer/actions/FiltersActions.js +257 -153
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/PeaksActions.js +6 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib-cjs/component/reducer/actions/RangesActions.js +19 -11
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +13 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +38 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +7 -3
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib-cjs/component/reducer/types/Types.js +2 -4
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -3
- package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -2
- package/lib-cjs/component/toolbar/ToolTypes.js +13 -13
- package/lib-cjs/component/workspaces/assignment.js +1 -1
- package/lib-cjs/component/workspaces/basic.js +1 -1
- package/lib-cjs/component/workspaces/embedded.js +1 -1
- package/lib-cjs/component/workspaces/exercise.js +1 -1
- package/lib-cjs/component/workspaces/prediction.js +1 -1
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +1 -5
- package/lib-cjs/data/FiltersManager.js +22 -14
- package/lib-cjs/data/SpectraManager.js +48 -5
- package/lib-cjs/data/data1d/Spectrum1D/get1DDataXY.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/filter1d/apodization.js +5 -1
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +5 -1
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +16 -12
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +14 -10
- package/lib-cjs/data/data1d/filter1d/fft.js +27 -23
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +23 -18
- package/lib-cjs/data/data1d/filter1d/shiftX.js +8 -4
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +16 -12
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +16 -12
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib-cjs/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib-cjs/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib-cjs/data/data2d/filter2d/shiftX.js +11 -7
- package/lib-cjs/data/data2d/filter2d/shiftY.js +6 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +2 -2
- package/lib-cjs/data/utilities/RangeUtilities.js +9 -16
- package/lib-cjs/data/utilities/ZoneUtilities.js +6 -6
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +38 -37
- package/lib/component/header/ManualPhaseCorrectionPanel.d.ts +0 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +0 -13
- package/lib/data/data1d/filter1d/centerMean.js +0 -37
- package/lib/data/data1d/filter1d/fromTo.d.ts +0 -13
- package/lib/data/data1d/filter1d/fromTo.js +0 -31
- package/lib/data/data1d/filter1d/pareto.d.ts +0 -13
- package/lib/data/data1d/filter1d/pareto.js +0 -29
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +0 -13
- package/lib/data/data1d/filter1d/standardDeviation.js +0 -37
- package/lib/data/types/data1d/Data1D.d.ts +0 -5
- package/lib/data/types/data1d/Data1D.js +0 -1
- package/lib/data/types/data1d/Datum1D.d.ts +0 -23
- package/lib/data/types/data1d/Datum1D.js +0 -1
- package/lib/data/types/data1d/Display1D.d.ts +0 -5
- package/lib/data/types/data1d/Display1D.js +0 -1
- package/lib/data/types/data1d/Info1D.d.ts +0 -8
- package/lib/data/types/data1d/Info1D.js +0 -1
- package/lib/data/types/data1d/Integral.d.ts +0 -10
- package/lib/data/types/data1d/Integral.js +0 -1
- package/lib/data/types/data1d/Integrals.d.ts +0 -6
- package/lib/data/types/data1d/Integrals.js +0 -1
- package/lib/data/types/data1d/Peak.d.ts +0 -5
- package/lib/data/types/data1d/Peak.js +0 -1
- package/lib/data/types/data1d/Peaks.d.ts +0 -5
- package/lib/data/types/data1d/Peaks.js +0 -1
- package/lib/data/types/data1d/Range.d.ts +0 -11
- package/lib/data/types/data1d/Range.js +0 -1
- package/lib/data/types/data1d/Ranges.d.ts +0 -6
- package/lib/data/types/data1d/Ranges.js +0 -1
- package/lib/data/types/data1d/Signal1D.d.ts +0 -5
- package/lib/data/types/data1d/Signal1D.js +0 -1
- package/lib/data/types/data1d/SumOptions.d.ts +0 -7
- package/lib/data/types/data1d/SumOptions.js +0 -1
- package/lib/data/types/data2d/Data2D.d.ts +0 -20
- package/lib/data/types/data2d/Data2D.js +0 -1
- package/lib/data/types/data2d/Datum2D.d.ts +0 -19
- package/lib/data/types/data2d/Datum2D.js +0 -1
- package/lib/data/types/data2d/Display2D.d.ts +0 -11
- package/lib/data/types/data2d/Display2D.js +0 -1
- package/lib/data/types/data2d/Info2D.d.ts +0 -5
- package/lib/data/types/data2d/Info2D.js +0 -1
- package/lib/data/types/data2d/Signal2D.d.ts +0 -7
- package/lib/data/types/data2d/Signal2D.js +0 -1
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +0 -4
- package/lib/data/types/data2d/Signal2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zone.d.ts +0 -9
- package/lib/data/types/data2d/Zone.js +0 -1
- package/lib/data/types/data2d/Zone2DAxisData.d.ts +0 -6
- package/lib/data/types/data2d/Zone2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zones.d.ts +0 -7
- package/lib/data/types/data2d/Zones.js +0 -1
- package/lib-cjs/data/data1d/filter1d/centerMean.js +0 -43
- package/lib-cjs/data/data1d/filter1d/fromTo.js +0 -37
- package/lib-cjs/data/data1d/filter1d/pareto.js +0 -35
- package/lib-cjs/data/data1d/filter1d/standardDeviation.js +0 -43
- package/lib-cjs/data/types/data1d/Data1D.js +0 -2
- package/lib-cjs/data/types/data1d/Datum1D.js +0 -2
- package/lib-cjs/data/types/data1d/Display1D.js +0 -2
- package/lib-cjs/data/types/data1d/Info1D.js +0 -2
- package/lib-cjs/data/types/data1d/Integral.js +0 -2
- package/lib-cjs/data/types/data1d/Integrals.js +0 -2
- package/lib-cjs/data/types/data1d/Peak.js +0 -2
- package/lib-cjs/data/types/data1d/Peaks.js +0 -2
- package/lib-cjs/data/types/data1d/Range.js +0 -2
- package/lib-cjs/data/types/data1d/Ranges.js +0 -2
- package/lib-cjs/data/types/data1d/Signal1D.js +0 -2
- package/lib-cjs/data/types/data1d/SumOptions.js +0 -2
- package/lib-cjs/data/types/data2d/Data2D.js +0 -2
- package/lib-cjs/data/types/data2d/Datum2D.js +0 -2
- package/lib-cjs/data/types/data2d/Display2D.js +0 -2
- package/lib-cjs/data/types/data2d/Info2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zone.js +0 -2
- package/lib-cjs/data/types/data2d/Zone2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zones.js +0 -2
|
@@ -8,15 +8,15 @@ const SumManager_1 = require("../SumManager");
|
|
|
8
8
|
const autoRangesDetection_1 = __importDefault(require("./autoRangesDetection"));
|
|
9
9
|
const mapRanges_1 = require("./mapRanges");
|
|
10
10
|
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
11
|
-
function detectRanges(
|
|
11
|
+
function detectRanges(spectrum, options) {
|
|
12
12
|
const { molecules, nucleus, ...detectOptions } = options;
|
|
13
|
-
detectOptions.impurities = { solvent:
|
|
14
|
-
const ranges = (0, autoRangesDetection_1.default)(
|
|
15
|
-
|
|
13
|
+
detectOptions.impurities = { solvent: spectrum.info.solvent || '' };
|
|
14
|
+
const ranges = (0, autoRangesDetection_1.default)(spectrum, detectOptions);
|
|
15
|
+
spectrum.ranges.options = (0, SumManager_1.initSumOptions)(spectrum.ranges.options, {
|
|
16
16
|
molecules,
|
|
17
17
|
nucleus,
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(
|
|
19
|
+
spectrum.ranges.values = spectrum.ranges.values.concat((0, mapRanges_1.mapRanges)(ranges, spectrum));
|
|
20
|
+
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(spectrum);
|
|
21
21
|
}
|
|
22
22
|
exports.detectRanges = detectRanges;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.initiateRanges = void 0;
|
|
7
7
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
8
|
const mapRanges_1 = require("./mapRanges");
|
|
9
|
-
function initiateRanges(options,
|
|
9
|
+
function initiateRanges(options, spectrum) {
|
|
10
10
|
return (0, merge_1.default)({
|
|
11
11
|
values: [],
|
|
12
12
|
options: {
|
|
@@ -15,7 +15,7 @@ function initiateRanges(options, datum) {
|
|
|
15
15
|
sumAuto: true,
|
|
16
16
|
},
|
|
17
17
|
}, options.ranges, {
|
|
18
|
-
values: (0, mapRanges_1.mapRanges)(options?.ranges?.values || [],
|
|
18
|
+
values: (0, mapRanges_1.mapRanges)(options?.ranges?.values || [], spectrum),
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
exports.initiateRanges = initiateRanges;
|
|
@@ -6,9 +6,9 @@ const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
|
6
6
|
const SignalsKinds_1 = require("../../../constants/SignalsKinds");
|
|
7
7
|
const getShiftX_1 = require("../getShiftX");
|
|
8
8
|
const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
|
|
9
|
-
function checkRange(range,
|
|
9
|
+
function checkRange(range, spectrum, error) {
|
|
10
10
|
// check if the range is already exists
|
|
11
|
-
for (const { from, to } of
|
|
11
|
+
for (const { from, to } of spectrum.ranges?.values || []) {
|
|
12
12
|
if (Math.abs(range.from - from) < error &&
|
|
13
13
|
Math.abs(range.to - to) < error) {
|
|
14
14
|
return true;
|
|
@@ -49,13 +49,13 @@ function getSignalDelta(signal, shiftTarget, shift) {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function mapRanges(ranges,
|
|
52
|
+
function mapRanges(ranges, spectrum, options = {}) {
|
|
53
53
|
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
54
|
-
const { x, re } =
|
|
55
|
-
const shiftX = (0, getShiftX_1.getShiftX)(
|
|
56
|
-
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(
|
|
54
|
+
const { x, re } = spectrum.data;
|
|
55
|
+
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
56
|
+
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
|
|
57
57
|
if (checkIsExisting) {
|
|
58
|
-
ranges = ranges.filter((r) => (checkIsExisting && !checkRange(r,
|
|
58
|
+
ranges = ranges.filter((r) => (checkIsExisting && !checkRange(r, spectrum, error)) || r.id === 'new');
|
|
59
59
|
}
|
|
60
60
|
return ranges.map((range) => {
|
|
61
61
|
const rangeBoundary = getRange(range, shiftTarget, shiftX);
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateRanges = void 0;
|
|
4
4
|
const mapRanges_1 = require("./mapRanges");
|
|
5
5
|
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
6
|
-
function updateRanges(
|
|
7
|
-
|
|
6
|
+
function updateRanges(spectrum) {
|
|
7
|
+
spectrum.ranges.values = (0, mapRanges_1.mapRanges)(spectrum.ranges.values, spectrum, {
|
|
8
8
|
checkIsExisting: false,
|
|
9
9
|
shiftTarget: 'current',
|
|
10
10
|
});
|
|
11
|
-
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(
|
|
11
|
+
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(spectrum, true);
|
|
12
12
|
}
|
|
13
13
|
exports.updateRanges = updateRanges;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateRangesRelativeValues = void 0;
|
|
4
4
|
const updateRelatives_1 = require("../integrals/updateRelatives");
|
|
5
5
|
const checkRangeKind_1 = require("./checkRangeKind");
|
|
6
|
-
function updateRangesRelativeValues(
|
|
7
|
-
(0, updateRelatives_1.updateRelatives)(
|
|
6
|
+
function updateRangesRelativeValues(spectrum, forceCalculateIntegral = false) {
|
|
7
|
+
(0, updateRelatives_1.updateRelatives)(spectrum.ranges, 'integration', checkRangeKind_1.checkRangeKind, forceCalculateIntegral);
|
|
8
8
|
}
|
|
9
9
|
exports.updateRangesRelativeValues = updateRangesRelativeValues;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apodizationFilter = exports.reduce = exports.isApplicable = exports.apply = exports.defaultApodizationOptions = exports.name = exports.id = void 0;
|
|
3
|
+
exports.apodizationFilter = exports.reduce = exports.isApplicable = exports.apply = exports.defaultApodizationOptions = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
4
|
const nmr_processing_1 = require("nmr-processing");
|
|
5
5
|
exports.id = 'apodization';
|
|
6
6
|
exports.name = 'Apodization';
|
|
7
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
8
|
+
updateXDomain: true,
|
|
9
|
+
updateYDomain: false,
|
|
10
|
+
};
|
|
7
11
|
exports.defaultApodizationOptions = {
|
|
8
12
|
lineBroadening: 1,
|
|
9
13
|
gaussBroadening: 0,
|
|
@@ -3,12 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
6
|
+
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
7
7
|
const ml_airpls_1 = __importDefault(require("ml-airpls"));
|
|
8
8
|
const ml_array_xy_equally_spaced_1 = __importDefault(require("ml-array-xy-equally-spaced"));
|
|
9
9
|
const ml_baseline_correction_regression_1 = __importDefault(require("ml-baseline-correction-regression"));
|
|
10
10
|
exports.id = 'baselineCorrection';
|
|
11
11
|
exports.name = 'Baseline correction';
|
|
12
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
13
|
+
updateXDomain: false,
|
|
14
|
+
updateYDomain: true,
|
|
15
|
+
};
|
|
12
16
|
function apply(datum1D, options) {
|
|
13
17
|
if (!isApplicable(datum1D)) {
|
|
14
18
|
throw new Error('baselineCorrection not applicable on this data');
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
3
|
+
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
4
|
exports.id = 'digitalFilter';
|
|
5
|
-
exports.name = 'Digital
|
|
6
|
-
|
|
7
|
-
|
|
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)) {
|
|
8
12
|
throw new Error('Digital Filter is not applicable on this data');
|
|
9
13
|
}
|
|
10
14
|
let { digitalFilterValue } = options;
|
|
11
15
|
if (!digitalFilterValue) {
|
|
12
|
-
digitalFilterValue =
|
|
13
|
-
const filter =
|
|
16
|
+
digitalFilterValue = spectrum.info.digitalFilter || 0;
|
|
17
|
+
const filter = spectrum.filters.find((filter) => filter.name === exports.id);
|
|
14
18
|
if (filter) {
|
|
15
19
|
filter.value = { digitalFilterValue };
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
|
-
let re = new Float64Array(
|
|
19
|
-
let im = new Float64Array(
|
|
22
|
+
let re = new Float64Array(spectrum.data.re);
|
|
23
|
+
let im = new Float64Array(spectrum.data.im);
|
|
20
24
|
let pointsToShift = Math.floor(digitalFilterValue);
|
|
21
25
|
const skip = 0;
|
|
22
26
|
pointsToShift += 0;
|
|
@@ -26,12 +30,12 @@ function apply(datum1D, options = {}) {
|
|
|
26
30
|
newRe.set(re.slice(skip, pointsToShift), re.length - pointsToShift);
|
|
27
31
|
newIm.set(im.slice(pointsToShift));
|
|
28
32
|
newIm.set(im.slice(skip, pointsToShift), im.length - pointsToShift);
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
spectrum.data.re = newRe;
|
|
34
|
+
spectrum.data.im = newIm;
|
|
31
35
|
}
|
|
32
36
|
exports.apply = apply;
|
|
33
|
-
function isApplicable(
|
|
34
|
-
if (
|
|
37
|
+
function isApplicable(spectrum) {
|
|
38
|
+
if (spectrum.info.isComplex && spectrum.info.isFid) {
|
|
35
39
|
return true;
|
|
36
40
|
}
|
|
37
41
|
return false;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
7
7
|
const ml_array_xy_equally_spaced_1 = __importDefault(require("ml-array-xy-equally-spaced"));
|
|
8
8
|
exports.id = 'equallySpaced';
|
|
9
|
-
exports.name = 'Equally
|
|
9
|
+
exports.name = 'Equally spaced';
|
|
10
10
|
/**
|
|
11
11
|
* Equally Spaced
|
|
12
12
|
* **
|
|
@@ -25,29 +25,29 @@ exports.name = 'Equally Spaced';
|
|
|
25
25
|
* value. The smooth variant is the same but takes the integral of the range
|
|
26
26
|
* of the slot and divide by the step size between two points in the new array.
|
|
27
27
|
*
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {Spectrum1D} spectrum
|
|
29
29
|
* @param {Object} options.from
|
|
30
30
|
* @param {number} options.to
|
|
31
31
|
* @param {number} options.numberOfPoints
|
|
32
32
|
* @param {Array<{from:number;to:number}>} options.exclusions
|
|
33
33
|
*/
|
|
34
|
-
function apply(
|
|
35
|
-
if (!isApplicable(
|
|
34
|
+
function apply(spectrum, options = {}) {
|
|
35
|
+
if (!isApplicable(spectrum)) {
|
|
36
36
|
throw new Error('Equally Spaced is not applicable on this data');
|
|
37
37
|
}
|
|
38
38
|
const { from, to, numberOfPoints, exclusions } = options;
|
|
39
|
-
const { x, re, im } =
|
|
39
|
+
const { x, re, im } = spectrum.data;
|
|
40
40
|
const XREdata = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { from, to, numberOfPoints, exclusions });
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
spectrum.data.x = XREdata.x;
|
|
42
|
+
spectrum.data.re = XREdata.y;
|
|
43
43
|
if (im) {
|
|
44
44
|
const XIMdata = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { from, to, numberOfPoints, exclusions });
|
|
45
|
-
|
|
45
|
+
spectrum.data.im = XIMdata.y;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.apply = apply;
|
|
49
|
-
function isApplicable(
|
|
50
|
-
if (
|
|
49
|
+
function isApplicable(spectrum) {
|
|
50
|
+
if (spectrum.info.isComplex && !spectrum.info.isFid)
|
|
51
51
|
return true;
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
3
|
+
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
4
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
5
|
exports.id = 'exclusionZones';
|
|
6
|
-
exports.name = 'Exclusion
|
|
6
|
+
exports.name = 'Exclusion zones';
|
|
7
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
8
|
+
updateXDomain: false,
|
|
9
|
+
updateYDomain: false,
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
*
|
|
9
|
-
* @param {
|
|
13
|
+
* @param {Spectrum1D} spectrum
|
|
10
14
|
*/
|
|
11
|
-
function apply(
|
|
12
|
-
if (!isApplicable(
|
|
15
|
+
function apply(spectrum, zones = []) {
|
|
16
|
+
if (!isApplicable(spectrum)) {
|
|
13
17
|
throw new Error('Exclusion Zones filter not applicable on this data');
|
|
14
18
|
}
|
|
15
|
-
const { x, re, im } =
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
18
22
|
? Float64Array.from((0, ml_spectra_processing_1.xySetYValue)({ x, y: re }, { zones }).y)
|
|
19
23
|
: im;
|
|
20
24
|
}
|
|
21
25
|
exports.apply = apply;
|
|
22
|
-
function isApplicable(
|
|
23
|
-
if (
|
|
26
|
+
function isApplicable(spectrum) {
|
|
27
|
+
if (spectrum.info.isFt)
|
|
24
28
|
return true;
|
|
25
29
|
return false;
|
|
26
30
|
}
|
|
@@ -1,45 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
3
|
+
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
4
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
5
|
const padDataToNextPowerOfTwo_1 = require("./utils/padDataToNextPowerOfTwo");
|
|
6
6
|
exports.id = 'fft';
|
|
7
7
|
exports.name = 'FFT';
|
|
8
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
9
|
+
updateXDomain: true,
|
|
10
|
+
updateYDomain: true,
|
|
11
|
+
};
|
|
8
12
|
/**
|
|
9
13
|
*
|
|
10
|
-
* @param {
|
|
14
|
+
* @param {Spectrum1D} spectrum
|
|
11
15
|
*/
|
|
12
|
-
function apply(
|
|
13
|
-
if (!isApplicable(
|
|
16
|
+
function apply(spectrum) {
|
|
17
|
+
if (!isApplicable(spectrum)) {
|
|
14
18
|
throw new Error('fft not applicable on this data');
|
|
15
19
|
}
|
|
16
|
-
checkSameLength(
|
|
17
|
-
let digitalFilterApplied =
|
|
18
|
-
const { meta: { AQ_mod: aqMod }, } =
|
|
20
|
+
checkSameLength(spectrum);
|
|
21
|
+
let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
|
|
22
|
+
const { meta: { AQ_mod: aqMod }, } = spectrum;
|
|
19
23
|
if (aqMod === 1) {
|
|
20
|
-
removeDCOffset(
|
|
24
|
+
removeDCOffset(spectrum, digitalFilterApplied);
|
|
21
25
|
}
|
|
22
|
-
if (!isPowerOfTwo(
|
|
23
|
-
(0, padDataToNextPowerOfTwo_1.padDataToNextPowerOfTwo)(
|
|
26
|
+
if (!isPowerOfTwo(spectrum.data.x.length)) {
|
|
27
|
+
(0, padDataToNextPowerOfTwo_1.padDataToNextPowerOfTwo)(spectrum, digitalFilterApplied);
|
|
24
28
|
}
|
|
25
|
-
const { data, info } =
|
|
29
|
+
const { data, info } = spectrum;
|
|
26
30
|
Object.assign(data, (0, ml_spectra_processing_1.reimFFT)(data, { applyZeroShift: true }));
|
|
27
31
|
if (digitalFilterApplied) {
|
|
28
32
|
let { digitalFilter = 0 } = info;
|
|
29
33
|
let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
|
|
30
|
-
Object.assign(data, (0, ml_spectra_processing_1.reimPhaseCorrection)(data, 0, ph1));
|
|
34
|
+
Object.assign(data, (0, ml_spectra_processing_1.reimPhaseCorrection)(data, 0, -ph1, { reverse: true }));
|
|
31
35
|
}
|
|
32
|
-
data.x = generateXAxis(
|
|
36
|
+
data.x = generateXAxis(spectrum);
|
|
33
37
|
if (info?.reverse?.[0]) {
|
|
34
38
|
data.re.reverse();
|
|
35
39
|
data.im.reverse();
|
|
36
40
|
}
|
|
37
41
|
// Object.assign(datum1D.data, data);
|
|
38
|
-
|
|
42
|
+
spectrum.info = { ...info, isFid: false, isFt: true };
|
|
39
43
|
}
|
|
40
44
|
exports.apply = apply;
|
|
41
|
-
function isApplicable(
|
|
42
|
-
if (
|
|
45
|
+
function isApplicable(spectrum) {
|
|
46
|
+
if (spectrum.info.isComplex && spectrum.info.isFid)
|
|
43
47
|
return true;
|
|
44
48
|
return false;
|
|
45
49
|
}
|
|
@@ -71,9 +75,9 @@ function generateXAxis(datum1D) {
|
|
|
71
75
|
function isPowerOfTwo(n) {
|
|
72
76
|
return n !== 0 && (n & (n - 1)) === 0;
|
|
73
77
|
}
|
|
74
|
-
function removeDCOffset(
|
|
75
|
-
let { digitalFilter = 0 } = digitalFilterApplied ?
|
|
76
|
-
const data =
|
|
78
|
+
function removeDCOffset(spectrum, digitalFilterApplied) {
|
|
79
|
+
let { digitalFilter = 0 } = digitalFilterApplied ? spectrum.info : {};
|
|
80
|
+
const data = spectrum.data;
|
|
77
81
|
const nbPoints = data.re.length;
|
|
78
82
|
const newRe = new Float64Array(data.re);
|
|
79
83
|
const newIm = new Float64Array(data.im);
|
|
@@ -83,11 +87,11 @@ function removeDCOffset(datum1D, digitalFilterApplied) {
|
|
|
83
87
|
newRe[i] -= averageRe;
|
|
84
88
|
newIm[i] -= averageIm;
|
|
85
89
|
}
|
|
86
|
-
Object.assign(
|
|
87
|
-
return
|
|
90
|
+
Object.assign(spectrum.data, { re: newRe, im: newIm });
|
|
91
|
+
return spectrum;
|
|
88
92
|
}
|
|
89
|
-
function checkSameLength(
|
|
90
|
-
const { data } =
|
|
93
|
+
function checkSameLength(spectrum) {
|
|
94
|
+
const { data } = spectrum;
|
|
91
95
|
if (data.x.length !== data.re.length || data.x.length !== data.im?.length) {
|
|
92
96
|
throw new Error('The length of data should be equal');
|
|
93
97
|
}
|
|
@@ -1,40 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
3
|
+
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
4
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
5
|
exports.id = 'phaseCorrection';
|
|
6
6
|
exports.name = 'Phase correction';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
8
|
+
updateXDomain: false,
|
|
9
|
+
updateYDomain: false,
|
|
10
|
+
};
|
|
11
|
+
function apply(spectrum, options) {
|
|
12
|
+
if (!isApplicable(spectrum)) {
|
|
9
13
|
throw new Error('phaseCorrection not applicable on this data');
|
|
10
14
|
}
|
|
11
15
|
const { absolute = false } = options;
|
|
12
|
-
const filter =
|
|
16
|
+
const filter = spectrum.filters?.find((filter) => filter.name === exports.id);
|
|
13
17
|
if (absolute) {
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
spectrum.data.re = (0, ml_spectra_processing_1.reimAbsolute)(spectrum.data);
|
|
19
|
+
spectrum.data.im = new Float64Array(0);
|
|
16
20
|
if (filter) {
|
|
17
21
|
filter.value = { ...filter.value, ph0: 0, ph1: 0, absolute };
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
else if ('ph0' in options && 'ph1' in options) {
|
|
21
25
|
let { ph0, ph1 } = options;
|
|
22
|
-
phaseCorrection(
|
|
26
|
+
phaseCorrection(spectrum, { ph0, ph1 });
|
|
23
27
|
if (filter) {
|
|
24
28
|
filter.value = { ...filter.value, absolute };
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
else {
|
|
28
|
-
let { ph0, ph1 } = autoPhaseCorrection(
|
|
29
|
-
phaseCorrection(
|
|
32
|
+
let { ph0, ph1 } = autoPhaseCorrection(spectrum);
|
|
33
|
+
phaseCorrection(spectrum, { ph0, ph1 });
|
|
30
34
|
if (filter) {
|
|
31
35
|
filter.value = { ...filter.value, absolute, ph0, ph1 };
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
exports.apply = apply;
|
|
36
|
-
function isApplicable(
|
|
37
|
-
if (
|
|
40
|
+
function isApplicable(spectrum) {
|
|
41
|
+
if (spectrum.info.isComplex && !spectrum.info.isFid)
|
|
38
42
|
return true;
|
|
39
43
|
return false;
|
|
40
44
|
}
|
|
@@ -46,20 +50,21 @@ function reduce(previousValue, newValue) {
|
|
|
46
50
|
};
|
|
47
51
|
}
|
|
48
52
|
exports.reduce = reduce;
|
|
49
|
-
function phaseCorrection(
|
|
53
|
+
function phaseCorrection(spectrum, { ph0, ph1 }) {
|
|
50
54
|
ph0 *= Math.PI / 180;
|
|
51
55
|
ph1 *= Math.PI / 180;
|
|
52
|
-
|
|
53
|
-
...
|
|
54
|
-
...(0, ml_spectra_processing_1.reimPhaseCorrection)(
|
|
56
|
+
spectrum.data = {
|
|
57
|
+
...spectrum.data,
|
|
58
|
+
...(0, ml_spectra_processing_1.reimPhaseCorrection)(spectrum.data, ph0, ph1, { reverse: true }),
|
|
55
59
|
};
|
|
56
60
|
}
|
|
57
|
-
function autoPhaseCorrection(
|
|
58
|
-
const { minRegSize = 5, maxDistanceToJoin = 128, magnitudeMode = true, factorNoise = 5, } = options;
|
|
59
|
-
return (0, ml_spectra_processing_1.reimAutoPhaseCorrection)(
|
|
61
|
+
function autoPhaseCorrection(spectrum, options = {}) {
|
|
62
|
+
const { minRegSize = 5, maxDistanceToJoin = 128, magnitudeMode = true, factorNoise = 5, reverse = true, } = options;
|
|
63
|
+
return (0, ml_spectra_processing_1.reimAutoPhaseCorrection)(spectrum.data, {
|
|
60
64
|
minRegSize,
|
|
61
65
|
maxDistanceToJoin,
|
|
62
66
|
magnitudeMode,
|
|
63
67
|
factorNoise,
|
|
68
|
+
reverse,
|
|
64
69
|
});
|
|
65
70
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
3
|
+
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {Spectrum1D} spectrum
|
|
7
7
|
* @param {number} [shiftValue=0]
|
|
8
8
|
*/
|
|
9
9
|
exports.id = 'shiftX';
|
|
10
10
|
exports.name = 'Shift X';
|
|
11
|
-
|
|
11
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
12
|
+
updateXDomain: true,
|
|
13
|
+
updateYDomain: false,
|
|
14
|
+
};
|
|
15
|
+
function apply(spectrum, options = {}) {
|
|
12
16
|
const { shift = 0 } = options;
|
|
13
|
-
|
|
17
|
+
spectrum.data.x = spectrum.data.x.map((val) => val + shift);
|
|
14
18
|
}
|
|
15
19
|
exports.apply = apply;
|
|
16
20
|
function isApplicable() {
|
|
@@ -23,24 +23,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.filterXY = exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
26
|
+
exports.filterXY = exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
27
27
|
const Filters = __importStar(require("ml-signal-processing"));
|
|
28
28
|
exports.id = 'signalProcessing';
|
|
29
29
|
exports.name = 'Signal processing';
|
|
30
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
31
|
+
updateXDomain: true,
|
|
32
|
+
updateYDomain: true,
|
|
33
|
+
};
|
|
30
34
|
/**
|
|
31
35
|
*
|
|
32
|
-
* @param {
|
|
36
|
+
* @param {Spectrum1D} spectrum
|
|
33
37
|
* @param {MatrixOptions} options
|
|
34
38
|
*/
|
|
35
|
-
function apply(
|
|
36
|
-
if (!isApplicable(
|
|
39
|
+
function apply(spectrum, options) {
|
|
40
|
+
if (!isApplicable(spectrum)) {
|
|
37
41
|
throw new Error('Signal Processing is not applicable on this data');
|
|
38
42
|
}
|
|
39
|
-
|
|
43
|
+
spectrum.data = filterXY(spectrum, options);
|
|
40
44
|
}
|
|
41
45
|
exports.apply = apply;
|
|
42
|
-
function isApplicable(
|
|
43
|
-
if (
|
|
46
|
+
function isApplicable(spectrum) {
|
|
47
|
+
if (spectrum.info.isFt)
|
|
44
48
|
return true;
|
|
45
49
|
return false;
|
|
46
50
|
}
|
|
@@ -56,11 +60,11 @@ exports.reduce = reduce;
|
|
|
56
60
|
* Apply filters on {x:[], y:[]}
|
|
57
61
|
* @returns A very important number
|
|
58
62
|
*/
|
|
59
|
-
function filterXY(
|
|
60
|
-
let x =
|
|
61
|
-
let cloneX =
|
|
62
|
-
let re =
|
|
63
|
-
let im =
|
|
63
|
+
function filterXY(spectrum, options) {
|
|
64
|
+
let x = spectrum.data.x.slice(0);
|
|
65
|
+
let cloneX = spectrum.data.x.slice(0);
|
|
66
|
+
let re = spectrum.data.re.slice(0);
|
|
67
|
+
let im = spectrum.data.im?.slice(0);
|
|
64
68
|
const filters = options.filters.slice();
|
|
65
69
|
const { range: { from, to }, numberOfPoints, exclusionsZones: exclusions, } = options;
|
|
66
70
|
filters.push({
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.padDataToNextPowerOfTwo = void 0;
|
|
4
4
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
|
-
function padDataToNextPowerOfTwo(
|
|
6
|
-
const { x, re, im } =
|
|
5
|
+
function padDataToNextPowerOfTwo(spectrum, digitalFilterApplied) {
|
|
6
|
+
const { x, re, im } = spectrum.data;
|
|
7
7
|
const size = nextPowerOfTwo(x.length);
|
|
8
8
|
let newRE = new Float64Array(size);
|
|
9
9
|
let newIM = new Float64Array(size);
|
|
10
|
-
const pointsToShift = getPointsToShift(
|
|
10
|
+
const pointsToShift = getPointsToShift(spectrum);
|
|
11
11
|
newRE.set(re.slice(0, length - pointsToShift));
|
|
12
12
|
newIM.set(im.slice(0, length - pointsToShift));
|
|
13
13
|
if (pointsToShift > 0 && digitalFilterApplied) {
|
|
@@ -19,11 +19,11 @@ function padDataToNextPowerOfTwo(datum1D, digitalFilterApplied) {
|
|
|
19
19
|
size,
|
|
20
20
|
step: x[1] - x[0],
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
spectrum.data = { ...spectrum.data, re: newRE, im: newIM, x: newX };
|
|
23
23
|
}
|
|
24
24
|
exports.padDataToNextPowerOfTwo = padDataToNextPowerOfTwo;
|
|
25
|
-
function getPointsToShift(
|
|
26
|
-
let grpdly =
|
|
25
|
+
function getPointsToShift(spectrum) {
|
|
26
|
+
let grpdly = spectrum.info?.digitalFilter || 0;
|
|
27
27
|
return grpdly > 0 ? Math.floor(grpdly) : 0;
|
|
28
28
|
}
|
|
29
29
|
function nextPowerOfTwo(n) {
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
3
|
+
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
4
|
exports.id = 'zeroFilling';
|
|
5
|
-
exports.name = 'Zero
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
exports.name = 'Zero filling';
|
|
6
|
+
exports.DOMAIN_UPDATE_RULES = {
|
|
7
|
+
updateXDomain: true,
|
|
8
|
+
updateYDomain: false,
|
|
9
|
+
};
|
|
10
|
+
function apply(spectrum, options) {
|
|
11
|
+
if (!isApplicable(spectrum)) {
|
|
8
12
|
throw new Error('zeroFilling not applicable on this data');
|
|
9
13
|
}
|
|
10
14
|
let { nbPoints, factor = 2 } = options;
|
|
11
15
|
if (!nbPoints) {
|
|
12
|
-
nbPoints = 2 ** Math.round(Math.log2(
|
|
13
|
-
const filter =
|
|
16
|
+
nbPoints = 2 ** Math.round(Math.log2(spectrum.data.x.length * factor));
|
|
17
|
+
const filter = spectrum.filters.find((filter) => filter.name === exports.id);
|
|
14
18
|
if (filter) {
|
|
15
19
|
filter.value = { nbPoints };
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
|
-
let digitalFilterApplied =
|
|
19
|
-
let grpdly =
|
|
22
|
+
let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
|
|
23
|
+
let grpdly = spectrum.info?.digitalFilter || 0;
|
|
20
24
|
let pointsToShift;
|
|
21
25
|
if (grpdly > 0 && digitalFilterApplied) {
|
|
22
26
|
pointsToShift = Math.floor(grpdly);
|
|
@@ -24,7 +28,7 @@ function apply(datum1D, options) {
|
|
|
24
28
|
else {
|
|
25
29
|
pointsToShift = 0;
|
|
26
30
|
}
|
|
27
|
-
const { re, im, x } =
|
|
31
|
+
const { re, im = [], x } = spectrum.data;
|
|
28
32
|
let newRE = new Float64Array(nbPoints);
|
|
29
33
|
let newIM = new Float64Array(nbPoints);
|
|
30
34
|
let newX = new Float64Array(nbPoints);
|
|
@@ -42,11 +46,11 @@ function apply(datum1D, options) {
|
|
|
42
46
|
newRE.set(re.slice(re.length - pointsToShift), nbPoints - pointsToShift);
|
|
43
47
|
newIM.set(im.slice(re.length - pointsToShift), nbPoints - pointsToShift);
|
|
44
48
|
}
|
|
45
|
-
|
|
49
|
+
spectrum.data = { ...spectrum.data, re: newRE, im: newIM, x: newX };
|
|
46
50
|
}
|
|
47
51
|
exports.apply = apply;
|
|
48
|
-
function isApplicable(
|
|
49
|
-
if (
|
|
52
|
+
function isApplicable(spectrum) {
|
|
53
|
+
if (spectrum.info.isComplex && spectrum.info.isFid) {
|
|
50
54
|
return true;
|
|
51
55
|
}
|
|
52
56
|
return false;
|