Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SmoothStrictPrimAnalyzer extends Analyzer {
@SneakyThrows
public void analyze(AnalyzerParams params) {
extractParams(params);
logger.info("Running pipeline: StrictTimestamp -> sGolay (single file RPM)");
logger.info("Running pipeline: StrictTimestamp -> Outlier Removal -> sGolay (PRIM RPM)");

// Single file and column
String file = params.getInputFiles()[0];
Expand All @@ -37,14 +37,33 @@ public void analyze(AnalyzerParams params) {
strict.analyze(sp);
String strictOut = sp.getOutputFiles()[0];

// 2) Savitzky-Golay for the strict timestamp output
// 2) Outlier removal for RPM > 20000
Analyzer outlierRemoval = factory.getAnalyzer(AnalyzerType.DELETE_OUTLIER);
AnalyzerParams or = new AnalyzerParams();
or.setInputFiles(new String[] {strictOut});
or.setInputColumns(new String[] {"Timestamp (ms)", "RPM PRIM"});
or.setType(AnalyzerType.DELETE_OUTLIER);
or.setOptions(
new String[] {
"0", // minX (minimum timestamp - keep all)
"999999999", // maxX (maximum timestamp - keep all)
"0", // minY (minimum RPM - keep all above 0)
"20000" // maxY (maximum RPM - remove above 20000)
});
or.generateOutputFileNames();
outlierRemoval.analyze(or);
String outlierOut = or.getOutputFiles()[0];

// 3) Savitzky-Golay for the outlier-removed output
Analyzer sGolay = factory.getAnalyzer(AnalyzerType.SGOLAY);
AnalyzerParams sg = new AnalyzerParams();
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same file is being passed twice to setInputFiles. This appears to be intentional for the SGOLAY analyzer, but consider adding a comment explaining why the same file is duplicated.

Suggested change
AnalyzerParams sg = new AnalyzerParams();
AnalyzerParams sg = new AnalyzerParams();
// The SGOLAY analyzer expects an input file for each input column.
// Since both "Timestamp (ms)" and "RPM PRIM" are in the same file, we pass the same file twice intentionally.

Copilot uses AI. Check for mistakes.
sg.setInputFiles(new String[] {strictOut, strictOut});
sg.setInputFiles(new String[] {outlierOut, outlierOut});
sg.setInputColumns(new String[] {"Timestamp (ms)", "RPM PRIM"});
sg.setType(AnalyzerType.SGOLAY);
sg.setOptions(new String[] {"101", "3"});
sg.setOutputFiles(params.getOutputFiles());
sGolay.analyze(sg);

logger.info("Completed pipeline: StrictTimestamp -> Outlier Removal -> sGolay for PRIM RPM");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SmoothStrictSecAnalyzer extends Analyzer {
@SneakyThrows
public void analyze(AnalyzerParams params) {
extractParams(params);
logger.info("Running pipeline: StrictTimestamp -> sGolay (single file RPM)");
logger.info("Running pipeline: StrictTimestamp -> Outlier Removal -> sGolay (SEC RPM)");

// Single file and column
String file = params.getInputFiles()[0];
Expand All @@ -37,14 +37,33 @@ public void analyze(AnalyzerParams params) {
strict.analyze(sp);
String strictOut = sp.getOutputFiles()[0];

// 2) Savitzky-Golay for the strict timestamp output
// 2) Outlier removal for RPM > 20000
Analyzer outlierRemoval = factory.getAnalyzer(AnalyzerType.DELETE_OUTLIER);
AnalyzerParams or = new AnalyzerParams();
or.setInputFiles(new String[] {strictOut});
or.setInputColumns(new String[] {"Timestamp (ms)", "RPM SEC"});
or.setType(AnalyzerType.DELETE_OUTLIER);
or.setOptions(
new String[] {
"0", // minX (minimum timestamp - keep all)
"999999999", // maxX (maximum timestamp - keep all)
"0", // minY (minimum RPM - keep all above 0)
"20000" // maxY (maximum RPM - remove above 20000)
});
or.generateOutputFileNames();
outlierRemoval.analyze(or);
String outlierOut = or.getOutputFiles()[0];

// 3) Savitzky-Golay for the outlier-removed output
Analyzer sGolay = factory.getAnalyzer(AnalyzerType.SGOLAY);
AnalyzerParams sg = new AnalyzerParams();
sg.setInputFiles(new String[] {strictOut, strictOut});
sg.setInputFiles(new String[] {outlierOut, outlierOut});
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same file is being passed twice to setInputFiles. This appears to be intentional for the SGOLAY analyzer, but consider adding a comment explaining why the same file is duplicated.

Copilot uses AI. Check for mistakes.
sg.setInputColumns(new String[] {"Timestamp (ms)", "RPM SEC"});
sg.setType(AnalyzerType.SGOLAY);
sg.setOptions(new String[] {"101", "3"});
sg.setOutputFiles(params.getOutputFiles());
sGolay.analyze(sg);

logger.info("Completed pipeline: StrictTimestamp -> Outlier Removal -> sGolay for SEC RPM");
}
}
10 changes: 5 additions & 5 deletions front-end/src/lib/subteamGraphPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const subteamGraphPresets: DataViewerPreset[] = [
},
{
name: 'Smooth Strict RPM',
description: 'Primary and Secondary RPM vs Timestamp (ms) smoothened with strict timestamp outlier removal',
description: 'Primary and Secondary RPM vs Timestamp (ms) smoothened + outlier removal + strict timestamp',
graphs: [
{
axes: [
Expand Down Expand Up @@ -86,8 +86,8 @@ export const subteamGraphPresets: DataViewerPreset[] = [
]
},
{
name: 'Smooth Primary RPM with Strict Timestamp',
description: 'Smooths PRIM RPM with strict timestamp outlier removal',
name: 'Smooth Strict PRIM RPM',
description: 'Smooths PRIM RPM with strict timestamp + outlier removal',
graphs: [
{
axes: [
Expand All @@ -101,8 +101,8 @@ export const subteamGraphPresets: DataViewerPreset[] = [
],
},
{
name: 'Smooth Secondary RPM with Strict Timestamp',
description: 'Smooths SEC RPM with strict timestamp outlier removal',
name: 'Smooth Strict SEC RPM',
description: 'Smooths SEC RPM with strict timestamp + outlier removal',
graphs: [
{
axes: [
Expand Down
6 changes: 3 additions & 3 deletions front-end/src/types/AnalyzerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export const analyzerConfig: Record<AnalyzerKey, AnalyzerConfigItem> = {
[AnalyzerType.SMOOTH_STRICT_PRIM]: {
title: 'Smooth Strict PRIM',
description:
'Runs StrictTimstamp and Sgolay for RPM PRIM',
'Runs StrictTimestamp and Sgolay for RPM PRIM',
isJoinBased: false,
image: {
src: placeholderImage,
Expand All @@ -247,12 +247,12 @@ export const analyzerConfig: Record<AnalyzerKey, AnalyzerConfigItem> = {
[AnalyzerType.SMOOTH_STRICT_SEC]: {
title: 'Smooth Strict SEC',
description:
'Runs StrictTimstamp and Sgolay for RPM SEC',
'Runs StrictTimestamp and Sgolay for RPM SEC',
isJoinBased: false,
image: {
src: placeholderImage,
alt: 'Strict timestamp demo',
},
links: [{ title: 'Timestamp (Wiki)', url: 'https://en.wikipedia.org/wiki/Timestamp' }],
},
};
};
Loading