My Vacation in Barometric Pressure

What can we see from my phone’s barometric pressure readings?

graphing
maps
visualization
Author

Robert M Flight

Published

September 20, 2021

The What?

I recently took a proper vacation, that involved driving from Lexington, KY, USA to Digby, NS, Canada and all points in between. I also have an app, Barometer Reborn, on my phone that measures the air pressure every 15 minutes or so. This data is useful for someone who suffers from pressure induced migraines. I decided it would be interesting to examine the air pressure readings over the course of my vacation, given that we crossed an extremely wide variety of terrain (and weather) in our travels.

So lets see what kinds of things we can see. A big caveat with this data is that we are essentially recording local pressure, a combination of pressure changes from both elevation and weather changes, as I don’t have the correction for elevation turned on. I think it will still be interesting to examine whats in here.

Load Data

I’ve previously uploaded data to Google Drive from my phone and downloaded it. Although it says “csv”, it turns out it’s actually tab-separated. I also do the conversion to a date-time format explicitly here, because it was easier than parsing the date format that the app uses.

library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(ggplot2)
library(ggforce)
theme_set(cowplot::theme_cowplot())
barometer_readings = read.table(here::here("data_files/barometer_2021-09-17.csv"), sep = "\t", header = TRUE) %>%
  dplyr::mutate(pressure = Pressure..mBar.,
                datetime = lubridate::as_datetime(Timestamp..Unix.Time. / 1000, tz = "America/New_York")) %>%
  dplyr::filter(datetime >= "2021-08-21", datetime <= "2021-09-15")

Initial Plot

We can plot the whole thing, with the pressure at sea level as well.

ggplot(barometer_readings, aes(x = datetime,
                               y = pressure)) +
  geom_line(size = 1.5) +
  geom_hline(yintercept = 1013.25, color = "red", size = 1.5, alpha = 0.5) +
  labs(x = "Date", y = "Pressure (mBar)")

This is kinda cool. At both ends it’s easy to see the passage there and back through the mountains (not big ones, but still)! It’s also easy to see that outside of those, I spent a lot of time near sea level, which is expected from Bangor, ME on.

Annotations

Let’s annotate it! We can come up with some simple annotations, like the driving sections, and then when we were in a location, and add those to the plot. The (1) and (2) labels are to keep from having weird plot artifacts appearing in the line plot.

barometer_readings = barometer_readings %>%
  dplyr::mutate(location =
   dplyr::case_when(
     
     datetime <= "2021-08-22 08:00" ~ "Lexington - Bangor",
     datetime <= "2021-08-23 08:00" ~ "Waiting on Covid Test",
     datetime <= "2021-08-23 19:00" ~ "Bangor - Digby",
     datetime <= "2021-08-28 08:00" ~ "Digby 1",
     datetime <= "2021-08-28 14:00" ~ "Daytrip to Liverpool",
     datetime <= "2021-09-03 10:00" ~ "Digby 2",
     datetime <= "2021-09-03 16:30" ~ "Digby - Burton",
     datetime <= "2021-09-08 09:00" ~ "Burton 1",
     datetime <= "2021-09-08 20:00" ~ "Daytrip to Moncton",
     datetime <= "2021-09-13 08:00" ~ "Burton 2",
     datetime <= "2021-09-15" ~ "Burton - Lexington"
   ),
   day = lubridate::as_date(datetime))
big_plot = ggplot(barometer_readings, aes(x = datetime, y = pressure, color = location)) + 
  geom_line(size = 1.5) +
  theme(legend.position = c(0.2, 0.3)) +
  labs(x = "Date", y = "Pressure (mBar)")
big_plot

big_plot2 = big_plot + theme(legend.position = "none")

We can plot some of these as subsets and zoom in on them.

big_plot2 + 
  facet_zoom(x = location %in% c("Lexington - Bangor", "Waiting on Covid Test", "Bangor - Digby")) +
  labs(caption = "Going from Lexington to Bangor, awaiting test results, and then driving to Digby.")

big_plot2 +
  facet_zoom(x = location %in% c("Digby 1", "Daytrip to Liverpool", "Digby 2")) +
  labs(caption = "Digby, with a trip across land to Liverpool.")

big_plot2 +
  facet_zoom(x = location %in% c("Digby - Burton", "Burton 1", "Daytrip to Moncton", "Burton 2")) +
  labs(caption = "Traveling from Digby to Burton, a daytrip to Moncton, and remainder in Burton.")

You can actually see towards the tail end of our stay in Burton, the big increase in local pressure from a high-front that gave me a massive migraine and kept me home from activities with the family. Thankfully that was the only one.

big_plot2 +
  facet_zoom(x = as.character(day) %in% c("2021-09-10", "2021-09-11")) +
  labs(caption = "Migraine day, stayed home.")

big_plot2 +
  facet_zoom(x = location %in% c("Burton - Lexington")) +
  labs(caption = "Traveling home to Lexington from Burton over 2 days.")

Conclusions

I dunno, honestly. This would probably be more interesting if it was one or the other of changes due to altitude, or due to changes in the weather with an adjustment for the altitude. Many of the dips are due to changes occurring because of a change in altitude, with the biggest ones noted as we drove through the Appalachian mountains.

Reuse

Citation

BibTeX citation:
@online{mflight2021,
  author = {Robert M Flight},
  title = {My {Vacation} in {Barometric} {Pressure}},
  date = {2021-09-20},
  url = {https://rmflight.github.io/posts/2021-09-20-my-vacation-in-barometric-pressure},
  langid = {en}
}
For attribution, please cite this work as:
Robert M Flight. 2021. “My Vacation in Barometric Pressure.” September 20, 2021. https://rmflight.github.io/posts/2021-09-20-my-vacation-in-barometric-pressure.