noaa-onms / cinms

Channel Islands National Marine Sanctuary
https://noaa-onms.github.io/cinms
MIT License
3 stars 1 forks source link

Missing content for: Trend: SST anomaly (SBC LTER) -> make sst_anomaly() #45

Closed superjai closed 3 years ago

superjai commented 3 years ago

There is nothing for the following tab in key-climate-ocean.rmd: "Trend: SST anomaly (SBC LTER)"

bbest commented 3 years ago

Should probably refer to p. 81 of 2016-condition-report-channel-islands-nms.pdf:

image

Figure S.WQ.6.2. Monthly anomalies in (top panel) observed bottom temperature (°C) at 7–10 meters depth and (bottom panel) modeled bottom nitrate concentrations (μmol/L) at 7–10 meters depth along the Santa Barbara Channel mainland nearshore (nine sampling sites roughly spanning from Gaviota east to Ventura). The anomalously warm years of 2014–2015 are shown in red. Similar trends were seen at the islands. Data source: Santa Barbara Coastal Long-term Ecological Research; Figure: Reed et al. 2016 Note: This figure was unavailable for expert review during the workshop; however a representative from the monitoring program was present at the workshop and discussed the data.

We could create a climatic anomaly product from the latest data. This would be a great feature to provide.

Is there a Nitrate ERDDAP dataset?

bbest commented 3 years ago

This format is preferable for anomalies:

image

bbest commented 3 years ago

heatwaveR

temp with exceedance (vs anomaly)

event_line(mhw, spread = 180, metric = "intensity_max",
           start_date = "1982-01-01", end_date = "2014-12-31")

image

already there in Trend Nitrate

image

bbest commented 3 years ago

R code found here for anomaly calculation:

bbest commented 3 years ago

Prefer rather than using an anomaly SST product, use the existing time series extracted over a long period to then define the climate average (eg older than 5 years) and then difference over entire time period.

superjai commented 3 years ago

Hey @bbest, I have added a SST anomaly figure to key-climate-ocean. What do you think?

bbest commented 3 years ago

Looking good!

image

bbest commented 3 years ago

In dygraphs, check out https://rstudio.github.io/dygraphs/gallery-series-options.html#filling:

image

So probably want to split data into above and below 0 to plot above as filled red area plot and below 0 blue area plot.

superjai commented 3 years ago

Hey @bbest - what do you think of this new anomaly figure? The figure is live on the site for key-climate-ocean.html. I have also updated the caption. I personally would want to remove the point labels (as well as the legend overall), but I left them on for now, so you could see for yourself. Screen Shot 2020-11-05 at 10 23 23 PM

All the code to create this figure is sitting within key-climate-ocean.Rmd.

Since time efficiency is of max importance now, I wrote this code as quickly as I could (meaning it works, but isn't very elegant). My strategy here was to split the SST anomaly data (which is 1 column of data) into 2 columns of data: values below zero and values above zero. Each of those lines was plotted separately as a different filled-in color. I also needed to interpolate some points. Every time the anomaly time series data crossed the zero anomaly line (0 on the y axis), that "zero day" needed to be inserted into the 2 columns of data. This was necessary to have a figure that didn't have gaps in the color fill.

bbest commented 3 years ago

Looks Amazeballs!

Ok, next step is to:

  1. Fold into nms4r as a function.
  2. Add Trend: SST anomaly tab to all other habitats having Temperature

And then down the road, we'll use this for a data-driven scrollytelling of the Pacific "warm blob" event and Florida Keys "cold snap" :smile: