diff --git a/docs/README.html b/docs/README.html index 1868d0941..71bae3a03 100644 --- a/docs/README.html +++ b/docs/README.html @@ -7,22 +7,21 @@ - -README.utf8.md + - + - - - - - - - + + + + + + + - - - - - - + + -
@@ -301,6 +307,9 @@
  • Sandy Beach
  • +
  • + Environmental, Remotely Sensed +
  • Environmental, In Situ
  • @@ -367,9 +376,6 @@

    Add a Site

    Add entry to data/sites.csv. Be sure to use a unique id.

    Then build site (or check into Github and Travis will build it for you). A new marker will be populated into the home page map via rmarkdown::render_site() rendering index.Rmd and a new site page will be generated via source("make_sites.R") (see make_sites.R)) rendering a parameterized Rmarkdown using site_template.Rmd.

    For notes about finding country given lat/lon (ie reverse geocoding), creating Google Maps URL (gmapurl; optional, not a necessary field), check out code in prep.R.

    -

    Add Pictures to a Site

    @@ -405,10 +411,8 @@

    Installing Dependencies

    Resources

    @@ -434,23 +438,6 @@

    Resources

    - - - - - - - +
    +

    Chlorophyll

    Map of the most recent (2019-06-01) Chlorophyll-a around the site.

    -
    - +
    + +
    +
    +

    Seascape

    +

    Map of the most recent (2019-05-15) seascapes around the site.

    +
    +

    Timeseries

    Temperature

    -
    - +
    +

    Chlorophyll

    -
    - +
    +
    diff --git a/site_template.Rmd b/site_template.Rmd index fa6931b73..130c6664b 100644 --- a/site_template.Rmd +++ b/site_template.Rmd @@ -20,25 +20,14 @@ library(leafem) library(bsplus) source("functions.R") -# params = list(site_id="usa-fknms") -# params = list(site_id="col-islagorgona-lamancora") -# params = list(site_id="bra-costadasalgas-gramute") -# params = list( -# site_id="ecu-puntilladestaelena-chocolatera", -# site_name="Puntilla de Sta Elena - Chocolatera") -``` - -```{r get_csv_data, include=FALSE, echo=FALSE} site <- read_csv(here("data/sites.csv")) %>% filter(id == params$site_id) photos <- read_csv(here("data/site_photos.csv")) %>% filter(id == params$site_id) -``` -```{r fetch_erddap_info, include=FALSE, echo=FALSE} -sst <- info('jplMURSST41mday') -chl <- info("nesdisVHNSQchlaMonthly") -#seas <- info("noaa_aoml_4729_9ee6_ab54") +sst <- info('jplMURSST41mday') +chl <- info("nesdisVHNSQchlaMonthly") +scape <- info("noaa_aoml_4729_9ee6_ab54", url = "https://cwcgom.aoml.noaa.gov/erddap/") ``` - Country: **`r str_to_upper(site$country)`** @@ -46,7 +35,7 @@ chl <- info("nesdisVHNSQchlaMonthly") ## Photos -```{r, echo=FALSE} +```{r} if (nrow(photos) > 0){ carousel <- bs_carousel(id = "photos", use_indicators = TRUE) @@ -68,14 +57,14 @@ if (nrow(photos) > 0){ ### Temperature -```{r, echo=FALSE, warning=FALSE, message=FALSE} +```{r} # get most recent date d <- get_dates(sst)[2] ``` Map of the most recent (`r format(d,"%Y-%m-%d")`) sea-surface temperature around the site. -```{r, echo=FALSE} +```{r} # box <- get_box(site$lon, site$lat, cells_wide=10) # r <- get_raster(sst, lon=box$lon, lat=box$lat, date="last", field="sst") # map_raster(r, site_lon=site$lon, site_lat=site$lat, site_label=site$name, title="SST") @@ -142,6 +131,45 @@ leaflet( colorNumeric("Spectral", c(0,4), reverse=T), seq(0,4)) ``` + +### Seascape + +```{r, echo=FALSE, message=FALSE, warning=FALSE} +# get most recent date +d_2 <- get_dates(scape)[2] +``` + +Map of the most recent (`r format(d_2, "%Y-%m-%d")`) seascapes around the site. + +```{r, echo=FALSE, message=FALSE, warning=FALSE} +# box_2 <- get_box(site$lon, site$lat, cells_wide=10) +# r_2 <- get_raster(chl, lon=box$lon, lat=box$lat, date="last", field="chl") +# map_raster(r, site_lon=site$lon, site_lat=site$lat, site_label=site$name, title="CHL") + +# bounding box offset around site marker for extent of map +b_2 <- 3.0 + +leaflet( + options = leafletOptions( + crs = leafletCRS(crsClass = "L.CRS.EPSG4326"))) %>% + # basemap from GBIF in 4326 + addTiles("//tile.gbif.org/4326/omt/{z}/{x}/{y}@1x.png?style=gbif-geyser") %>% + # sst + addWMSTiles( + baseUrl = 'https://cwcgom.aoml.noaa.gov/erddap/wms/noaa_aoml_4729_9ee6_ab54/request?', + layers = "noaa_aoml_4729_9ee6_ab54:CLASS", + options = WMSTileOptions( + version = "1.3.0", format = "image/png", transparent = T, opacity = 0.7, + time = format(d_2,"%Y-%m-%dT00:00:00Z"))) %>% + addMarkers(lng = ~lon, lat = ~lat, label = ~name, data=site) %>% + addMouseCoordinates() %>% + fitBounds(site$lon - b_2, site$lat - b_2, site$lon + b_2, site$lat + b_2) %>% + addLegend( + position="bottomright", + title = paste0("CLASS
    ", format(d_2,"%Y-%m-%d")), + colorNumeric("Spectral", c(0,4), reverse=T), seq(0,4)) +``` + ## Timeseries {.tabset} ### Temperature @@ -152,7 +180,7 @@ d <- get_timeseries(sst, lon=site$lon, lat=site$lat, csv=csv, field="sst") plot_timeseries(d, title="SST", color="red") ``` -```{python} +```{python, eval=F} # transform something like # https://marinebon.github.io/home/travis/build/marinebon/p2p/data/sst/sst_wi-maracas.csv # into @@ -168,12 +196,3 @@ csv <- here(glue("data/chl/chl_{site$id}.csv")) d_2 <- get_timeseries(chl, lon=site$lon, lat=site$lat, csv=csv, field="chlor_a") plot_timeseries(d_2, title="CHL", color="green") ``` - -```{python} -# transform something like -# https://marinebon.github.io/home/travis/build/marinebon/p2p/data/sst/sst_wi-maracas.csv -# into -# https://raw.githubusercontent.com/marinebon/p2p/master/data/sst/sst_wi-maracas.csv -csv = str(r.csv).replace("/marinebon/p2p/data/", "/marinebon/p2p/master/data/") -csv_link = "https://raw.githubusercontent.com/" + csv.split("/marinebon/p2p/")[1] -```