Skip to content

Commit

Permalink
Add Savitzky-Golay smoothing literature references.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Oct 30, 2024
1 parent d390a52 commit 21bf9d2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2021 Lablicate GmbH.
* Copyright (c) 2015, 2024 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -13,8 +13,14 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.filter.supplier.savitzkygolay.settings;

import java.io.IOException;
import java.util.Collections;
import java.util.List;

import org.eclipse.chemclipse.chromatogram.filter.settings.AbstractChromatogramFilterSettings;
import org.eclipse.chemclipse.chromatogram.xxd.filter.supplier.savitzkygolay.preferences.PreferenceSupplier;
import org.eclipse.chemclipse.logging.core.Logger;
import org.eclipse.chemclipse.support.literature.LiteratureReference;
import org.eclipse.chemclipse.support.settings.IntSettingsProperty;
import org.eclipse.chemclipse.support.settings.IntSettingsProperty.Validation;

Expand All @@ -24,6 +30,8 @@

public class ChromatogramFilterSettings extends AbstractChromatogramFilterSettings {

private static final Logger logger = Logger.getLogger(ChromatogramFilterSettings.class);
//
@JsonProperty(value = "Order", defaultValue = "2")
@JsonPropertyDescription(value = "Order p of the polynomial to be fitted: Integer in the range from 2 to 5")
@IntSettingsProperty(minValue = PreferenceSupplier.MIN_ORDER, maxValue = PreferenceSupplier.MAX_ORDER)
Expand Down Expand Up @@ -64,4 +72,22 @@ public void setWidth(int width) {

this.width = width;
}

@Override
public List<LiteratureReference> getLiteratureReferences() {

return Collections.singletonList(createLiteratureReference("achs_ancham36_1627.ris", "10.1021/ac60214a047"));
}

private static LiteratureReference createLiteratureReference(String file, String doi) {

String content;
try {
content = new String(ChromatogramFilterSettings.class.getResourceAsStream(file).readAllBytes());
} catch(IOException | NullPointerException e) {
content = doi;
logger.warn(e);
}
return new LiteratureReference(content);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@




TY - JOUR
T1 - Smoothing and Differentiation of Data by Simplified Least Squares Procedures.
AU - Savitzky, Abraham.
AU - Golay, M. J. E.
Y1 - 1964/07/01
PY - 1964
DA - 1964/07/01
N1 - doi: 10.1021/ac60214a047
DO - 10.1021/ac60214a047
T2 - Analytical Chemistry
JF - Analytical Chemistry
JO - Anal. Chem.
SP - 1627
EP - 1639
VL - 36
IS - 8
PB - American Chemical Society
SN - 0003-2700
M3 - doi: 10.1021/ac60214a047
UR - https://doi.org/10.1021/ac60214a047
ER -

0 comments on commit 21bf9d2

Please sign in to comment.