1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
Excellent — this is a rich and highly practical module for mechanical engineers, since _data analysis and visualization_ tie directly into interpreting experiments, simulations, and sensor data.
It follows your course flow from importing → cleaning/filtering → visualization, and integrates _NumPy, SciPy,_ and _Matplotlib_ progressively.
---
# **Module 4: Data Analysis and Processing**
## **Overview**
This module introduces methods for handling, cleaning, and visualizing scientific and experimental data in Python.
Students will learn to:
- Import data from various sources (CSV, Excel, sensors, simulations)
- Detect and correct data errors or noise
- Filter and smooth signals
- Extract meaningful patterns and trends
- Create clear, professional-quality figures for reports
**Primary Libraries:**
`NumPy`, `Pandas`, `SciPy.signal`, `SciPy.ndimage`, `Matplotlib`, `Seaborn`
---
## **Lecture 1 — Introduction to Data and Scientific Datasets**
**Learning objectives:**
- Understand what makes data “scientific” (units, precision, metadata)
- Recognize types of data: time-series, experimental, simulation, and imaging data
- Identify challenges in data processing (missing data, noise, outliers)
- Overview of the data-analysis workflow
**Activities & Examples:**
- Load small CSV datasets using `numpy.loadtxt()` and `pandas.read_csv()`
- Discuss real ME examples: strain gauge data, thermocouple readings, pressure transducers
---
## **Lecture 2 — Importing and Managing Data**
**Learning objectives:**
- Import data from CSV, Excel, and text files using Pandas
- Handle headers, delimiters, and units
- Combine and merge multiple datasets
- Manage data with time or index labels
**Hands-on examples:**
- Combine data from multiple experimental runs
- Import time-stamped data and plot quick trends
---
## **Lecture 3 — Data Cleaning and Preprocessing**
**Learning objectives:**
- Detect and handle missing or invalid data
- Identify and remove outliers
- Apply smoothing and detrending
- Unit consistency and scaling
**Techniques & Tools:**
- `pandas.isna()`, `dropna()`, and `fillna()`
- Statistical checks with `numpy.mean()`, `numpy.std()`
- Z-score outlier removal
- Case study: noisy strain vs. time dataset
---
## **Lecture 4 — Data Filtering and Signal Processing (SciPy)**
**Learning objectives:**
- Understand why and when filtering is needed
- Apply low-pass, high-pass, and band-pass filters
- Implement moving-average and Savitzky–Golay filters
- Compare frequency vs. time-domain filtering
**Toolbox Focus:** `scipy.signal`
**Example Applications:**
- Filter noisy vibration data from accelerometers
- Remove DC offset from force measurements
---
## **Lecture 5 — Image and Spatial Data Processing (Optional/Extension)**
**Learning objectives:**
- Introduce `scipy.ndimage` for image-based data
- Perform smoothing, edge detection, and segmentation
- Apply spatial filtering to thermal images or contour data
**Applications:**
- Heat distribution image analysis
- Flow visualization from CFD contour plots
---
## **Lecture 6 — Data Visualization and Presentation**
**Learning objectives:**
- Create scientific plots using `matplotlib.pyplot`
- Customize figures (labels, legends, styles, subplots)
- Plot multi-dimensional and time-series data
- Combine plots and export for reports
**Extensions:**
- Intro to `seaborn` for statistical visualization
- Plotting uncertainty and error bars
**Capstone Exercise:**
- Load experimental dataset → clean → filter → visualize results
(Example: force–displacement data → stress–strain curve with trendline)
---
## **Optional Lab/Project Ideas**
- Clean and visualize experimental data from a tensile test
- Filter and interpret vibration data from a rotating machine
- Plot temperature variation in a heat exchanger experiment
- Generate report-quality figures comparing experimental and simulation data
|