Skip to content

Commit

Permalink
Update documentation and site
Browse files Browse the repository at this point in the history
  • Loading branch information
silasprincipe committed Jan 19, 2024
1 parent 9edc771 commit 3120597
Show file tree
Hide file tree
Showing 95 changed files with 20,827 additions and 301 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ codes/drafts/
data/

functions/drafts/

*.zip

temp/
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,25 @@ Oxygen data download proceeded the same way as temperature (use the code with th

### Data processing

__Marine heat waves and Cold spells__

Data analysis for Marine Heat Waves and Cold Spells was done using the package [`heatwaveR`](https://robwschlegel.github.io/heatwaveR/). More details to be added after the workshop.

__Temperature by species__

- `get_edna_marinespecies.R`: aggregate species list from the eDNA project downloaded from the repository https://github.com/iobis/edna-species-lists
- `temperature_database.R`: aggregate temperature/environmental layers to the OBIS/GBIF database (see details for the database here https://github.com/iobis/protectedseas-statistics)
- `get_sst_marinespecies.R`: extract temperature information for all species listed on the sites
- `plot_sst_marinespecies.R`: plot temperature information for a selected species

There is also a function on the `functions` folder, `query_sst_marinespecies.R`, that can be used to query full data or summaries of temperature for a species (using the database).

__Others__

- `get_depthprofiles.R`: see which is the actual depth that was used when obtaining the data from Copernicus
- `generate_quarto_sites.R`: generate quarto pages by site


----

<img src="https://obis.org/images/logo.png" width="200">
14 changes: 12 additions & 2 deletions codes/download_oxygen_toolbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,21 @@ proc <- job::job({
cat("File already processed, skipping.\n")
} else {
r <- rast(fname)
r_dat <- as.data.frame(r, xy = TRUE, time = TRUE, wide = FALSE)
r_dat <- subset(r_dat, select = -layer)
r_dat <- as.data.frame(r, xy = TRUE, time = TRUE)
r_dat <- r_dat %>%
pivot_longer(3:length(.), names_to = "time", values_to = "values") %>%
mutate(layer = gsub("\\..*", "", names(r))[1])
arrow::write_parquet(r_dat, outfile, compression = "gzip")
}

return(invisible(NULL))
})

lf <- list.files(outfolder, full.name = T, pattern = "\\.parquet")
base <- list.files(outfolder, full.name = T, pattern = "\\.nc")[1]

zip("oxygen_dayly.zip", c(lf, base))

job::export("none")
})

16 changes: 14 additions & 2 deletions codes/download_temperature_toolbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,23 @@ proc <- job::job({
cat("File already processed, skipping.\n")
} else {
r <- rast(fname)
r_dat <- as.data.frame(r, xy = TRUE, time = TRUE, wide = FALSE)
r_dat <- subset(r_dat, select = -layer)
r_dat <- as.data.frame(r, xy = TRUE, time = TRUE)
r_dat <- r_dat %>%
pivot_longer(3:length(.), names_to = "time", values_to = "values") %>%
mutate(layer = gsub("\\..*", "", names(r))[1])
arrow::write_parquet(r_dat, outfile, compression = "gzip")
}

return(invisible(NULL))
})

lf <- list.files(outfolder, full.name = T, pattern = "\\.parquet")
base <- list.files(outfolder, full.name = T, pattern = "\\.nc")[1]

zip("temperature_dayly.zip", c(lf, base))

job::export("none")
})



Loading

0 comments on commit 3120597

Please sign in to comment.