Toggle navigation
PyAgEng
- Matti Pastell
Table of Contents
Table of Contents
Preface
Chapter 1:
Measurement basics
Chapter 2:
Datalogger hardware and sensor connections
Chapter 3:
Connecting loggers to computers
Chapter 4:
Introduction to Programming and Python
Chapter 5:
Scientific Python
Chapter 6:
Plotting
Chapter 7:
Frequency Analysis
Chapter 8:
Digital Signal Processing
Chapter 9:
References
Measurements and Data Analysis for Agricultural Engineers Using Python
Matti Pastell
© 2016 Matti Pastell
Contents
Preface
Chapter 1
Measurement basics
1.1
Why do we measure things?
1.2
The phases of a successful measurement
1.2.1
Planning
1.2.2
Preparing
1.2.3
Executing
1.2.4
Analysis
1.3
Measurement system components
1.4
Signals
1.4.1
Analog signals
1.4.2
Digital signals
1.5
Analog to digital conversion
1.6
Sampling
1.6.1
Random noise and the Gaussian distribution
1.6.2
Measures of signal quality
1.7
Properties of measurements
1.7.1
Accuracy and precision
1.7.2
Types of errors
1.7.3
Dynamic properties of measurements
1.8
Calibration
1.9
More terms
1.10
Exercises
Chapter 2
Datalogger hardware and sensor connections
2.1
Datalogger options
2.1.1
Microcontrollers
2.2
Dedicated DAQs
2.2.1
Cheap DAQs
2.2.2
More expensive DAQs
2.3
Connecting sensors to loggers
2.3.1
Input types and voltage signals
2.3.2
Current signals
2.3.3
Voltage divider
2.3.4
Resistance
2.3.5
Wheatstone bridge
2.3.6
Amplifying signals
2.3.7
ADC input impedance
2.4
Exercices
Chapter 3
Connecting loggers to computers
3.1
Serial port
3.2
USB (universal serial bus)
3.3
Ethernet
3.4
Wireless connections
3.4.1
Bluetooth
3.4.2
Zigbee
3.4.3
Radiomodems
3.4.4
WLAN
3.4.5
GPRS
3.5
Exercises
Chapter 4
Introduction to Programming and Python
4.1
Key Features of Python
4.2
Getting Python and libraries
4.3
Ways to use Python
4.3.1
REPL
4.3.2
Python scripts
4.3.3
IPython Notebook
4.4
Variables and operators
4.4.1
Numeric variables
4.4.2
Basic Math
4.4.3
Strings
4.4.4
Booleans
4.4.5
Naming variables
4.4.6
Variable scope
4.5
Operators
4.6
Keywords
4.7
Collections
4.7.1
Lists
4.7.2
Tuples
4.7.3
Dictionaries
4.8
Iteration and conditionals
4.8.1
For loop
4.8.2
Iterating trough a sequence
4.8.3
Iterating over a dictionary
4.9
Conditional statements
4.10
Combining conditions
4.11
While loop
4.11.1
Example: Finding the square root
4.12
Functions and modules
4.13
Defining functions
4.14
Modules
4.14.1
Importing code from modules
4.15
Files
4.15.1
Writing files
4.15.2
Reading files
4.16
Date and time
4.16.1
File formatting for measurements
Chapter 5
Scientific Python
5.1
NumPy arrays
5.1.1
Saving and loading NumPy arrays
5.2
pandas dataframes
Chapter 6
Plotting
6.1
Line plots
6.2
Scatter plot
6.3
Bar plot
6.4
Errorbars
6.5
Histogram
6.6
Boxplot
6.7
Stem plot
6.8
Contour
6.9
Surface plot
6.10
Subplots
6.11
Learning more
Chapter 7
Frequency Analysis
7.1
Time and frequency domain
7.2
Discrete Fourier Transform
7.3
Practical DFT using FFT in Python
7.3.1
FFT pitfalls
7.3.2
Harmonics
7.4
Welch Transform - spectral averaging
7.5
Autoregressive models
7.6
Fitting AR models
7.6.1
Least squares with direct inversion
7.6.2
Yule-Walker method
7.6.3
Power spectral density with AR models
7.6.4
AR spectrum using Python
7.7
Comparison of FFT, Welch and AR
7.8
Exercises
Chapter 8
Digital Signal Processing
8.1
What is Digital Signal Processing?
8.2
Filter types
8.3
Filter properties
8.4
Filter properties using SciPy
8.4.1
Frequency response
8.5
Impulse response
8.5.1
Step response
8.5.2
Plot all together
8.6
Decibels
8.7
Moving average filter
8.7.1
Moving average using SciPy.
8.8
Median filter
8.9
Example: Comparing moving average and median filter
8.10
FIR filters
8.10.1
FIR filters with SciPy
8.11
IIR filters
8.11.1
IIR filters with SciPy
8.12
Filtering example
8.13
Modifying sample rate
8.14
Detrending
8.15
Exercises
Chapter 9
References