LimnoDataScience / plume_bloom_drivers

Using classified raster images and meteo drivers to try to better understand what is causing sediment plumes and blooms in Lake Superior
1 stars 1 forks source link

Download prism `tmean` and `ppt` #3

Closed lindsayplatt closed 1 year ago

lindsayplatt commented 1 year ago

This code downloads PRISM data for vars tmean and ppt based on the mission-dates provided over in Superior-Plume-Bloom. It uses the mission dates as the anchors and also downloads the preceding 2 weeks of driver data for each.

I used the rOpenSci/prism package. to download and extract the PRISM data. This seemed easiest in terms of coding, though it downloads EVERYTHING in space for your specified date/variable. You later subset to get the summary at specific lat/longs, but the download part takes forever (~10 hrs) because of how that is organized.

In the end the PRISM data are loaded for the centroids of each of the grid cells (based on this in Superior-Plume-Bloom) and saved as a big timeseries data frame, p2_prism_data. I also plotted these in p4_prism_summary. Some of the grid cells show NA and I am assuming it is because their centroids are over water and there is a water mask in this dataset.

Here is what the data look like per cell (minus the NA cells):

targets::tar_read(p4_prism_summary)

image