-
Notifications
You must be signed in to change notification settings - Fork 0
/
obis2opbg.Rmd
41 lines (26 loc) · 1.9 KB
/
obis2opbg.Rmd
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
---
title: "obis2obpg"
author: "Nicholas R. Record"
date: "8/11/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## obis2obpg
Linking OBIS taxon download with concurrent OBPG measurements
```{r}
library(robis)
E.glacialis <- occurrence("Eubalaena glacialis")
names(E.glacialis)
```
## OBPG - getting and managing the data
Let's assume that we settle on piloting project this around a particular region with an agreed upon bounding box and date/time window. We next need to chose environemtnal parameters (chlor_a, sst, etc) and resolutions (4km or 9km) to work with. Finally, we should agree upon how to store the data (directory heirarchy, format, naming convention.)
If we chose to use R we have a pre-built solution in the [ohwobpg](https://github.com/BigelowLab/ohwobpg) R package. It will grab OPeNDAP resources from OBPG and save in geotiff format using a prespecified directory heirarchy. It also provides simple and flexible databasing functionality to facilitate access.
If we chose to use Python we may need to roll our own tool to achieve the same functionality. Some links to help...
+ [A MUR example](https://climate-cms.org/2019/01/18/using-opendap.html)
+ [xarray docs](http://xarray.pydata.org/en/stable/why-xarray.html)
We will need to consider how we manage the fact that OBPG is midstream in a filename convention upgrade. So we'll need to manage the old-style vs new-style conventions as painlessly as possible for the user.
## OBPG extracting data
In R we can easily extract points (or patches of points, or points either along a polyline or within a polygon) using the [raster](https://CRAN.R-project.org/package=raster) package. See this [tutorial](https://github.com/oceanhackweek/ohw20-tutorials/blob/master/08-R-tutorials/08-extracting_rasters.ipynb)
I'm sure that we can do the same in Python using xarray, but that is new territory to explore.