HandsOn 3. Sensor Data
HandsOn 3. Sensor Data
Learning Goals:
Instructions:
Step 1. Open a terminal shell. Open a terminal shell by clicking on the square black box on the top
left of the screen.
Run cd Downloads/lect4data/sensor
Step 2. View weather station data. Twenty-four hours of weather station data is in the file wx-
data.txt . View this data by running more wx-data.txt.
Each line in the file contains a timestamp in the first column and a set of measurements in the
second column. These column are separated by a tab. The measurements are also a set of columns
separated by commas.
The timestamp is the number of seconds since January 1, 1970. By looking at the successive
timestamps in the file, we can see that the measurements arrive about every second.
The measurements are prefixed with R0, R1, R2 , etc. Each R-value holds a different set of
measurements. For example, R1 has Dn, Dm, Dx , etc. Additionally, the different types are measured
at different frequencies. R1 is measured every second, but R0 and R2 are much less frequent.
Step 3. Look at key for measurements. We can learn what the measurement fields mean by looking
at the measurements key file. Open a new terminal and cd to
Downloads/lect4data/sensor.
This file provides a list of what each field means. For example, Ta is the Air temperature, and Dn is
the Wind direction minimum.
Step 4. Plot data. To plot the air temperature, you will first need to install Matplotlib.
Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of
hardcopy formats and interactive environments across platforms.
And it will save a file named ‘results.png’ in your sensor data folder, which looks like this: