nmr-processing 22.1.0 → 22.3.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.
@@ -97,6 +97,8 @@ import type { SineBellOptions } from '@zakodium/nmr-types';
97
97
  import type { SymmetrizeCosyLikeOptions } from '@zakodium/nmr-types';
98
98
  import type { TopicMolecule } from 'openchemlib-utils';
99
99
  import type { TrafOptions } from '@zakodium/nmr-types';
100
+ import type { TrimFilterOptions } from '@zakodium/nmr-types';
101
+ import type { TrimOptions } from '@zakodium/nmr-types';
100
102
  import type { XRobustDistributionStats } from 'ml-spectra-processing';
101
103
  import type { XYNumber } from 'spectrum-generator';
102
104
  import type { ZeroFillingDimension1Options } from '@zakodium/nmr-types';
@@ -606,7 +608,7 @@ export declare function fftIndirectDimension(data: {
606
608
  im: DoubleArray[] | Matrix;
607
609
  }, options?: IndirectDimensionOptions): Record<string, Matrix>;
608
610
 
609
- export declare type Filter1D = FFT1D | BaselineCorrection1D | BackwardLinearPrediction1D | Apodization1D | DigitalFilter | EquallySpaced | ExclusionZones | ForwardLP1D | PhaseCorrection1D | ShiftX | SignalProcessing | ZeroFilling;
611
+ export declare type Filter1D = FFT1D | BaselineCorrection1D | BackwardLinearPrediction1D | Apodization1D | DigitalFilter | EquallySpaced | ExclusionZones | ForwardLP1D | PhaseCorrection1D | ShiftX | SignalProcessing | Trim | ZeroFilling;
610
612
 
611
613
  export declare type Filter2D = ApodizationDimension1 | ApodizationDimension2 | BaselineCorrection2D | BackwardLPDimension1 | BackwardLPDimension2 | NUSDimension2 | FFTDimension1 | FFTDimension2 | FordwardLPDimension1 | FordwardLPDimension2 | DigitalFilter2D | PhaseCorrection2D | ZeroFillingDimension1 | ZeroFillingDimension2 | SymmetrizeCosyLike | Shift2DX | Shift2DY;
612
614
 
@@ -902,6 +904,18 @@ export declare function getBaselineZonesByDietrich(data: NmrData1D, options?: Ba
902
904
 
903
905
  declare function getBonds(b: BondInput[]): BondOutput[];
904
906
 
907
+ export declare function getColumnFrom(data: Matrix, info: {
908
+ acquisitionScheme?: string;
909
+ reverse?: boolean;
910
+ index: number;
911
+ }): {
912
+ re: number[];
913
+ im: Float64Array<ArrayBuffer>;
914
+ } | {
915
+ re: Float64Array<ArrayBuffer>;
916
+ im: Float64Array<ArrayBuffer>;
917
+ };
918
+
905
919
  declare function getCouplingGroups(cg: CouplingGroupInput[]): {
906
920
  id: string;
907
921
  parentID: string;
@@ -2515,6 +2529,41 @@ declare interface Traf<ShapeOption = TrafOptions> {
2515
2529
  */
2516
2530
  export declare function translateMultiplet(name: string): string;
2517
2531
 
2532
+ declare type Trim = FilterFactory<Entry1D, TrimOptions> & Pick<TrimFilterOptions, 'name'>;
2533
+
2534
+ export declare interface TrimApplyOptions {
2535
+ /**
2536
+ * Percentage (0-100) of points to trim from the low side. If undefined, no percentage-based trimming is applied to the low.
2537
+ * @default undefined
2538
+ */
2539
+ lowPercentage?: number;
2540
+ /**
2541
+ * Percentage (0-100) of points to trim from the high side. If undefined, no percentage-based trimming is applied to the high.
2542
+ * @default undefined
2543
+ */
2544
+ highPercentage?: number;
2545
+ /**
2546
+ * Value of the leftmost point to keep. If set, all points to the low of this value are trimmed.
2547
+ * @default undefined
2548
+ */
2549
+ lowValue?: number;
2550
+ /**
2551
+ * Value of the rightmost point to keep. If set, all points to the high of this value are trimmed.
2552
+ * @default undefined
2553
+ */
2554
+ highValue?: number;
2555
+ /**
2556
+ * Number of points to remove from the low side. If set, trims this many points from the low.
2557
+ * @default 0
2558
+ */
2559
+ lowNbPoints?: number;
2560
+ /**
2561
+ * Number of points to remove from the high side. If set, trims this many points from the high.
2562
+ * @default 0
2563
+ */
2564
+ highNbPoints?: number;
2565
+ }
2566
+
2518
2567
  /**
2519
2568
  * Options for specifying the region and resolution of the 2D spectrum
2520
2569
  */
@@ -2586,6 +2635,16 @@ export declare function xreimMultipletAnalysis(
2586
2635
  */
2587
2636
  data: DataXReOptionalIm, options?: XreimMultipletAnalysis): any;
2588
2637
 
2638
+ /**
2639
+ * Trims the input arrays in the object by removing points from the low and high according to the provided options.
2640
+ *
2641
+ * @param input - The input data containing x (required), re (required), and optionally im arrays. All arrays must be of the same length.
2642
+ * @param options - The trimming options specifying how many points or what range to trim.
2643
+ * @throws Error if the x array is not sorted in ascending order.
2644
+ * @returns A new DataXReOptionalIm object with trimmed x, re, and (if present) im arrays.
2645
+ */
2646
+ export declare function xreimTrim(input: DataXReOptionalIm, options: TrimApplyOptions): DataXReOptionalIm;
2647
+
2589
2648
  export declare function xyAutoPeaksPicking(data: DataXY<Float64Array>, options: OptionsXYAutoPeaksPicking): NMRPeak1DWithShapeID[];
2590
2649
 
2591
2650
  /**