CalCOFI.io CalCOFI.io Workflows

The November 2026 temperature anomaly off Southern California

The largest departure from normal in the CalCOFI record: what was measured, how it was checked and where it ranks

Author

CalCOFI

Published

2026-11-13

WarningArchived version

This is the page as it was on 13 November 2026, kept for reference. It measures every cruise against the normal of its calendar month (for this cruise, November), which puts the peak at +12.8 °C. The current page measures against the normal of the season (the fall, September to November), which averages about three times as many cruises; it is here.

ImportantPreliminary data

The measurements from this cruise are preliminary: processed at sea, before final calibration (data_stage preliminary_with_bottle in release v2026.11.12). This analysis has not been peer reviewed. The checks under Is it real? are why the headline numbers are stated with confidence; their second decimal may change.

Summary

CalCOFI has measured the ocean off California at the same stations since 1949. Its fall 2026 cruise aboard R/V Sally Ride (31 October to 7 November 2026) found the largest departure from normal temperature in that record.

  • The measurement. On 31 October 2026, about 27 km off northern San Diego County (CalCOFI station 93.3 30.0), the water 40 to 50 m below the surface was 25.0 °C. The 1993–2013 November average at that station and depth is 12.2 °C.
  • The record. That departure, +12.8 °C, is the largest among the 581,071 station-and-depth values from 340 cruises (1950–2026) that have a baseline to compare with, which means the stations CalCOFI occupies today. The previous largest was +7.1 °C, on the same line in November 2015. The 1982–83 and 1997–98 El Niños peaked near +6 °C by the same measure. A cruder yardstick that reaches every station CalCOFI has ever occupied, the old lines off Baja California included, gives the same answer. The largest departure below the surface that a search of the literature found for the California Current, 8 to 8.7 °C off Baja California in October 1997 (Lynn et al. 1998; Durazo and Baumgartner 2002), is smaller too.
  • At the surface the departure is smaller. The sea surface was 5 to 8 °C warmer than normal at the 17 stations of the inner Southern California Bight and 1 to 4 °C warmer at the 18 stations seaward of them. The largest numbers are below the surface because the warm layer is unusually thick: water of 25 °C reached 55 m, where a normal November is already near 12 °C.
  • Averaged over the area sampled. Through the upper 50 m at the 32 stations sampled, the ocean was 5.1 °C warmer than normal. The previous high over those same stations was +3.4 °C (November 2015). At the peak of the 1997–98 El Niño it was +2.1 °C.
  • It is different water. The warm layer is also unusually salty (34.43–34.48, about 1.0 above normal): the mark of water from the subtropics, not of local water warmed in place. It is lighter than anything normally found at that station, and it has pressed the water beneath it about 100 m deeper than normal, which is what makes the departures at depth so large. Over the inner Bight the upper 50 m is 0.65 saltier than normal; the highest any earlier cruise found there is 0.38, at the peak of the 1997–98 El Niño, and the warm water of 2014–15 was not salty at all.
  • It has been checked. The instrument’s two temperature sensors agree within 0.01 °C through the warm layer, and its salinity matches water samples analysed on board. A buoy 2 km from one station read 25.1 °C when the instrument read 25.0 °C. The shore station on Scripps Pier recorded both the heat and the salt on its own instruments. Satellite analyses show the surface there about 5 °C above normal on the same day.
  • What it does not show. The cruise sampled 36 stations on CalCOFI’s three southern lines, off Southern California, and says nothing about waters farther north. The measurements show how warm the water is, not why: NOAA reports a strong El Niño in progress on top of a marine heatwave off California since 2025, and says the two cannot yet be separated.
TipDescribing it correctly
  • “12.8 °C warmer than normal” needs “at 40 to 50 m depth” beside it. At the sea surface the figure is 5 to 8 °C in the inner Southern California Bight.
  • For the region, the fair figure is the layer average: about 5 °C warmer than normal through the upper 50 m, against a previous record of 3.4 °C.
  • “Normal” is the 1993–2013 average for November at the same station and depth.
  • “The largest in CalCOFI’s record” means the largest departure from that normal at the stations CalCOFI occupies today, in a record that begins in 1949. It is a statement about these stations, not about the Pacific.
  • The data are preliminary.
code
sf_use_s2(F)
land <- ne_countries(scale = 10, country = c("United States of America", "Mexico"), returnclass = "sf") |>
  st_crop(xmin = -127, xmax = -114, ymin = 28, ymax = 37)

pts <- d_sta |>
  filter(layer == "0-50 m", !is.na(anom)) |>
  transmute(site_key, line, station, lon, lat, z = anom)
stopifnot(min(pts$z) >= 0)   # the colour scale below starts at 0: nothing may hide under it

# the surface between the stations: the Explorer's own interpolator (ordinary kriging, calcofi4r::cc_interpolate()),
# drawn only inside the hull of the stations sampled (plus 15 km), never over land, and held inside the range of
# the measured values: the shading interpolates, it never extrapolates a gradient past the last station
srf  <- cc_interpolate(pts, method = "ok", cell_deg = 0.03, mask_km = 60, se = F)
hull <- st_as_sf(pts, coords = c("lon", "lat"), crs = 4326) |>
  st_union() |> st_convex_hull() |>
  st_transform(3310) |> st_buffer(15e3) |> st_transform(4326)
r    <- cc_interpolate_rast(srf)[["value"]] |>
  project("EPSG:4326") |>
  mask(vect(hull)) |>
  mask(vect(land), inverse = T)
d_r  <- as.data.frame(r, xy = T, na.rm = T) |>
  mutate(value = pmin(pmax(value, min(pts$z)), max(pts$z)))

# labels and palette ----
pal_warm <- cmocean("balance")(256)[129:256]   # the warm half of the diverging ramp: white at 0
d_city <- tribble(
  ~name,           ~lon,     ~lat,  ~hjust,
  "San Diego",     -117.16,  32.72, -0.12,
  "Los Angeles",   -118.24,  34.05, -0.12,
  "Santa Barbara", -119.70,  34.42, -0.10)
d_line <- pts |>
  filter(line %in% c(86.7, 90, 93.3)) |>
  group_by(line) |> slice_max(station, n = 1) |> ungroup() |>
  mutate(label = glue("line {format(line, nsmall = 1)}"))
rec <- pts |> filter(site_key == k$top_site)

# map ----
ggplot() +
  geom_tile(data = d_r, aes(x, y, fill = value)) +
  geom_contour(data = d_r, aes(x, y, z = value), breaks = seq(2, 8, 2), colour = "white", linewidth = 0.25, alpha = 0.8) +
  geom_sf(data = land, fill = SAND, colour = STONE, linewidth = 0.25) +
  geom_point(data = pts, aes(lon, lat, fill = z), shape = 21, size = 3.4, colour = INK, stroke = 0.35) +
  geom_text_repel(
    data = pts, aes(lon, lat, label = f1(z)), size = 2.9, colour = INK, seed = 1, max.overlaps = Inf,
    box.padding = 0.22, point.padding = 0.2, min.segment.length = 0.4, segment.colour = MUTED, segment.size = 0.2,
    bg.color = "white", bg.r = 0.14) +
  geom_point(data = d_city, aes(lon, lat), shape = 22, size = 1.6, fill = INK, colour = INK) +
  geom_text(data = d_city, aes(lon, lat, label = name, hjust = hjust), size = 3.2, colour = INK) +
  geom_text(data = d_line, aes(lon - 0.12, lat - 0.2, label = label), size = 3, colour = MUTED, fontface = "italic", hjust = 1) +
  annotate("segment", x = -117.75, y = 31.6, xend = rec$lon - 0.01, yend = rec$lat - 0.07, colour = INK, linewidth = 0.35) +
  annotate(
    "label", x = -117.75, y = 31.6, hjust = 0.5, vjust = 1, size = 3.1, colour = INK, fill = "white", label.size = 0.25,
    lineheight = 0.95, label.padding = unit(5, "pt"),
    label = glue("Station 93.3 30.0\n{f1(k$top_v)} °C at 40–50 m depth:\n{fs(k$top_anom)} °C, the largest\ndeparture on record")) +
  scale_fill_gradientn(
    colours = pal_warm, limits = c(0, ANOM_MAX), breaks = seq(0, 12, 3), name = "°C above the November normal",
    guide = guide_colourbar(
      direction = "horizontal", title.position = "top", barwidth = unit(150, "pt"), barheight = unit(9, "pt"),
      frame.colour = STONE, ticks.colour = "white")) +
  coord_sf(xlim = c(-124.9, -116.1), ylim = c(29.9, 34.9), expand = F) +
  labs(
    title    = glue("The upper 50 m of the ocean off Southern California, {trimws(format(cr$date_min, '%e %B'))} – {trimws(format(cr$date_max, '%e %B %Y'))}"),
    subtitle = glue("Temperature departure from normal, averaged over 0–50 m, at the {nrow(pts)} CalCOFI stations sampled (°C)"),
    x = NULL, y = NULL,
    caption  = glue(
      "Normal: the 1993–2013 average for November at the same station and depth. Shading is interpolated between the stations sampled, never beyond them.\n",
      "CalCOFI CTD, R/V Sally Ride; CalCOFI Integrated Database release {VER} (doi:{CAT$doi}). Preliminary data.  calcofi.io")) +
  theme_story() +
  theme(
    panel.background   = element_rect(fill = "#eaf1f6", colour = NA),
    panel.grid.major   = element_line(colour = "white", linewidth = 0.3),
    legend.position    = "inside",
    legend.position.inside = c(0.16, 0.88),
    legend.background  = element_rect(fill = "white", colour = STONE, linewidth = 0.25),
    legend.margin      = margin(6, 10, 6, 10),
    legend.title       = element_text(size = 9.5),
    legend.text        = element_text(size = 8.5, colour = MUTED))
Map of the ocean off Southern California with the stations of the cruise coloured by temperature departure. Stations inside the Southern California Bight are 7 to 10 degrees Celsius warmer than normal through the upper 50 metres; stations farther offshore are 1 to 4 degrees warmer.
Figure 1: How much warmer than normal the upper 50 m of the ocean was at each station of the fall 2026 CalCOFI cruise. Dots are the stations sampled, labelled with their departure in °C. The shading between them is interpolated and stops at the outermost stations. Normal is the 1993–2013 average for November at the same station and depth. Preliminary data.
code
SITES    <- c("093.3 026.7", "093.3 028.0", "093.3 030.0", "093.3 035.0")
ZMAX     <- 160
lab_site <- function(x) glue("station {as.numeric(sub('.* ', '', x))}")

d_2026 <- q("
  SELECT site_key, depth_m, avg(value) AS temp FROM cast_1m
  WHERE measurement_type = 'temperature_ave' AND direction = 'd' AND measurement_qual IS NULL
    AND site_key IN ({SITES*}) AND depth_m <= {ZMAX}
  GROUP BY ALL ORDER BY site_key, depth_m")
d_norm <- q("
  SELECT site_key, depth_bin + 5 AS depth_m, clim_mean AS temp, clim_sd AS sd, n_cruises FROM climatology
  WHERE measurement_type = 'temperature_ave' AND dataset_key = 'calcofi_ctd-cast' AND month = 11 AND clim_mean IS NOT NULL
    AND depth_bin IS NOT NULL AND site_key IN ({SITES*}) AND depth_bin + 5 <= {ZMAX}
  ORDER BY site_key, depth_bin")
d_prev <- q("
  SELECT site_key, cruise_key, cruise_year AS yr, depth_bin + 5 AS depth_m, v AS temp FROM cell
  WHERE dataset_key = 'calcofi_ctd-cast' AND cruise_month = 11 AND cruise_key <> {CRUISE}
    AND site_key IN ({SITES*}) AND depth_bin + 5 <= {ZMAX}
  ORDER BY site_key, cruise_key, depth_bin")
d_peak <- d_cell26 |>
  filter(site_key %in% SITES) |>
  group_by(site_key) |> slice_max(anom, n = 1) |> ungroup() |>
  mutate(depth_m = depth_bin + 5)
d_lab <- tibble(
  site_key = SITES[1], temp = 15.2, depth_m = c(96, 108, 120, 138),
  label    = c("31 Oct – 1 Nov 2026", "November 2015", "November normal\n1993–2013, ± 1 sd", "every other November"),
  col      = c(COL_2026, COL_2015, COL_NORM, STONE),
  lw       = c(1.1, 0.8, 0.9, 0.35))

ggplot(mapping = aes(temp, depth_m)) +
  geom_ribbon(data = d_norm, aes(xmin = temp - sd, xmax = temp + sd), fill = COL_NORM, alpha = 0.15, orientation = "y") +
  geom_path(data = filter(d_prev, yr != 2015), aes(group = cruise_key), colour = STONE, linewidth = 0.35) +
  geom_path(data = filter(d_prev, yr == 2015), aes(group = cruise_key), colour = COL_2015, linewidth = 0.8) +
  geom_path(data = d_norm, colour = COL_NORM, linewidth = 0.9) +
  geom_path(data = d_2026, colour = COL_2026, linewidth = 1.1) +
  geom_segment(
    data = d_peak, aes(x = clim_mean, xend = v, yend = depth_m), colour = INK, linewidth = 0.4,
    arrow = arrow(length = unit(4, "pt"), ends = "both")) +
  geom_text(data = d_peak, aes(x = (clim_mean + v) / 2, y = depth_m - 5, label = paste(fs(anom), "°C")), colour = INK, size = 3.5, fontface = "bold") +
  geom_text(data = d_lab, aes(label = label), colour = INK, size = 3.1, hjust = 0, vjust = 0.8, lineheight = 0.9) +
  geom_segment(data = d_lab, aes(x = temp - 3.4, xend = temp - 0.6, yend = depth_m), colour = d_lab$col, linewidth = d_lab$lw) +
  facet_wrap(~ site_key, nrow = 1, labeller = as_labeller(lab_site)) +
  scale_y_reverse(limits = c(ZMAX, 0), expand = c(0, 0), breaks = seq(0, ZMAX, 20)) +
  scale_x_continuous(limits = c(9, 27.5), breaks = seq(10, 26, 4), position = "top") +
  labs(
    title    = "Line 93.3 off San Diego County: a 25 °C layer reaches 55 m, where the water is normally 12 °C",
    subtitle = glue("Temperature (°C) against depth (m), {trimws(format(min(sfc$t0[sfc$site_key %in% SITES]), '%e %B'))} – {trimws(format(max(sfc$t0[sfc$site_key %in% SITES]), '%e %B %Y'))}, beside the November normal and every other November cruise ({min(d_prev$yr)}–{max(d_prev$yr)})"),
    x = NULL, y = "Depth (m)",
    caption  = glue(
      "Normal: the 1993–2013 mean per 10 m depth bin for cruises whose month is November ({min(d_norm$n_cruises)}–{max(d_norm$n_cruises)} cruises at these stations). The arrow is each station's largest measured departure.\n",
      "CalCOFI CTD, R/V Sally Ride; CalCOFI Integrated Database release {VER} (doi:{CAT$doi}). Preliminary data.  calcofi.io")) +
  theme_story() +
  theme(panel.spacing = unit(14, "pt"))
Four panels of temperature profiles from the surface to 160 metres. In every panel the 2026 profile stands far to the warm side of the normal and of every earlier November, with a uniform layer near 25 degrees Celsius reaching about 55 metres.
Figure 2: Temperature against depth at the four inshore stations of line 93.3, off northern San Diego County. Red is the fall 2026 cast at 1 m resolution. Blue is the November normal (the 1993–2013 mean, with a band of one standard deviation). Grey lines are every other November cruise with a CTD cast at the station; gold is November 2015, the previous record. The arrow marks each station’s largest measured departure from normal. Preliminary data.

Both figures may be reproduced with credit to CalCOFI. Click a figure to enlarge it; the code that draws each one is folded above it, and everything on this page is computed from the public release when the page is rendered.

In thirty seconds

The same data as an animation, without sound: the nine November cruises behind the normal, the normal itself, each November since 2014 as its difference from that normal on one fixed colour scale, and the section of line 93.3 under the sea surface. The file can be downloaded (5.7 MB, 1920 × 1080), as can its last frame. Its first render, from release v2026.11.09 with the same numbers, is on YouTube. How it is made is under Code.

1 What CalCOFI measures, and what “normal” means here

The California Cooperative Oceanic Fisheries Investigations (CalCOFI) has occupied a fixed grid of stations off California since 1949, four times a year in recent decades (Bograd et al. 2003; McClatchie 2014). At each station a CTD (an instrument that records conductivity, temperature and depth) is lowered to about 500 m, and water is collected in bottles at about 20 depths. The stations sit on numbered lines that run offshore from the coast: line 93.3 leaves the coast north of San Diego, line 90.0 at Dana Point and line 86.7 near Santa Monica Bay.

This page uses the CalCOFI Integrated Database, release v2026.11.12 (https://doi.org/10.5281/zenodo.24187468), in which two temperature series reach back through the record:

  • the CTD series (temperature_ave, the average of the instrument’s two sensors), 1993–2026, with a value every 10 m;
  • the bottle series (temperature), 1949–2021, at the bottle depths.

Normal is the release’s own climatology table: for each station, each 10 m depth bin and each calendar month, the mean of everything measured there on cruises of that month during 1993–2013, kept only where at least five cruises contribute. A departure (an anomaly) is a measurement minus the normal of its own station, depth and month. It is the same baseline the Explorer and the CTD transects subtract. Where no normal exists a departure is left blank; it is never treated as zero.

The fall cruise does not sail in the same month every year, and that matters for what follows. “November” on this page means the cruises whose median cast date falls in November.

2 The measurement

2.1 Line 93.3, bin by bin

The section plot that first showed the anomaly draws contours, which are interpolated between stations. The table below is what was measured: each 10 m depth bin at the four inshore stations of line 93.3, beside the normal for that bin and the number of 1993–2013 November cruises the normal averages.

code
d_bins <- d_cell26 |>
  filter(line == 93.3, station <= 35, depth_bin <= 100) |>
  arrange(station, depth_bin) |>
  transmute(
    station = site_key, `depth (m)` = glue("{depth_bin}–{depth_bin + 10}"),
    `observed (°C)` = round(v, 2), `normal (°C)` = round(clim_mean, 2), `normal sd` = round(clim_sd, 2),
    `baseline cruises` = n_cruises, `departure (°C)` = round(anom, 2),
    `departure from the Sep–Nov normal (°C)` = round(anom_season, 2))
dt_(d_bins, caption = "Measured 10 m bins on line 93.3, stations 26.7 to 35, fall 2026.")
Table 1
  • The largest measured departure is +12.81 °C (station 30, 40–50 m: 25.00 °C against 12.19 °C). The next station inshore reaches +12.51 °C at 50–60 m and +12.39 °C at 40–50 m. The “12” on the contour plot is measured; it is not made by interpolation.
  • The normal behind each bin is 6 to 8 November cruises.
  • Against the seasonal normal (September to November, 19 cruises) the largest departure is still +11.86 °C.
code
d_sec <- q("
  SELECT site_key, station, depth_bin, v AS observed, clim_mean AS normal, anom AS difference FROM cell
  WHERE cruise_key = {CRUISE} AND dataset_key = 'calcofi_ctd-cast' AND line = 93.3 AND depth_bin < 200
  ORDER BY station, depth_bin") |>
  mutate(km = (station - 26.4) * KM_PER_STATION, depth_m = depth_bin + 5)
d_stn  <- distinct(d_sec, station, km)
grid_x <- seq(min(d_sec$km), max(d_sec$km), by = 1)
# along the line, at each depth bin: linear between the stations that have a value there, never beyond them
along <- function(col) d_sec |>
  filter(!is.na(.data[[col]])) |>
  group_by(depth_m) |> filter(n() >= 2) |>
  reframe(value = approx(km, .data[[col]], xout = grid_x, rule = 1)$y, km = grid_x) |>
  filter(!is.na(value))

sec_panel <- function(col, title, pal, lim, brk, legend, top = NULL, bottom = NULL) {
  d <- along(col)
  ggplot(d, aes(km, depth_m)) +
    geom_raster(aes(fill = value), interpolate = T) +
    geom_contour(aes(z = value), breaks = seq(-20, 40, 2), colour = "white", linewidth = 0.25, alpha = 0.7) +
    geom_point(data = d_stn, aes(km, 0), shape = 25, size = 2, fill = INK, colour = INK, inherit.aes = F) +
    scale_fill_gradientn(
      colours = pal, limits = lim, breaks = brk, oob = scales::squish, name = legend,
      guide = guide_colourbar(barheight = unit(95, "pt"), barwidth = unit(8, "pt"), frame.colour = STONE, ticks.colour = "white")) +
    scale_x_reverse(
      expand = c(0, 0), name = bottom,
      sec.axis = dup_axis(breaks = d_stn$km, labels = d_stn$station, name = top)) +
    scale_y_reverse(expand = c(0, 0), limits = c(200, -6), breaks = seq(0, 200, 50)) +
    labs(subtitle = title, y = "Depth (m)") +
    theme_story() +
    theme(
      legend.position = "right", legend.title = element_text(size = 9), legend.text = element_text(size = 8.5, colour = MUTED),
      plot.subtitle = element_text(colour = INK, face = "bold", size = rel(0.95), margin = margin(b = 2)),
      axis.title.x.top = element_text(size = 9, colour = MUTED, hjust = 0), axis.title.x.bottom = element_text(size = 10.5),
      panel.grid = element_blank(), panel.background = element_rect(fill = "#eef0f2", colour = NA))}

pal_temp <- cmocean("thermal")(256)
p_norm <- sec_panel("normal",     "The November normal, 1993–2013",             pal_temp, c(8, 26), seq(8, 26, 6), "°C", top = "station")
p_obs  <- sec_panel("observed",   "Measured, 31 October – 1 November 2026",      pal_temp, c(8, 26), seq(8, 26, 6), "°C")
p_diff <- sec_panel("difference", "The difference: how much warmer than normal", pal_warm, c(0, ANOM_MAX), seq(0, 12, 3), "°C above\nnormal",
                    bottom = "Distance offshore along the line (km)")
stopifnot(min(d_sec$difference, na.rm = T) > -0.5)   # the warm-only scale hides nothing below zero

times <- c("twice", "three times", "four times", "five times")[floor(mean(d_mld$mld) / mean(d_mld$clim)) - 1]
p_norm / p_obs / p_diff +
  plot_annotation(
    title   = glue("Line 93.3: the warm surface layer is more than {times} its normal thickness"),
    caption = glue("CalCOFI CTD, 10 m depth bins; CalCOFI Integrated Database release {VER} (doi:{CAT$doi}). Preliminary data.  calcofi.io"),
    theme   = theme_story())
Three stacked depth sections. The normal shows a thin warm surface layer over cold water. The 2026 section shows warm water from the surface to about 60 metres inshore. The difference peaks at 40 to 60 metres depth near the coast.
Figure 3: Line 93.3 from 175 km offshore (left) to the coast (right), surface to 200 m: the November normal, what was measured on 31 October and 1 November 2026, and the difference. Triangles mark the stations; between them the values are interpolated along the line at each depth. Isotherms every 2 °C. Blank areas are below the sea floor or below the cast. Preliminary data.

2.2 What kind of anomaly this is

Read the profiles before the numbers. At stations 26.7, 28 and 30 the cruise found a mixed layer of about 25 °C reaching 55–57 m (by a density criterion of 0.125 kg m⁻³, one of the standard thresholds (Levitus 1982; Boyer Montégut et al. 2004); the November normal there is 15–17 m). Below it the temperature falls steeply. The departure peaks at 40–60 m because that is where a normal November has already dropped into the cold water of the thermocline. The sea surface was about 7 °C above normal; the thickness of the layer adds the rest.

The water is also a different water mass. Salinity in the layer is 34.43–34.48 at stations 28 and 30, 0.94 to 1.16 above the November normal, where the normal’s own standard deviation is about 0.11. Warming the local surface layer does not change its salt. The water mass takes this up below.

2.3 One spot, 76 years

code
d_hist <- q("
  SELECT cruise_key, dataset_key, cruise_year, cruise_month, datetime, v, anom, clim_mean FROM cell
  WHERE site_key = {k$top_site} AND depth_bin = {k$top_bin}") |>
  mutate(
    date   = as.Date(datetime),
    series = if_else(dataset_key == "calcofi_bottle", "bottle", "CTD"),
    nov    = cruise_month == 11)
h_prev <- d_hist |> filter(cruise_key != CRUISE) |> slice_max(v, n = 1, with_ties = F)
h_lab  <- bind_rows(
  d_hist |> filter(cruise_key == CRUISE) |> mutate(label = glue("{format(date, '%e %b %Y') |> trimws()}: {f1(v)} °C")),
  h_prev |> mutate(label = glue("{format(date, '%e %b %Y') |> trimws()}: {f1(v)} °C")))

ggplot(d_hist, aes(date, v)) +
  geom_hline(yintercept = k$top_clim, colour = COL_NORM, linewidth = 0.5) +
  geom_point(data = \(d) filter(d, !nov), colour = STONE, size = 1.1, alpha = 0.7) +
  annotate("label", x = as.Date("1968-06-01"), y = k$top_clim, label = glue("November normal {f1(k$top_clim)} °C"), colour = INK, fill = "white", size = 3.2, linewidth = 0, border.colour = NA) +
  geom_point(data = \(d) filter(d, nov), aes(shape = series), colour = COL_NORM, size = 2.2, stroke = 0.8) +
  geom_point(data = \(d) filter(d, cruise_key == CRUISE), colour = COL_2026, size = 3.4) +
  geom_text(data = h_lab, aes(label = label), colour = INK, size = 3.4, hjust = 1, nudge_x = -500, fontface = "bold") +
  scale_shape_manual(values = c(bottle = 1, CTD = 16)) +
  scale_x_date(breaks = as.Date(paste0(seq(1950, 2020, 10), "-01-01")), date_labels = "%Y", expand = expansion(mult = c(0.01, 0.03))) +
  scale_y_continuous(breaks = seq(10, 26, 4)) +
  labs(
    title    = "Station 93.3 30.0, 40–50 m depth: nothing like it in any month since 1950",
    subtitle = glue("Temperature (°C) on {n_distinct(d_hist$cruise_key)} cruises. Colour: November cruises (open: bottle, filled: CTD). Grey: every other month."),
    x = NULL, y = NULL) +
  theme_story()
Scatter of temperature against year at one station and depth from 1950 to 2026. Values lie between 10 and 18 degrees Celsius in every month and year, except a single point at 25 degrees in 2026.
Figure 4: Every temperature CalCOFI has measured at 40–50 m depth at station 93.3 30.0. November cruises are in colour (open circles: bottle samples; filled: CTD); every other month is grey. The line is the 1993–2013 November normal. Preliminary data for 2026.

Across all months, 265 cruises since 1950 have sampled this depth at this station. The warmest before this cruise was 18.11 °C (29 October 2015, on the November 2015 cruise).

3 Is it real?

A 12.8 °C departure is the first thing an oceanographer will challenge. These are the checks, from the instrument outward.

3.1 The data’s stage and its quality flags

code
d_stage <- q("
  SELECT data_stage, count(*) AS casts FROM sample
  WHERE cruise_key = {CRUISE} AND dataset_key = 'calcofi_ctd-cast' AND sample_type = 'cast' GROUP BY ALL")
d_flag <- q("
  SELECT f.measurement_type, f.measurement_qual AS flag, count(*) AS values, count(DISTINCT f.sample_key) AS casts,
         min(f.depth_min_m) AS depth_min_m, max(f.depth_min_m) AS depth_max_m,
         string_agg(DISTINCT s.site_key, ', ' ORDER BY s.site_key) AS stations
  FROM obs_ctd_full f JOIN sample s USING (sample_key)
  WHERE f.measurement_qual IS NOT NULL AND f.measurement_type LIKE 'temperature%'
  GROUP BY ALL")
n_prelim <- q("SELECT count(*) AS n, min(cruise_key) AS first FROM cruise_ref WHERE ctd_stage LIKE 'preliminary%'")
kable(d_flag, caption = "Every flagged temperature value on the cruise (CTD codes: 8 questionable, 9 bad or missing).")
Table 2: Every flagged temperature value on the cruise (CTD codes: 8 questionable, 9 bad or missing).
measurement_type flag values casts depth_min_m depth_max_m stations
temperature_1 9 24 1 1 24 093.3 045.0

All 72 casts of the cruise (36 stations, down and up) carry data_stage preliminary_with_bottle: one-metre averages processed at sea, before final calibration. So does every CTD cruise since 2021-07-33P4 in this release (22 cruises). The only flagged temperatures are on one up cast, on the primary sensor, and the sensor-pair average the analysis uses already leaves them out. Nothing on line 93.3 is flagged.

3.2 Two sensors, two passes

code
d_pair <- q("
  SELECT a.site_key, a.direction, a.depth_m, a.value AS t1, b.value AS t2
  FROM cast_1m a JOIN cast_1m b USING (sample_key, depth_m)
  WHERE a.measurement_type = 'temperature_1' AND b.measurement_type = 'temperature_2'
    AND a.measurement_qual IS NULL AND b.measurement_qual IS NULL")
d_du <- q("
  SELECT site_key, depth_m, max(value) FILTER (WHERE direction = 'd') AS down, max(value) FILTER (WHERE direction = 'u') AS up
  FROM cast_1m WHERE measurement_type = 'temperature_ave' AND measurement_qual IS NULL GROUP BY ALL") |>
  filter(!is.na(down), !is.na(up))
d_gap <- q("
  SELECT site_key, date_diff('minute', min(datetime) FILTER (WHERE direction = 'd'), max(datetime) FILTER (WHERE direction = 'u')) AS minutes
  FROM cast_1m WHERE measurement_type = 'temperature_ave' AND depth_m <= 40 AND site_key IN ({core*}) GROUP BY site_key")
chk <- list(
  pair_all  = d_pair |> filter(depth_m <= 100) |> summarize(n = n(), mean = mean(t1 - t2), p99 = quantile(abs(t1 - t2), 0.99)),
  pair_core = d_pair |> filter(site_key %in% core, depth_m <= 50) |> summarize(n = n(), max = max(abs(t1 - t2)), median = median(abs(t1 - t2))),
  du_core   = d_du   |> filter(site_key %in% core, depth_m <= 40) |> summarize(n = n(), mean = mean(abs(down - up)), max = max(abs(down - up))),
  du_base   = d_du   |> filter(site_key %in% core, between(depth_m, 50, 65)) |> summarize(max = max(abs(down - up))),
  gap       = range(d_gap$minutes))

The CTD carries two independent temperature sensors. Through the warm layer at stations 28 and 30 (the top 50 m, 200 one-metre values) they never differ by more than 0.006 °C; half of the values differ by 0.4 thousandths of a degree or less. Over every cast of the cruise, in the top 100 m, their mean difference is 0.0025 °C.

Each station is also measured twice, on the way down and on the way up. At those two stations the two passes through the top 40 m are 46 to 48 minutes apart and differ by 0.05 °C on average. At the base of the layer (50–65 m) they differ by up to 1.4 °C: internal waves lift and drop that boundary by a few metres within the hour. That moves the 50–60 m bin. It does not move the 40–50 m bin, which lies inside the layer on both passes.

3.3 Bottles: salinity and oxygen

code
d_btl <- q("
  SELECT site_key, depth_m,
         max(value) FILTER (WHERE measurement_type = 'temperature_ave')   AS t,
         max(value) FILTER (WHERE measurement_type = 'salinity_1')        AS s_ctd,
         max(value) FILTER (WHERE measurement_type = 'salinity_btl')      AS s_btl,
         max(value) FILTER (WHERE measurement_type = 'sigma_theta_1')     AS sigma,
         max(value) FILTER (WHERE measurement_type = 'oxygen_btl_ml_l')   AS o2_btl
  FROM cast_1m WHERE direction = 'u' AND site_key IN ({core*}) AND depth_m <= 60
  GROUP BY ALL HAVING s_btl IS NOT NULL OR o2_btl IS NOT NULL ORDER BY site_key, depth_m") |>
  left_join(
    d_cell26 |> transmute(site_key, depth_bin, t_normal = clim_mean),
    by = join_by(site_key, closest(depth_m >= depth_bin))) |>
  mutate(
    # oxygen solubility (Garcia & Gordon 1992, via gsw), umol/kg -> mL/L
    o2_sat        = gsw_O2sol_SP_pt(s_ctd, t)        * (1000 + sigma) / 1000 / 44.66,
    o2_sat_normal = gsw_O2sol_SP_pt(s_ctd, t_normal) * (1000 + sigma) / 1000 / 44.66)
d_btl |>
  transmute(
    station = site_key, `depth (m)` = depth_m, `CTD temperature (°C)` = round(t, 2),
    `CTD salinity` = round(s_ctd, 3), `bottle salinity` = round(s_btl, 3), difference = round(s_btl - s_ctd, 3),
    `bottle oxygen (mL/L)` = round(o2_btl, 2), `saturation at the measured temperature` = round(o2_sat, 2),
    `saturation at the normal temperature` = round(o2_sat_normal, 2)) |>
  kable(caption = "Water samples from the warm layer at stations 28 and 30, beside the CTD on the up cast.")
Table 3: Water samples from the warm layer at stations 28 and 30, beside the CTD on the up cast.
station depth (m) CTD temperature (°C) CTD salinity bottle salinity difference bottle oxygen (mL/L) saturation at the measured temperature saturation at the normal temperature
093.3 028.0 2 25.01 34.434 34.435 0.001 4.75 5.37
093.3 028.0 11 24.98 34.433 34.434 0.001 4.83 4.75 5.44
093.3 028.0 30 24.97 34.432 4.82 4.76 5.87
093.3 028.0 50 24.94 34.425 34.426 0.002 4.80 4.76 6.06
093.3 030.0 1 25.06 34.471 34.473 0.002 4.89 4.75 5.36
093.3 030.0 12 25.04 34.469 34.468 -0.001 4.75 5.48
093.3 030.0 25 24.95 34.445 4.79 4.76 5.65

Salinity is measured twice by unrelated methods: the CTD computes it from conductivity and temperature, and a salinometer measures it on the bottled water samples in the ship’s laboratory. In the warm layer the two agree to within 0.002. A temperature error of only 0.1 °C would shift the CTD’s salinity by 0.08 and break that agreement; an error of several degrees is out of the question.

The oxygen titrated from the same bottles (4.79–4.89 mL/L down to 50 m) is what a mixed layer in contact with the air holds at 25 °C (saturation 4.75 mL/L). Water at the normal temperature of those depths would hold about 5.7 mL/L.

3.4 The baseline: is the normal the right normal?

code
# the record cell against every reasonable definition of its normal
b_cells <- q("
  SELECT cruise_key, cruise_year, v, n_obs FROM cell
  WHERE dataset_key = 'calcofi_ctd-cast' AND site_key = {k$top_site} AND depth_bin = {k$top_bin} AND cruise_month = 11 AND cruise_key <> {CRUISE}")
b_in  <- b_cells |> filter(between(cruise_year, 1993, 2013))
b_loo <- map_dbl(seq_len(nrow(b_in)), \(i) with(b_in[-i, ], sum(v * n_obs) / sum(n_obs)))
b_btl <- q("
  SELECT clim_mean, n_cruises FROM climatology
  WHERE measurement_type = 'temperature' AND dataset_key = 'calcofi_bottle' AND site_key = {k$top_site} AND depth_bin = {k$top_bin} AND month = 11")
# the same baseline cruises from their FULL one-metre casts (obs_ctd_full), not the thinned series the normal is built from
release_view("obs_ctd_full", parts = b_in$cruise_key, name = "obs_ctd_full_base")
b_full <- q("
  SELECT f.cruise_key, avg(f.measurement_value) AS v, count(*) AS n
  FROM obs_ctd_full_base f JOIN sample s USING (sample_key)
  WHERE f.measurement_type = 'temperature_ave' AND f.measurement_qual IS NULL AND s.site_key = {k$top_site}
    AND f.depth_min_m >= {k$top_bin} AND f.depth_min_m < {k$top_bin + 10}
  GROUP BY f.cruise_key")
stopifnot(nrow(b_full) == nrow(b_in))
# fall 2026 from its own one-metre casts, for the row that uses one-metre normals (like with like)
v26_full <- q("
  SELECT avg(value) AS v FROM cast_1m
  WHERE site_key = {k$top_site} AND measurement_type = 'temperature_ave' AND measurement_qual IS NULL
    AND depth_m >= {k$top_bin} AND depth_m < {k$top_bin + 10}")$v
d_base <- tribble(
  ~`definition of normal`,                                                             ~cruises,                ~normal,          ~value,
  "the release's climatology: every 1993–2013 November value in the bin (used on this page)", top$n_cruises,     top$clim_mean,    top$v,
  "the same cruises, one value per cruise",                                            nrow(b_in),               mean(b_in$v),     top$v,
  "the same cruises and fall 2026 from their full one-metre casts, not the thinned series", nrow(b_full),        mean(b_full$v),   v26_full,
  "leaving out each baseline cruise in turn: the lowest normal",                       nrow(b_in) - 1L,          min(b_loo),       top$v,
  "leaving out each baseline cruise in turn: the highest normal",                      nrow(b_in) - 1L,          max(b_loo),       top$v,
  "every earlier November cruise with a CTD cast, to 2025, one value per cruise",      nrow(b_cells),            mean(b_cells$v),  top$v,
  "the bottle series' own climatology for the cell",                                   b_btl$n_cruises,          b_btl$clim_mean,  top$v,
  "the release's seasonal normal (September to November)",                             top$season_n_cruises,     top$season_mean,  top$v) |>
  mutate(`normal (°C)` = round(normal, 2), `fall 2026 (°C)` = round(value, 2), `departure (°C)` = round(value - normal, 2)) |>
  select(-normal, -value)
kable(d_base, caption = glue("The departure at the record cell (station 93.3 30.0, 40–50 m) under {nrow(d_base)} definitions of normal."))
Table 4: The departure at the record cell (station 93.3 30.0, 40–50 m) under 8 definitions of normal.
definition of normal cruises normal (°C) fall 2026 (°C) departure (°C)
the release’s climatology: every 1993–2013 November value in the bin (used on this page) 6 12.19 25.00 12.81
the same cruises, one value per cruise 6 12.38 25.00 12.62
the same cruises and fall 2026 from their full one-metre casts, not the thinned series 6 12.18 24.92 12.73
leaving out each baseline cruise in turn: the lowest normal 5 12.00 25.00 13.00
leaving out each baseline cruise in turn: the highest normal 5 12.35 25.00 12.65
every earlier November cruise with a CTD cast, to 2025, one value per cruise 16 13.21 25.00 11.79
the bottle series’ own climatology for the cell 8 13.00 25.00 12.00
the release’s seasonal normal (September to November) 19 13.55 25.00 11.45

The normal is thin, 6 cruises at this cell, so the table asks how much the answer depends on it. Under every definition the departure is between 11.4 and 13.0 °C.

Timing within the season is the other way a baseline can mislead. The cruise worked the inshore end of line 93.3 on 31 October and 1 November. The 8 cruises behind the November normal there were on station between 25 October and 11 November (median 4 November), so the cruise sits inside their range, about 4 days ahead of its middle. The surface normal falls by about 2 °C from October to November, so the calendar can account for a few tenths of a degree at the surface, not more. The seasonal normal in the last row is the conservative bound.

3.5 The thinned series against the full profile

The release’s main table keeps a thinned CTD series (a value every 10 m plus the points where the profile bends), and the normal was built from the same series. The check is whether a 10 m bin mean of the thinned series stands for the full one-metre profile.

code
d_thin <- q("
  WITH f AS (
    SELECT site_key, CAST(floor(depth_m / 10) * 10 AS INTEGER) AS depth_bin, avg(value) AS v_full
    FROM cast_1m WHERE measurement_type = 'temperature_ave' AND measurement_qual IS NULL AND direction = 'd' GROUP BY ALL)
  SELECT c.site_key, c.depth_bin, c.v, f.v_full, c.v - f.v_full AS diff
  FROM cell c JOIN f USING (site_key, depth_bin) WHERE c.cruise_key = {CRUISE} AND c.depth_bin < 200")
thin <- d_thin |> summarize(n = n(), mean = mean(diff), p95 = quantile(abs(diff), 0.95), max = max(abs(diff)))
thin_top <- d_thin |> filter(site_key == k$top_site, depth_bin == k$top_bin)

Over the 588 bins of the cruise above 200 m, the thinned bin mean differs from the full down-cast mean by +0.08 °C on average, and by less than 0.29 °C in 95 % of bins (the largest differences are in the thermocline, where a few points stand for a steep gradient). At the record cell the two are 25.00 and 24.97 °C.

code
# the same comparison on the six baseline cruises read at one metre, at the cruise's stations, bins 10 to 40 m
d_thinb <- q("
  WITH f AS (
    SELECT o.cruise_key, s.site_key, CAST(floor(o.depth_min_m / 10) * 10 AS INTEGER) AS depth_bin, avg(o.measurement_value) AS v_full
    FROM obs_ctd_full_base o JOIN sample s USING (sample_key)
    WHERE o.measurement_type = 'temperature_ave' AND o.measurement_qual IS NULL AND o.depth_min_m < 50 GROUP BY ALL)
  SELECT c.depth_bin, count(*) AS cells, avg(c.v - f.v_full) AS thinned_minus_1m, avg(c.depth_m - c.depth_bin) AS m_below_bin_top
  FROM cell c JOIN f USING (cruise_key, site_key, depth_bin)
  WHERE c.dataset_key = 'calcofi_ctd-cast' AND c.depth_bin BETWEEN 10 AND 40 AND c.site_key IN ({unique(d_sta$site_key)*})
  GROUP BY c.depth_bin ORDER BY c.depth_bin")

In stratified water the thinned bin mean runs a little warm. In the six baseline cruises read at one metre, at these stations, it is 0.09 to 0.22 °C warmer than the one-metre bin mean in the bins between 10 and 50 m, because its points sit 2.6 m below the top of the bin on average where a one-metre series sits 4.5 m. The normal is built from that same thinned series, so a departure on this page compares like with like. A departure computed from one-metre values against this normal reads low by that amount in ordinary, stratified years; in fall 2026, when the upper 50 m was mixed, the two agree.

3.6 Are the stations where they should be?

code
d_pos <- q("
  WITH h AS (
    SELECT site_key, median(latitude) AS lat0, median(longitude) AS lon0, count(DISTINCT cruise_key) AS n_cruises
    FROM cell WHERE cruise_key <> {CRUISE} AND depth_bin = 0 GROUP BY site_key)
  SELECT c.site_key, c.latitude, c.longitude, h.lat0, h.lon0, h.n_cruises
  FROM cell c JOIN h USING (site_key) WHERE c.cruise_key = {CRUISE} AND c.depth_bin = 0") |>
  mutate(km = as.numeric(st_distance(
    st_as_sf(pick(longitude, latitude), coords = c("longitude", "latitude"), crs = 4326),
    st_as_sf(pick(lon0, lat0), coords = c("lon0", "lat0"), crs = 4326), by_element = T)) / 1000)

A cast filed under the wrong station would be compared with the wrong normal. Each of the cruise’s 36 stations with a history lies within 3.2 km of the median position of every earlier occupation of that station (median 0.09 km).

3.7 Buoys

code
# the cast list the outside-sources script reads: one row per station, from the release
d_casts <- q("
  WITH c AS (
    SELECT sample_key, site_key, min(datetime) AS t0, avg(latitude) AS lat, avg(longitude) AS lon,
           avg(value) FILTER (WHERE depth_m <= 3) AS t_top3m, avg(value) FILTER (WHERE depth_m < 10) AS t_0_10m, max(depth_m) AS zmax
    FROM cast_1m WHERE measurement_type = 'temperature_ave' AND measurement_qual IS NULL AND direction = 'd' GROUP BY ALL)
  SELECT site_key, replace(sample_key, 'calcofi_ctd-cast:cast:', '') AS cast_id, strftime(t0, '%Y-%m-%dT%H:%M:%SZ') AS time_utc,
         round(lat, 4) AS lat, round(lon, 4) AS lon, round(t_top3m, 3) AS ctd_t_top3m, round(t_0_10m, 3) AS ctd_t_0_10m, zmax
  FROM c ORDER BY t0")
write_csv(d_casts, file.path(DIR_DATA, "casts.csv"), na = "")

# the outside sources are fetched once by scripts/temperature_anomaly_outside_sources.py (NDBC keeps 45 days only)
# and kept in the repo; a missing file means that script has not been run
f_out <- file.path(DIR_DATA, c("buoy_stations.csv", "buoys_at_casts.csv", "buoy_series.csv", "satellite_at_casts.csv", "argo_profiles.csv", "sources.csv", "pier_daily.csv", "glider_index.csv"))
stopifnot("run scripts/temperature_anomaly_outside_sources.py first" = all(file.exists(f_out)))
buoy_name <- function(x) str_remove(x, ",? CA\\b.*$") |> str_to_title()   # "Torrey Pines Outer, CA (100)" -> "Torrey Pines Outer"
d_bstn  <- read_csv(f_out[1]) |> mutate(name = buoy_name(name))
d_bpair <- read_csv(f_out[2]) |> mutate(buoy_name = buoy_name(buoy_name))
d_bser  <- read_csv(f_out[3]) |> mutate(time = as.POSIXct(hour_utc, format = "%Y-%m-%dT%H:%MZ", tz = "UTC"))
d_sat   <- read_csv(f_out[4])
d_argo  <- read_csv(f_out[5])
d_osrc  <- read_csv(f_out[6])
d_pier  <- read_csv(f_out[7]) |> mutate(yr = as.integer(format(date, "%Y")), md = format(date, "%m-%d"))
d_gl    <- read_csv(f_out[8], col_types = "cd") |> mutate(date = as.Date(paste0(month, "-15")))

Moored buoys report water temperature near the surface every half hour, through the National Data Buoy Center. They are operated by other programs (most of these by the Coastal Data Information Program at Scripps (Coastal Data Information Program 1975)) and share nothing with the ship’s instruments. The table pairs each cast with every buoy within 15 km, at the buoy report nearest in time.

code
d_bpair |>
  transmute(
    station = site_key, `cast (UTC)` = sub("T", " ", sub(":\\d\\dZ$", "", cast_time_utc)),
    `CTD, top 3 m (°C)` = round(ctd_t_top3m, 2), buoy = glue("{buoy_name} ({buoy})"), `km apart` = km_apart,
    `buoy (°C)` = buoy_wtmp, `buoy − CTD (°C)` = buoy_minus_ctd,
    `buoy range, ±12 h (°C)` = glue("{buoy_24h_min}–{buoy_24h_max}")) |>
  kable(caption = "Buoy water temperature beside the CTD (buoys report to 0.1 °C).")
Table 5: Buoy water temperature beside the CTD (buoys report to 0.1 °C).
station cast (UTC) CTD, top 3 m (°C) buoy km apart buoy (°C) buoy − CTD (°C) buoy range, ±12 h (°C)
093.3 026.7 2026-10-31 18:07:02 24.34 Torrey Pines Outer (46225) 8.5 24.7 0.36 24.3–25.1
093.3 026.7 2026-10-31 18:07:02 24.34 Scripps Nearshore (46254) 10.3 24.0 -0.34 23.9–24.2
093.3 026.7 2026-10-31 18:07:02 24.34 9410230 (LJAC1) 10.8 24.0 -0.34 23.5–24.1
093.4 026.4 2026-10-31 19:13:24 23.83 Scripps Nearshore (46254) 9.3 24.1 0.27 23.9–24.2
093.4 026.4 2026-10-31 19:13:24 23.83 9410230 (LJAC1) 9.6 24.1 0.27 23.6–24.1
093.4 026.4 2026-10-31 19:13:24 23.83 Torrey Pines Outer (46225) 10.4 25.0 1.17 24.3–25.1
093.3 028.0 2026-10-31 20:20:24 25.00 Torrey Pines Outer (46225) 2.3 25.1 0.10 24.6–25.1
093.3 028.0 2026-10-31 20:20:24 25.00 Scripps Nearshore (46254) 12.9 24.1 -0.90 23.9–24.2
093.3 028.0 2026-10-31 20:20:24 25.00 9410230 (LJAC1) 13.8 24.1 -0.90 23.7–24.1
093.3 030.0 2026-10-31 22:43:16 25.08 Mission Bay West (46258) 11.2 24.5 -0.57 24.1–25.1
086.7 055.0 2026-11-04 23:07:52 19.08 San Nicolas Island (46219) 13.3 19.1 0.03 18.9–19.1
086.7 035.0 2026-11-05 12:31:30 22.97 Santa Monica Bay (46221) 4.3 22.8 -0.17 22.7–23.5
088.5 030.1 2026-11-05 19:57:03 22.92 Long Beach Channel (46256) 10.5 23.0 0.08 22.9–23.1
088.5 030.1 2026-11-05 19:57:03 22.92 San Pedro South (46253) 12.5 24.1 1.18 23.1–24.1

The closest pair is 2.3 km and a few minutes apart: the Torrey Pines Outer buoy read 25.1 °C when the CTD read 25.00 °C at station 093.3 028.0. The buoy nearest each of 7 casts (2–13 km away) reads within 0.6 °C of the CTD, including the cool side of the front (19.1 °C at San Nicolas Island against the CTD’s 19.07 °C). Pairs farther apart differ by up to 1.2 °C, which is the front itself.

code
SHOW <- c("46225", "46254", "46219", "46047")
d_b  <- d_bser |> filter(buoy %in% SHOW) |>
  left_join(select(d_bstn, buoy, name), by = "buoy") |>
  mutate(buoy = factor(buoy, SHOW))
col_b  <- setNames(c("#b3261e", "#c69214", "#00629b", "#457a1c"), SHOW)
d_end  <- d_b |> group_by(buoy, name) |> slice_max(time, n = 1) |> ungroup()
d_ctd  <- d_bpair |> filter(buoy %in% SHOW) |> group_by(buoy) |> slice_min(km_apart, n = 1) |> ungroup() |>
  mutate(time = as.POSIXct(cast_time_utc, format = "%Y-%m-%dT%H:%M:%SZ", tz = "UTC"), buoy = factor(buoy, SHOW))

ggplot(d_b, aes(time, wtmp, colour = buoy)) +
  annotate("rect", xmin = as.POSIXct(cr$date_min, tz = "UTC"), xmax = as.POSIXct(cr$date_max + 1, tz = "UTC"), ymin = -Inf, ymax = Inf, fill = SAND) +
  annotate("text", x = as.POSIXct(cr$date_min, tz = "UTC") + 3.5 * 86400, y = 26.2, label = "the cruise", colour = MUTED, size = 3.1) +
  geom_line(linewidth = 0.5) +
  geom_point(data = d_ctd, aes(y = ctd_t_top3m), shape = 21, fill = "white", colour = INK, size = 2.6, stroke = 0.8) +
  geom_text_repel(
    data = d_end, aes(label = name), colour = INK, hjust = 0, direction = "y", nudge_x = 1.2 * 86400, size = 3.2,
    segment.colour = MUTED, segment.size = 0.2, min.segment.length = 0, seed = 1, xlim = c(max(d_b$time) + 86400, NA)) +
  scale_colour_manual(values = col_b) +
  scale_x_datetime(date_breaks = "1 week", date_labels = "%e %b", expand = expansion(mult = c(0.01, 0.22))) +
  scale_y_continuous(breaks = seq(18, 26, 2)) +
  labs(
    title    = "The warm water was there for weeks, and the cool water offshore stayed cool",
    subtitle = "Water temperature (°C), hourly means. White dots: the CTD's top 3 m at the nearest cast.",
    x = NULL, y = NULL,
    caption  = "Buoy data from CDIP, Scripps Institution of Oceanography (cdip.ucsd.edu), and NOAA National Data Buoy Center, through NDBC realtime files, read 13 November 2026.") +
  theme_story()
Four time series from late September to mid November 2026. Two inshore buoys vary between 22 and 25.5 degrees Celsius; two offshore buoys between 19 and 22.
Figure 5: Hourly water temperature at four buoys over the 45 days NDBC keeps, with the CTD’s near-surface temperature at the nearest cast (white dots). The two inshore buoys sat at 24–25 °C for weeks before and after the cruise; the two offshore buoys stayed near 19–20 °C.

3.8 Scripps Pier

The shore station on Scripps Pier in La Jolla has its own instruments in the water at the coast and reports temperature and salinity every few minutes (the SCCOOS automated shore station, running since 2013). These are its daily means, of the values that pass the station’s own quality tests. The pier’s much longer manual record, kept daily since 1916 (Carter et al. 2022; Rasmussen et al. 2020), is taken up under context.

code
WIN <- c("08-01", "11-12")
p_long <- d_pier |>
  filter(md >= WIN[1], md <= WIN[2], md != "02-29") |>
  pivot_longer(c(temp, sal), names_to = "var", values_to = "value") |>
  filter(!is.na(value)) |>
  mutate(day = as.Date(paste0("2026-", md)), var = factor(var, c("temp", "sal"), c("Temperature (°C)", "Salinity")))
p_rng <- p_long |> filter(yr < 2026) |> group_by(var, day) |>
  summarize(lo = min(value), hi = max(value), mid = median(value), n = n(), .groups = "drop") |> filter(n >= 8)
p_26  <- p_long |> filter(yr == 2026)

pier_panel <- function(v, ylim, breaks) {
  ggplot(filter(p_26, var == v), aes(day)) +
    annotate("rect", xmin = cr$date_min, xmax = cr$date_max + 1, ymin = -Inf, ymax = Inf, fill = SAND) +
    geom_ribbon(data = filter(p_rng, var == v), aes(ymin = lo, ymax = hi), fill = STONE, alpha = 0.45) +
    geom_line(data = filter(p_rng, var == v), aes(y = mid), colour = MUTED, linewidth = 0.4) +
    geom_line(aes(y = value), colour = COL_2026, linewidth = 0.9) +
    scale_x_date(date_breaks = "2 weeks", date_labels = "%e %b", expand = expansion(mult = 0.01)) +
    scale_y_continuous(breaks = breaks) +
    coord_cartesian(ylim = ylim) +          # the band may leave the axis: a few earlier days dip far below it
    labs(subtitle = v, x = NULL, y = NULL) +
    theme_story() +
    theme(plot.subtitle = element_text(colour = INK, face = "bold", size = rel(0.95), margin = margin(b = 2)))}
s_low    <- p_rng |> filter(var == "Salinity") |> pull(lo) |> min()
s_low_26 <- p_26  |> filter(var == "Salinity") |> slice_min(value, n = 1, with_ties = F)

(pier_panel("Temperature (°C)", c(14, 26), seq(14, 26, 4)) + theme(axis.text.x = element_blank())) /
  pier_panel("Salinity", c(32.8, 34.4), seq(33, 34.4, 0.4)) +
  plot_annotation(
    title    = "At Scripps Pier, on other instruments: the same heat and the same salt",
    subtitle = glue("Daily means. Red: 2026. Grey: the range and median of the same calendar day, {min(d_pier$yr)}–2025."),
    caption  = glue(
      "The salinity axis is cut at 32.8: the earlier range dips below it on some days (to {f1(s_low)}), and so does 2026 in late August (to {f1(s_low_26$value)} on {trimws(format(s_low_26$day, '%e %B'))}).\n",
      "SCCOOS automated shore station, Scripps Pier (Scripps Institution of Oceanography), through the IOOS sensors ERDDAP, read 13 November 2026."),
    theme    = theme_story())
Two time series. Pier temperature in 2026 runs above the earlier range from late October and reaches 24 degrees Celsius in early November, when earlier years were at 16 to 20. Pier salinity in 2026 jumps from 33.6 to 34.25 in the week of the cruise, above anything in the earlier range.
Figure 6: Daily mean temperature and salinity at the Scripps Pier automated shore station from 1 August to 12 November: 2026 in red, over the range of the same calendar day in every earlier year of the record (grey band, 2013–2025) and its median (grey line). The cruise is the shaded week.

On 5 November the pier’s daily mean was 24.14 °C. The highest for that calendar day in the 13 earlier years of the record was 19.85 °C (2014). The pier’s warmest day on record, 25.62 °C, came in August 2018, in high summer.

Salinity is the sharper signal. Before June 2026 the pier’s daily salinity had a median of 33.43 and exceeded 33.71 on one day in a hundred. Six days before the cruise it read 33.60. By 5 November it read 34.24, and 13 of the 20 saltiest days in the whole record are from 31 October onward. The CTD at station 93.3 26.7, 11 km from the pier, read 24.34 °C and 34.27 at the surface on 31 October. The salty water reached the pier during the week of the cruise.

3.9 Satellites

Two satellite analyses of sea-surface temperature, each read at every cast’s position on the cast’s day: NOAA’s OISST (Huang et al. 2021; Reynolds et al. 2007) (a 0.25° blend of satellite, ship and buoy data, here in its preliminary near-real-time version, with its own anomaly against 1971–2000) and JPL’s MUR (Chin et al. 2017) (0.01°; the anomaly is NOAA CoastWatch’s product against the MUR climatology of 2003–2014).

code
d_sat |>
  transmute(
    station = site_key, `cast (UTC)` = sub("T", " ", sub(":\\d\\dZ$", "", cast_time_utc)),
    `CTD, top 3 m (°C)` = round(ctd_t_top3m, 2), `OISST (°C)` = oisst_sst, `OISST anomaly (°C)` = oisst_anom,
    `MUR (°C)` = mur_sst, `MUR anomaly (°C)` = mur_anom) |>
  dt_(caption = "Satellite sea-surface temperature analyses at each cast. An empty cell is a value the data server did not return.")
Table 6

Across the 36 casts with an OISST value, the analysis follows the CTD closely (correlation 0.96) and reads 0.1 °C warmer on average, as a smoothed quarter-degree product does beside a point measurement in a warm pool with sharp edges. MUR, at 36 casts, follows it as closely (correlation 0.97) and reads 0.1 °C cooler on average.

At the 17 stations of the inner Bight that have one, OISST puts the surface 4.4 to 6.4 °C above its own normal, where the CTD reads 5.4 to 8.2 °C above the CalCOFI normal. MUR, at 17 of those stations, reads 4.2 to 6.4 °C above its normal, where the CTD reads 5.4 to 8.2 °C. The baselines differ in period and in kind, and the satellite analyses smooth the sharpest part of the warm pool; they agree with the CTD on the size of the event at the surface.

3.10 Argo floats

code
at_p <- function(p, t, target) { i <- which.min(abs(p - target)); if (abs(p[i] - target) <= 8) t[i] else NA_real_ }
d_ap <- d_argo |>
  group_by(float = platform_number, cycle = cycle_number, time, latitude, longitude) |>
  summarize(
    `5 m` = at_p(pres, temp, 5), `30 m` = at_p(pres, temp, 30), `50 m` = at_p(pres, temp, 50),
    `75 m` = at_p(pres, temp, 75), `100 m` = at_p(pres, temp, 100), salinity_5m = at_p(pres, psal, 5), .groups = "drop") |>
  rowwise() |>
  mutate(
    km_all   = list(as.numeric(st_distance(
      st_sfc(st_point(c(longitude, latitude)), crs = 4326),
      st_as_sf(d_casts, coords = c("lon", "lat"), crs = 4326))) / 1000),
    `nearest station` = d_casts$site_key[which.min(km_all)], `km to it` = round(min(km_all)),
    `CTD there, top 3 m` = d_casts$ctd_t_top3m[which.min(km_all)],
    km_inner = round(min(km_all[d_casts$site_key %in% inner$site_key]))) |>
  ungroup() |> select(-km_all) |>
  mutate(date = as.Date(time), latitude = round(latitude, 2), longitude = round(longitude, 2)) |>
  select(float, cycle, date, latitude, longitude, `5 m`:`100 m`, salinity_5m, `nearest station`, `km to it`, `CTD there, top 3 m`, km_inner) |>
  arrange(date)
km_inner <- min(d_ap$km_inner)
d_ap     <- select(d_ap, -km_inner)
stopifnot(km_inner > 25)   # no float sampled the inner Bight
kable(d_ap, digits = 2, caption = "Argo float profiles in and around the cruise's area, two weeks before it to a week after (temperature in °C at the pressure nearest each depth).")
Table 7: Argo float profiles in and around the cruise’s area, two weeks before it to a week after (temperature in °C at the pressure nearest each depth).
float cycle date latitude longitude 5 m 30 m 50 m 75 m 100 m salinity_5m nearest station km to it CTD there, top 3 m
5905731 303 2026-10-17 34.06 -122.62 18.52 18.39 14.92 12.18 10.67 33.48 086.7 080.0 210 18.34
4903294 254 2026-10-19 33.15 -120.69 19.23 19.05 14.28 12.82 11.33 33.38 086.7 060.0 37 19.17
4903296 254 2026-10-19 34.37 -120.92 20.45 18.79 15.85 14.29 13.72 33.53 083.3 051.0 91 23.14
5906181 236 2026-10-21 34.55 -122.69 19.23 18.65 14.91 11.70 10.57 33.55 083.3 051.0 247 23.14
7901100 87 2026-10-23 30.56 -124.30 20.09 20.07 18.19 16.23 14.07 33.47 090.0 120.0 32 19.64
5905731 304 2026-10-27 34.14 -122.50 18.58 18.59 15.69 11.89 10.85 33.53 086.7 070.0 214 18.21
4903294 255 2026-10-29 33.33 -121.07 18.54 18.50 15.42 13.17 11.91 33.35 086.7 070.0 75 18.21
4903296 255 2026-10-30 34.46 -121.27 21.00 20.52 19.37 17.62 15.35 33.60 083.3 051.0 123 23.14
5905731 305 2026-11-06 34.31 -122.52 18.64 18.59 17.46 12.50 10.88 33.52 083.3 051.0 226 23.14
4903294 256 2026-11-08 33.72 -121.40 19.35 19.07 16.30 13.19 10.75 33.52 083.3 051.0 118 23.14

5 Argo floats (Wong et al. 2020; Argo 2000) surfaced in the area around the cruise. All were over the outer part of the grid or beyond it: none came closer than 32 km to a station, or than 91 km to a station of the inner Bight. They show the offshore structure the cruise found there (surface layers of 18.5–21.0 °C with salinity near 33.5), and so confirm the cool side of the front. The subsurface of the warm pool itself rests on the CTD’s own redundancy: two sensors, two passes, the bottle salinities and the oxygen.

3.11 Verdict

Not an artifact. The normal is the right one (same station, same depth, the cruise’s own month, and the answer barely moves under 7 other definitions). The instrument agrees with itself, with the bottles, with the buoys beside it, with the shore station on Scripps Pier and with the satellite analyses.

4 Where it ranks

The same departure was computed for every cruise, station and 10 m depth bin in the release: the CTD series (143 cruises) and the bottle series (657 cruises), each against its own climatology. Of the 681 cruises, 340 have at least one value with a normal to compare with (why not all).

4.1 Single measurements

code
d_top <- q("
  SELECT row_number() OVER (ORDER BY anom DESC) AS rank, cruise_key, dataset_key, site_key, depth_bin, depth_m,
         CAST(datetime AS DATE) AS date, v, clim_mean, n_cruises, anom
  FROM cell WHERE anom IS NOT NULL AND cruise_key <> {CRUISE} ORDER BY anom DESC LIMIT 15")
d_top |>
  transmute(
    `rank without 2026` = rank, cruise = cruise_key, series = if_else(dataset_key == "calcofi_bottle", "bottle", "CTD"),
    station = site_key, `depth (m)` = glue("{depth_bin}–{depth_bin + 10}"), date,
    `observed (°C)` = round(v, 2), `normal (°C)` = round(clim_mean, 2), `baseline cruises` = n_cruises, `departure (°C)` = round(anom, 2)) |>
  kable(caption = "The largest single departures in the record outside the fall 2026 cruise.")
Table 8: The largest single departures in the record outside the fall 2026 cruise.
rank without 2026 cruise series station depth (m) date observed (°C) normal (°C) baseline cruises departure (°C)
1 2015-11-32OC CTD 093.3 028.0 20–30 2015-10-29 22.19 15.07 6 7.13
2 2015-11-32OC bottle 093.3 028.0 20–30 2015-10-29 22.09 15.32 8 6.77
3 2014-07-32NM CTD 086.7 045.0 20–30 2014-07-13 19.78 13.07 14 6.71
4 2014-11-32NM bottle 093.3 045.0 50–60 2014-11-09 19.02 12.38 8 6.65
5 2015-11-32OC CTD 093.3 030.0 20–30 2015-10-29 21.91 15.38 6 6.53
6 2015-11-32OC bottle 093.3 030.0 20–30 2015-10-29 21.89 15.36 8 6.53
7 1994-01-31JD CTD 093.3 028.0 510–520 1994-01-20 13.90 7.46 13 6.44
8 2014-11-32NM bottle 093.3 045.0 40–50 2014-11-09 19.62 13.24 7 6.38
9 1959-10-31OR bottle 093.3 035.0 100–110 1959-10-09 16.91 10.54 11 6.37
10 2015-11-32OC CTD 093.3 055.0 40–50 2015-10-30 20.44 14.14 5 6.30
11 1959-10-31OR bottle 093.3 035.0 120–130 1959-10-09 16.17 10.01 11 6.16
12 1959-10-31OR bottle 093.3 035.0 70–80 1959-10-09 17.65 11.49 11 6.16
13 1983-11-31JD bottle 090.0 060.0 50–60 1983-11-17 18.69 12.63 9 6.06
14 2015-11-32OC CTD 093.3 030.0 30–40 2015-10-29 19.36 13.34 6 6.03
15 2015-11-32OC bottle 086.7 050.0 50–60 2015-11-12 17.20 11.20 7 6.00

Among the 581,071 values with a normal, the 50 largest departures all belong to the fall 2026 cruise, and 98 of the largest 100. 81 of its values exceed the previous record of +7.13 °C.

Two entries in the table are bad data, not warm water, which is the weakness of ranking single values. The January 1994 value is 13.90 °C in the last bin of a cast that reads 6.61 °C ten metres above it. The October 1959 cast at station 93.3 35.0 falls in a perfectly straight line from 19.0 °C at 30 m to 8.0 °C at 400 m (0.74 °C every 25 m): values interpolated across a gap in the source, not measurements. Neither is flagged in the source data. Without them the largest departure before 1993 is +6.06 °C (November 1983).

4.2 Layer averages over the same stations

The fairer comparison averages each cruise over one fixed set of stations, the ones the fall 2026 cruise occupied. A station’s departure profile is averaged over the layer’s 10 m bins (bottle profiles are first interpolated in depth onto those bins), then the stations are averaged. A cruise is ranked when it occupied at least 60 % of those stations in a month that has a normal.

code
d_l <- d_layer |>
  filter(layer %in% c("0-50 m", "50-200 m")) |>
  mutate(date = date_min + (date_max - date_min) / 2, layer = factor(layer, c("0-50 m", "50-200 m"), c("0–50 m", "50–200 m")))
d_ev <- tibble(
  event = c("1957–59", "1982–83", "1997–98", "2014–16"),
  x0    = as.Date(c("1957-04-01", "1982-07-01", "1997-05-01", "2014-01-01")),
  x1    = as.Date(c("1959-12-31", "1983-12-31", "1998-08-31", "2016-06-30")))
l_top <- d_l |> filter(cruise_key == CRUISE)
l_run <- d_l |> filter(cruise_key != CRUISE) |> group_by(layer) |> slice_max(anom, n = 1, with_ties = F) |> ungroup()

ggplot(d_l, aes(date, anom)) +
  geom_rect(data = d_ev, aes(xmin = x0, xmax = x1, ymin = -Inf, ymax = Inf), inherit.aes = F, fill = SAND) +
  geom_text(
    data = mutate(d_ev, layer = factor("0–50 m", levels(d_l$layer))), aes(x = x0 + (x1 - x0) / 2, y = 5.75, label = event),
    inherit.aes = F, colour = MUTED, size = 3) +
  geom_hline(yintercept = 0, colour = INK, linewidth = 0.3) +
  geom_point(aes(shape = series, colour = series), size = 1.8, stroke = 0.7) +
  geom_point(data = l_top, colour = COL_2026, size = 3.2) +
  geom_text(data = l_top, aes(label = glue("fall 2026  {fs(anom)} °C")), colour = INK, fontface = "bold", size = 3.6, hjust = 1, nudge_x = -500) +
  geom_text(data = l_run, aes(label = glue("{format(date, '%b %Y')}  {fs(anom)}")), colour = INK, size = 3.1, hjust = 1, nudge_x = -400, nudge_y = 0.12) +
  facet_wrap(~ layer, ncol = 1, scales = "free_y") +
  scale_shape_manual(values = c(bottle = 1, CTD = 16)) +
  scale_colour_manual(values = c(bottle = INK, CTD = COL_NORM)) +
  scale_x_date(breaks = as.Date(paste0(seq(1950, 2020, 10), "-01-01")), date_labels = "%Y", expand = expansion(mult = c(0.01, 0.03))) +
  scale_y_continuous(labels = fsa) +
  labs(
    title    = "Every CalCOFI cruise since 1950, averaged over the stations the fall 2026 cruise occupied",
    subtitle = "Mean temperature departure (°C) from the 1993–2013 normal of the cruise's month. Open: bottle casts. Filled: CTD.",
    x = NULL, y = NULL,
    caption  = glue("CalCOFI Integrated Database release {VER} (doi:{CAT$doi}). 2026 is preliminary.  calcofi.io")) +
  theme_story() +
  theme(panel.spacing = unit(12, "pt"))
Two time series of cruise-mean temperature departure from 1950 to 2026. Values mostly lie between minus 1 and plus 2 degrees Celsius. November 2015 reaches 3.4 in the upper 50 metres and February 1998 reaches 1.9 at 50 to 200 metres. Fall 2026 stands alone at 5.1 and 2.7.
Figure 7: Every CalCOFI cruise since 1950 as one point: its mean temperature departure over the stations the fall 2026 cruise occupied, for the upper 50 m and for 50–200 m. Open circles are bottle casts, filled circles CTD. Bands mark the earlier warm events; the 1982–83 cruises occupied too few of these stations to be plotted and are in the table of events below. Preliminary data for 2026.
code
d_layer |>
  filter(layer != "0-200 m") |>
  group_by(layer, series) |>
  mutate(rank = row_number(desc(anom)), `of cruises` = n()) |>
  filter(rank <= 6) |> ungroup() |>
  arrange(match(layer, c("surface (0-10 m)", "0-50 m", "50-200 m")), desc(series), rank) |>
  transmute(
    layer, series, rank, `of cruises`, cruise = cruise_key, stations = n_sta, `departure (°C)` = round(anom, 2),
    `warmest station (°C)` = round(anom_max_station, 2), `layer temperature (°C)` = round(temp, 2)) |>
  dt_(caption = "Cruises ranked by layer-mean departure over the fall 2026 stations, by series.")
Table 9
  • Upper 50 m: +5.10 °C, first of 122 CTD cruises. The previous high is +3.35 °C (2015-11-32OC); the bottle series, 149 cruises back to 1950, has nothing higher.
  • 50–200 m: +2.73 °C, first. The previous high is +1.92 °C (1998-02-31JD, the 1997–98 El Niño). The lead is narrower at depth.
  • The two series agree where they overlap. Over the 102 cruises both cover, their upper-50 m means differ by 0.06 °C on average and never by more than 0.18 °C, so the bottle series stands in fairly for the years before 1993.

4.3 The earlier warm events

code
d_events <- q("
  WITH ev AS (SELECT * FROM (VALUES ('1957–59', 1957, 1959), ('1982–83 (through 1984)', 1982, 1984), ('1997–98', 1997, 1998),
                                    ('2014–16', 2014, 2016), ('2026', 2026, 2026)) t(event, y0, y1)),
  x AS (SELECT ev.event, l.* FROM cruise_layer l JOIN ev ON l.year BETWEEN ev.y0 AND ev.y1 WHERE l.layer IN ('0-50 m', '50-200 m')),
  m AS (SELECT event, layer, arg_max(cruise_key, anom) AS cruise_m, arg_max(n_sta, anom) AS n_m, max(anom) AS anom_m FROM x WHERE n_sta >= 7 GROUP BY ALL),
  s AS (SELECT event, layer, arg_max(cruise_key, anom_season) AS cruise_s, arg_max(n_sta_season, anom_season) AS n_s, max(anom_season) AS anom_s FROM x WHERE n_sta_season >= 7 GROUP BY ALL)
  SELECT * FROM m FULL JOIN s USING (event, layer) ORDER BY layer, event")
d_events |>
  transmute(
    layer, event, `warmest cruise (monthly normal)` = cruise_m, stations = n_m, `departure (°C)` = round(anom_m, 2),
    `warmest cruise (seasonal normal)` = cruise_s, `stations ` = n_s, `departure from the seasonal normal (°C)` = round(anom_s, 2)) |>
  kable(caption = "Each warm event's warmest cruise over the fall 2026 stations (at least 7 of them occupied).")
Table 10: Each warm event’s warmest cruise over the fall 2026 stations (at least 7 of them occupied).
layer event warmest cruise (monthly normal) stations departure (°C) warmest cruise (seasonal normal) stations departure from the seasonal normal (°C)
0-50 m 1957–59 1959-08-31OR 20 1.77 1959-08-31OR 20 2.20
0-50 m 1982–83 (through 1984) 1983-11-31EB 8 3.24 1983-08-31EB 7 3.23
0-50 m 1997–98 1998-02-31JD 32 2.05 1997-12-32QU 9 2.86
0-50 m 2014–16 2015-11-32OC 29 3.35 2015-11-32OC 30 2.72
0-50 m 2026 2026-11-33P4 32 5.10 2026-11-33P4 32 4.46
50-200 m 1957–59 1958-04-31PT 12 0.44 1959-03-31ST 11 0.77
50-200 m 1982–83 (through 1984) 1984-02-32NM 7 1.47 1984-02-32NM 7 1.25
50-200 m 1997–98 1998-02-31JD 27 1.92 1997-12-32QU 8 2.07
50-200 m 2014–16 2015-11-32OC 25 1.33 2015-11-32OC 25 1.10
50-200 m 2026 2026-11-33P4 27 2.73 2026-11-33P4 27 2.51

The seasonal normal also reaches months that have no monthly normal, such as September and December 1997. The 1982–83 cruises occupied only 7 or 8 of these stations, so the next table compares them, and every other cruise, on exactly the stations they share with fall 2026.

4.4 On the stations two cruises share

code
d_pair_tbl <- q("
  WITH y AS (
    SELECT layer, 'departure from the monthly normal' AS yardstick, cruise_key, n_month AS n, anom_other AS other, anom_2026 AS y26 FROM paired WHERE n_month >= 10
    UNION ALL SELECT layer, 'departure from the seasonal normal', cruise_key, n_season, season_other, season_2026 FROM paired WHERE n_season >= 10
    UNION ALL SELECT layer, 'temperature itself (no baseline)', cruise_key, n_temp, temp_other, temp_2026 FROM paired WHERE n_temp >= 10)
  SELECT layer, yardstick, count(DISTINCT cruise_key) AS cruises_compared, count(DISTINCT cruise_key) FILTER (WHERE other >= y26) AS at_or_above_2026,
         arg_min(cruise_key, y26 - other) AS closest_cruise, arg_min(n, y26 - other) AS shared_stations,
         arg_min(other, y26 - other) AS closest_value, arg_min(y26, y26 - other) AS fall_2026, min(y26 - other) AS margin
  FROM y WHERE layer <> '0-200 m' GROUP BY layer, yardstick
  ORDER BY CASE layer WHEN 'surface (0-10 m)' THEN 0 WHEN '0-50 m' THEN 1 ELSE 2 END, yardstick")
d_pair_tbl |>
  transmute(
    layer, yardstick, `cruises compared` = cruises_compared, `at or above fall 2026` = at_or_above_2026,
    `closest cruise` = closest_cruise, `shared stations` = shared_stations, `its value (°C)` = round(closest_value, 2),
    `fall 2026, same stations (°C)` = round(fall_2026, 2), `margin (°C)` = round(margin, 2)) |>
  kable(caption = "Fall 2026 against every other cruise on the stations both occupied (at least 10).")
Table 11: Fall 2026 against every other cruise on the stations both occupied (at least 10).
layer yardstick cruises compared at or above fall 2026 closest cruise shared stations its value (°C) fall 2026, same stations (°C) margin (°C)
surface (0-10 m) departure from the monthly normal 243 0 2015-11-32OC 33 3.15 4.46 1.31
surface (0-10 m) departure from the seasonal normal 315 0 1997-09-32NM 32 2.64 3.24 0.60
surface (0-10 m) temperature itself (no baseline) 315 0 1997-09-32NM 32 20.70 21.26 0.56
0-50 m departure from the monthly normal 243 0 2015-11-32OC 30 3.33 5.35 2.02
0-50 m departure from the seasonal normal 314 0 2015-11-32OC 30 2.72 4.69 1.98
0-50 m temperature itself (no baseline) 314 0 2015-11-32OC 30 19.14 21.08 1.94
50-200 m departure from the monthly normal 221 0 1998-02-31JD 27 1.92 2.73 0.81
50-200 m departure from the seasonal normal 285 0 1998-02-31JD 27 1.94 2.51 0.57
50-200 m temperature itself (no baseline) 285 0 1998-02-31JD 27 12.88 13.27 0.40

No cruise in the record equals fall 2026 on shared stations, in any layer, by any of the three yardsticks. The third needs no baseline: it compares the layer’s temperature itself, whatever the month. The margin is about 2 °C in the upper 50 m and 0.4–0.8 °C at 50–200 m. With fewer shared stations the upper 50 m still holds; at depth it gets close: on the 7 offshore stations it shares with the February 1984 cruise, 50–200 m is a tie (1.47 against 1.48 °C).

4.5 Without any baseline

code
d_warm <- q("
  WITH r AS (SELECT * FROM cell WHERE line BETWEEN 76.7 AND 93.4 AND station <= 120 AND depth_bin < 200 AND v < 35)
  SELECT depth_bin, count(DISTINCT cruise_key) AS cruises,
         max(v) FILTER (WHERE cruise_key = {CRUISE})  AS t_2026,
         max(v) FILTER (WHERE cruise_key <> {CRUISE}) AS t_before,
         arg_max(cruise_key, v) FILTER (WHERE cruise_key <> {CRUISE}) AS cruise_before,
         arg_max(site_key, v)   FILTER (WHERE cruise_key <> {CRUISE}) AS station_before
  FROM r GROUP BY depth_bin ORDER BY depth_bin") |>
  mutate(depth_m = depth_bin + 5, margin = t_2026 - t_before)
z_rec   <- d_warm |> filter(margin > 0) |> pull(depth_bin)
warm_nc <- q("SELECT count(DISTINCT cruise_key) AS n, min(cruise_year) AS y0 FROM cell WHERE line BETWEEN 76.7 AND 93.4 AND station <= 120")
stopifnot(all(diff(z_rec) == 10), min(z_rec) == 0)   # one unbroken span from the surface down
w_big   <- d_warm |> slice_max(margin, n = 1)

ggplot(d_warm, aes(y = depth_m)) +
  geom_ribbon(data = \(d) filter(d, margin > 0), aes(xmin = t_before, xmax = t_2026), fill = COL_2026, alpha = 0.12, orientation = "y") +
  geom_path(aes(x = t_before), colour = MUTED, linewidth = 0.8) +
  geom_point(aes(x = t_before), colour = MUTED, size = 1.4) +
  geom_path(aes(x = t_2026), colour = COL_2026, linewidth = 1) +
  geom_point(aes(x = t_2026), colour = COL_2026, size = 1.6) +
  annotate("text", x = 25.4, y = 68, label = "fall 2026", colour = INK, size = 3.4, hjust = 1, fontface = "bold") +
  annotate("text", x = 20.2, y = 24, label = "the warmest before,\nany cruise since 1949", colour = INK, size = 3.2, hjust = 1, lineheight = 0.95) +
  scale_y_reverse(breaks = seq(0, 200, 25), expand = expansion(mult = 0.02)) +
  scale_x_continuous(position = "top", breaks = seq(10, 26, 4)) +
  labs(
    title    = glue("The warmest water on record at every depth from the surface to {max(z_rec) + 10} m"),
    subtitle = glue("Highest temperature (°C) in each 10 m bin, {warm_nc$n} cruises on the core grid, any month"),
    x = NULL, y = "Depth (m)") +
  theme_story()
Two profiles of record temperature against depth. The 2026 profile is warmer than the previous record at every depth from the surface to 130 metres, by up to 3.8 degrees Celsius near 45 metres.
Figure 8: The warmest water CalCOFI has measured in each 10 m depth bin on its core grid (lines 76.7–93.3, stations out to 120), in any month: before fall 2026 (grey) and on the fall 2026 cruise (red). Preliminary data for 2026.

On the core grid (494 cruises since 1949), every depth from the surface to 130 m now has its record on the fall 2026 cruise: by 1.0 °C at the surface (the earlier record, 24.09 °C, was set in August 1983, a summer cruise) and by up to 3.8 °C at 40–50 m. Below 130 m, earlier cruises were warmer.

4.6 Every station ever occupied

The release’s normal exists only where the cruises of 1993–2013 went: the stations of today’s grid. CalCOFI also worked lines far to the south, off Baja California, until the 1980s. None of the rankings above sees them, nor any month that has no normal. One yardstick does: each value against the mean of the other cruises, before fall 2026, of the same series at the same station, calendar month and depth bin, wherever at least five exist. It is a cruder normal than the release’s. Its years differ from station to station, and at today’s stations it includes the warm years since 2014, which makes recent departures read smaller.

code
# every value against the mean of the OTHER cruises, before fall 2026, of the same series at the same station,
# calendar month and 10 m bin (at least five of them, whatever their years)
invisible(dbExecute(con, glue_sql("
  CREATE OR REPLACE TEMP TABLE cell_others AS
  WITH g AS (
    SELECT dataset_key, site_key, cruise_month, depth_bin, count(*) AS n0, sum(v) AS s0
    FROM cell_ok WHERE cruise_key <> {CRUISE} GROUP BY ALL)
  SELECT c.dataset_key, c.cruise_key, c.cruise_year, c.cruise_month, c.site_key, c.line, c.station, c.depth_bin, c.latitude, c.v, c.anom,
         CASE WHEN c.cruise_key = {CRUISE} THEN g.n0 ELSE g.n0 - 1 END AS n_others,
         CASE WHEN c.cruise_key = {CRUISE} THEN g.s0 / g.n0 ELSE (g.s0 - c.v) / (g.n0 - 1) END AS mean_others
  FROM cell_ok c JOIN g USING (dataset_key, site_key, cruise_month, depth_bin)
  WHERE CASE WHEN c.cruise_key = {CRUISE} THEN g.n0 ELSE g.n0 - 1 END >= 5", .con = con)))
wr <- q("
  SELECT count(*) AS cells, count(DISTINCT cruise_key) AS cruises, count(*) FILTER (WHERE anom IS NULL) AS cells_no_normal,
         count(*) FILTER (WHERE line >= 96) AS cells_south, count(DISTINCT cruise_key) FILTER (WHERE line >= 96) AS cruises_south,
         max(v - mean_others) FILTER (WHERE cruise_key <> {CRUISE}) AS max_else,
         max(v - mean_others) FILTER (WHERE cruise_key = {CRUISE})  AS max_2026
  FROM cell_others")
wr_all <- q("SELECT count(*) AS cells, count(DISTINCT cruise_key) AS cruises, max(cruise_year) AS y1, count(anom) AS with_normal FROM cell WHERE line >= 96")   # line 96.7 and beyond
stopifnot(wr_all$with_normal == 0)
wr$n_above <- q("SELECT count(*) AS n FROM cell_others WHERE cruise_key = {CRUISE} AND v - mean_others > {wr$max_else}")$n
d_wr <- q("
  (SELECT * FROM cell_others WHERE cruise_key = {CRUISE}  ORDER BY v - mean_others DESC LIMIT 3)
  UNION ALL
  (SELECT * FROM cell_others WHERE cruise_key <> {CRUISE} ORDER BY v - mean_others DESC LIMIT 12)") |>
  mutate(dep = v - mean_others) |> arrange(cruise_key != CRUISE, desc(dep))
w65 <- d_wr |> filter(cruise_key != CRUISE) |> slice(1)
w58 <- d_wr |> filter(cruise_key != CRUISE) |> slice(2)
stopifnot(w65$cruise_key == "1965-07-31AX", w58$cruise_key == "1958-10-31PT", wr$max_2026 > wr$max_else)
d_wr |>
  transmute(
    cruise = nb(cruise_key), series = if_else(dataset_key == "calcofi_bottle", "bottle", "CTD"), station = sta(site_key),
    `latitude (°N)` = round(latitude, 1), `depth (m)` = nb(glue("{depth_bin}–{depth_bin + 10}")), `observed (°C)` = round(v, 2),
    `mean of the other cruises (°C)` = round(mean_others, 2), `other cruises` = n_others, `departure (°C)` = round(dep, 2),
    `has a 1993–2013 normal` = if_else(is.na(anom), "no", "yes")) |>
  kable(caption = "Departures from the mean of the other cruises at the same station, calendar month and depth: the three largest of fall 2026, then the twelve largest of every other cruise since 1950.")
Table 12: Departures from the mean of the other cruises at the same station, calendar month and depth: the three largest of fall 2026, then the twelve largest of every other cruise since 1950.
cruise series station latitude (°N) depth (m) observed (°C) mean of the other cruises (°C) other cruises departure (°C) has a 1993–2013 normal
2026‑11‑33P4 CTD 93.3 28.0 32.9 50⁠–⁠60 24.50 12.54 14 11.96 yes
2026‑11‑33P4 CTD 93.3 28.0 32.9 40⁠–⁠50 24.98 13.13 14 11.85 yes
2026‑11‑33P4 CTD 93.3 30.0 32.8 40⁠–⁠50 25.00 13.21 16 11.79 yes
1965‑07‑31AX bottle 136.7 23.0 25.6 20⁠–⁠30 24.98 16.23 12 8.75 no
1958‑10‑31PT bottle 116.7 30.0 28.7 50⁠–⁠60 21.55 13.04 8 8.51 no
1965‑07‑31AX bottle 136.7 23.0 25.6 30⁠–⁠40 22.56 14.79 12 7.76 no
1958‑10‑31PT bottle 116.7 30.0 28.7 30⁠–⁠40 22.44 14.82 8 7.62 no
1959‑01‑31SB bottle 140.0 40.0 24.4 70⁠–⁠80 22.62 15.44 5 7.18 no
1964‑07‑31AX bottle 136.7 23.0 25.6 0⁠–⁠10 24.46 17.32 6 7.14 no
1964‑07‑31AX bottle 136.7 23.0 25.6 10⁠–⁠20 23.37 16.24 6 7.13 no
2014‑07‑32NM CTD 86.7 45.0 33.5 20⁠–⁠30 19.78 12.82 22 6.96 yes
1958‑10‑31PT bottle 116.7 30.0 28.7 20⁠–⁠30 22.55 15.98 8 6.56 no
1951‑10‑31CR bottle 136.7 23.0 25.6 50⁠–⁠60 23.93 17.46 10 6.47 no
1958‑01‑31ST bottle 140.0 50.0 24.1 70⁠–⁠80 22.14 15.75 6 6.39 no
1964‑07‑31AX bottle 136.7 30.0 25.3 0⁠–⁠10 22.82 16.43 6 6.39 no

Line 96.7 and the lines south of it hold 226,911 values from 322 cruises (the last in 1988), none with a normal, and this yardstick reaches 88,936 of them. In all it covers 772,742 values from 610 cruises, 193,306 of which have no 1993–2013 normal.

By this yardstick too the largest departures in the record are fall 2026’s: +12.0 °C at the most, with 33 of its values above everything else. The largest earlier ones are on the southern lines: +8.8 °C at 20–30 m at station 136.7 23.0, off Baja California at 25.6°N, in July 1965, and +8.5 °C at 50–60 m at station 116.7 30.0 (28.7°N) in October 1958, during the 1957–59 El Niño. The second has the shape of fall 2026 at a smaller size: surface-layer water of 21.6 °C at a depth where that station averages 13.0 °C. The same waters gave the largest value published for the next great El Niño.

6 The water mass

code
d_ts <- q("
  SELECT t.site_key, t.depth_m, t.value AS temp, s.value AS sal
  FROM cast_1m t JOIN cast_1m s USING (sample_key, depth_m)
  WHERE t.measurement_type = 'temperature_ave' AND s.measurement_type = 'salinity_ave_corr'
    AND t.direction = 'd' AND t.measurement_qual IS NULL AND s.measurement_qual IS NULL AND t.depth_m <= 200") |>
  mutate(group = if_else(site_key %in% inner$site_key, "inner Bight", "seaward"))
# the normal curve is the BOTTLE series' (temperature and salinity at the bottle depths): the CTD salinity normal at
# this station is inflated at 90-120 m by one unflagged cast (see the note under the figure)
d_tsn <- q("
  SELECT t.depth_bin, t.clim_mean AS temp, s.clim_mean AS sal
  FROM climatology t JOIN climatology s USING (dataset_key, site_key, month, depth_bin)
  WHERE t.measurement_type = 'temperature' AND s.measurement_type = 'salinity' AND t.dataset_key = 'calcofi_bottle'
    AND t.site_key = {k$top_site} AND t.month = 11 AND t.depth_bin <= 200 AND t.clim_mean IS NOT NULL AND s.clim_mean IS NOT NULL
  ORDER BY t.depth_bin")
d_bad <- q("
  SELECT c.depth_bin, c.clim_mean AS ctd_normal, c.clim_sd, b.clim_mean AS bottle_normal,
         (SELECT max(value) FROM obs_env o WHERE o.measurement_type = 'salinity_ave_corr' AND o.site_key = c.site_key
            AND o.cruise_key = '2007-11-32NM' AND o.depth_bin = c.depth_bin) AS cast_2007
  FROM climatology c LEFT JOIN climatology b
    ON b.measurement_type = 'salinity' AND b.dataset_key = 'calcofi_bottle' AND b.site_key = c.site_key AND b.month = c.month AND b.depth_bin = c.depth_bin
  WHERE c.measurement_type = 'salinity_ave_corr' AND c.dataset_key = 'calcofi_ctd-cast' AND c.site_key = {k$top_site} AND c.month = 11
    AND c.depth_bin BETWEEN 90 AND 120 ORDER BY c.depth_bin")
# lines of equal density (TEOS-10, at the sea surface)
d_sig <- expand_grid(sal = seq(32.7, 34.8, 0.02), temp = seq(8, 26.5, 0.1)) |>
  mutate(sigma = gsw_sigma0(gsw_SA_from_SP(sal, 0, -118, 33), gsw_CT_from_t(gsw_SA_from_SP(sal, 0, -118, 33), temp, 0)))
d_sig_lab <- d_sig |> filter(abs(temp - 26.2) < 0.01) |> mutate(s_ = round(sigma * 2) / 2) |>
  filter(s_ %in% c(22, 23), abs(sigma - s_) < 0.008) |> group_by(s_) |> slice(1)

ggplot(d_ts, aes(sal, temp)) +
  geom_contour(data = d_sig, aes(z = sigma), breaks = seq(21, 27, 0.5), colour = STONE, linewidth = 0.25) +
  geom_text(data = d_sig_lab, aes(label = s_), colour = MUTED, size = 2.8, vjust = -0.4) +
  geom_point(aes(colour = group), size = 0.5, alpha = 0.5) +
  geom_path(data = d_tsn, colour = INK, linewidth = 0.9) +
  geom_point(data = filter(d_tsn, depth_bin %in% c(0, 50, 100, 200)), colour = INK, size = 1.9) +
  geom_text_repel(
    data = filter(d_tsn, depth_bin %in% c(0, 50, 100, 200)), aes(label = glue("{depth_bin} m")), colour = INK, size = 2.9,
    bg.color = "white", bg.r = 0.18, nudge_x = -0.07, direction = "y", segment.colour = NA, seed = 1) +
  annotate("text", x = 34.44, y = 24.45, label = "inner Bight,\nsurface to 55 m", colour = INK, size = 3.1, lineheight = 0.9, hjust = 0, vjust = 1) +
  annotate("text", x = 33.05, y = 21.2, label = "seaward stations", colour = INK, size = 3.1, hjust = 0) +
  annotate("text", x = 34.14, y = 13.6, label = "November normal,\nstation 93.3 30.0\n(bottle series)", colour = INK, size = 3.1, lineheight = 0.9, hjust = 0) +
  scale_colour_manual(values = c("inner Bight" = COL_2026, seaward = COL_NORM)) +
  scale_x_continuous(breaks = seq(33, 34.5, 0.5), limits = c(32.85, 34.72), expand = c(0, 0)) +
  scale_y_continuous(breaks = seq(10, 26, 4), limits = c(8, 26.6), expand = c(0, 0)) +
  labs(
    title    = "The warm layer is saltier than anything normally found here",
    subtitle = "Temperature (°C) against salinity, fall 2026 down casts, surface to 200 m",
    x = "Salinity", y = NULL) +
  theme_story()
A temperature-salinity diagram. The offshore casts and the normal curve lie at salinities of 33.0 to 33.7. The inshore casts extend to 25 degrees Celsius and salinity 34.4 to 34.5, far from any normal value.
Figure 10: Temperature against salinity for every one-metre value of the fall 2026 down casts in the upper 200 m: stations of the inner Southern California Bight (red) and stations seaward of them (blue). The black line is the 1993–2013 November normal at station 93.3 30.0 from the bottle series, with its depths marked. Grey curves are lines of equal density (sigma-theta, kg m⁻³). Preliminary data.

Temperature alone cannot say where water came from; temperature and salinity together can. The seaward stations plot where the California Current always does: fresh at the surface (33.3–33.6 in the top 40 m) and saltier with depth. The normal profile at the record station does the same (33.33–33.48 in the top 40 m, 34.10 at 200 m). Across the inner Bight the top 40 m is 33.8 to 34.4, and at stations 28 and 30 the warm layer (34.43–34.48) is saltier than any water the normal column holds down to 200 m, while lying at the surface, where the normal is freshest. Local heating moves water straight up on this diagram; it cannot move it to the right.

The quantity of heat makes the same point. Through the upper 200 m at station 093.3 028.0 the water column holds about 6.0 GJ per square metre more heat than normal (2.6 GJ m⁻² on average over the 27 stations sampled to 200 m). At a net surface heating of 100 W m⁻², a generous figure chosen only for scale, the atmosphere would need about 690 days to supply it. Both the salt and the heat say this water was carried in, not warmed where it lies. The Scripps Pier record shows it arriving at the coast: salinity there rose by 0.6 within about ten days.

6.1 Warm and salty, or only warm?

Salinity also separates this event from the last one. The table puts every cruise on one footing: its mean departure through the upper 50 m at the stations of the inner Bight, in temperature and in salinity, against the bottle series’ normals. Earlier cruises are their bottle casts; fall 2026 is its CTD, whose salinity matches the bottles drawn on board.

code
ts59 <- d_tsx |> filter(year %in% 1957:1959) |> slice_max(t_anom, n = 1)
d_tsx |>
  mutate(s_rank = rank(-s_anom)) |>
  slice_max(t_anom, n = 8) |>
  transmute(
    cruise = nb(cruise_key), stations = n_s, `temperature (°C)` = round(t_anom, 2), `salinity` = round(s_anom, 2),
    `salinity, station by station` = glue("{fs(s_min, 2)} to {fs(s_max, 2)}"), `salinity rank` = s_rank) |>
  kable(caption = glue("The eight warmest cruises in the inner Southern California Bight, upper 50 m: mean departure of temperature and of salinity from the bottle series' normals, and where the salinity departure ranks among the {nrow(d_tsx)} cruises with at least 8 of these stations."))
Table 15: The eight warmest cruises in the inner Southern California Bight, upper 50 m: mean departure of temperature and of salinity from the bottle series’ normals, and where the salinity departure ranks among the 155 cruises with at least 8 of these stations.
cruise stations temperature (°C) salinity salinity, station by station salinity rank
2026‑11‑33P4 14 7.86 0.65 +0.10 to +1.08 1
2015‑11‑32OC 14 3.87 0.00 −0.16 to +0.10 90
1998‑02‑31JD 14 2.62 0.38 +0.15 to +0.56 2
1959‑08‑31OR 8 2.38 0.19 +0.15 to +0.27 6
2014‑11‑32NM 14 2.27 0.04 −0.07 to +0.11 73
1958‑10‑31ST 9 2.20 0.02 −0.05 to +0.08 80
1992‑04‑31JD 13 2.19 -0.12 −0.20 to −0.02 134
2014‑07‑32NM 14 2.13 -0.01 −0.12 to +0.10 95

The warm water of 2014–15 was warm only. November 2015 stands +3.9 °C above normal and 0.00 in salinity; the State of the California Current report of the time found the upper ocean “unusually fresh during 2015 in most regions off southern California” (McClatchie et al. 2016). The water of the 1997–98 El Niño was warm and salty: +2.6 °C and +0.38 in February 1998, when the inshore countercurrent carried “a salinity anomaly as much as +0.5” (Lynn et al. 1998). The 1957–59 warm period has the same sign: about 0.2 in the mixed layer of January 1958 (Reid 1960), and +0.19 here in August 1959. The 1982–83 El Niño differed again: its subsurface water was fresher than normal (Simpson 1984).

Fall 2026 is of the salty kind and beyond it: +0.65, the highest of the 155 cruises, where the cruise-to-cruise standard deviation is 0.12. The seasonal normal reaches more cruises (188, September 1997 among them) and orders them the same way: +0.64 for fall 2026, +0.46 for February 1998. By its salt this water resembles what the 1997 El Niño brought to Baja California, 0.8 above normal on line 120 in October 1997 (Lynn et al. 1998), more than anything measured before off Southern California.

6.2 Displaced water, or different water?

A deep warm layer pushes everything beneath it down, and that alone makes large departures at a fixed depth: the water at 100 m is warm partly because it is water that normally sits at 30 m. Following surfaces of equal density separates the two effects: how far each surface moved, and whether the water on it changed. This is done here at the record station from the one-metre down casts: fall 2026, and the casts of the 6 November cruises behind its normal.

code
# every one-metre down cast at the record station: the baseline's November cruises and fall 2026
d_iso <- q("
  WITH f AS (SELECT * FROM obs_ctd_full_base UNION ALL BY NAME SELECT * FROM obs_ctd_full)
  SELECT f.cruise_key, f.depth_min_m AS depth_m,
         max(f.measurement_value) FILTER (WHERE f.measurement_type = 'temperature_ave')   AS temp,
         max(f.measurement_value) FILTER (WHERE f.measurement_type = 'salinity_ave_corr') AS sal
  FROM f JOIN sample s USING (sample_key)
  WHERE s.site_key = {k$top_site} AND right(f.sample_key, 1) = 'd' AND f.measurement_qual IS NULL
    AND f.measurement_type IN ('temperature_ave', 'salinity_ave_corr')
  GROUP BY ALL ORDER BY f.cruise_key, depth_m") |>
  filter(!is.na(temp), !is.na(sal)) |>
  mutate(
    sa    = gsw_SA_from_SP(sal, depth_m, top$longitude, top$latitude),
    sigma = gsw_sigma0(sa, gsw_CT_from_t(sa, temp, depth_m)),          # potential density anomaly, kg m-3 (TEOS-10)
    when  = if_else(cruise_key == CRUISE, "fall 2026", "normal"))

# depth, temperature and salinity where a cast first reaches each density (NA where the cast never holds it)
SIG <- seq(24.5, 26.5, 0.5)
on_sigma <- function(d, ...) {
  d <- arrange(d, depth_m) |> mutate(sig_m = cummax(sigma))            # a stable column: density never falls with depth
  tibble(sigma = SIG) |> mutate(
    depth = approx(d$sig_m, d$depth_m, xout = sigma, ties = min, rule = 1)$y,
    temp  = approx(d$depth_m, d$temp, xout = depth)$y,
    sal   = approx(d$depth_m, d$sal,  xout = depth)$y)}
d_on  <- d_iso |> group_by(cruise_key, when) |> group_modify(on_sigma) |> ungroup()
d_onn <- d_on |> filter(when == "normal") |> group_by(sigma) |>
  summarize(n = sum(!is.na(depth)), across(c(depth, temp, sal), list(mean = \(x) mean(x, na.rm = T), sd = \(x) sd(x, na.rm = T))), .groups = "drop")
d_on26 <- d_on |> filter(when == "fall 2026") |> select(sigma, depth_26 = depth, temp_26 = temp, sal_26 = sal)
d_surf <- left_join(d_onn, d_on26, by = "sigma") |> filter(n == nrow(b_in), !is.na(depth_26))

d_surf |>
  transmute(
    `density surface (σθ, kg m⁻³)` = f1(sigma),
    `normal depth (m)` = glue("{round(depth_mean)} ± {round(depth_sd)}"), `depth in 2026 (m)` = round(depth_26),
    `deeper by (m)` = round(depth_26 - depth_mean),
    `normal temperature (°C)` = glue("{f1(temp_mean, 2)} ± {f1(temp_sd, 2)}"), `in 2026 (°C)` = round(temp_26, 2),
    `warmer by (°C)` = round(temp_26 - temp_mean, 2),
    `normal salinity` = glue("{f1(sal_mean, 2)} ± {f1(sal_sd, 2)}"), `in 2026` = round(sal_26, 2), `saltier by` = round(sal_26 - sal_mean, 2)) |>
  kable(align = "r", caption = glue("Station 93.3 30.0 on surfaces of equal density: fall 2026 beside the mean (± 1 standard deviation) of the {nrow(b_in)} November baseline casts."))
Table 16: Station 93.3 30.0 on surfaces of equal density: fall 2026 beside the mean (± 1 standard deviation) of the 6 November baseline casts.
density surface (σθ, kg m⁻³) normal depth (m) depth in 2026 (m) deeper by (m) normal temperature (°C) in 2026 (°C) warmer by (°C) normal salinity in 2026 saltier by
24.5 21 ± 6 116 95 16.03 ± 0.34 17.02 0.99 33.38 ± 0.10 33.67 0.29
25.0 34 ± 9 140 107 13.44 ± 0.29 14.27 0.83 33.31 ± 0.08 33.52 0.21
25.5 58 ± 16 171 113 11.49 ± 0.24 12.30 0.82 33.47 ± 0.06 33.66 0.19
26.0 126 ± 24 229 103 10.55 ± 0.50 11.25 0.70 33.89 ± 0.11 34.05 0.15
26.5 270 ± 21 349 79 9.01 ± 0.29 9.27 0.26 34.20 ± 0.06 34.25 0.05

Two things stand out.

The upper 80 m is not normal water pushed down. In the baseline casts the sea surface has a density of 24.09 kg m⁻³ on average, and 23.97 in the lightest of them. In fall 2026 the surface was 22.92, and the water did not become as dense as the lightest baseline surface until 80 m (as dense as the average one until 92 m). Everything above that depth is lighter than any water those six casts contain. It has no counterpart in the normal column to have been displaced from: it is water that is not normally there.

Beneath it, the density surfaces lay 79 to 113 m deeper than normal, and the water on them had changed as well. On the same surfaces it was 0.3 to 1.0 °C warmer and 0.05 to 0.29 saltier than the baseline mean, 1 to 3 standard deviations of the six casts. At 150 m, for example, the departure of +2.9 °C splits into +2.0 °C from displacement (the water there has the density the normal column holds at 40 m) and +0.9 °C from the water itself being warmer on that surface.

code
# the same on every station of the cruise: the baseline is the median of the six cruises' down casts at the station
d_ia <- q("
  WITH f AS (SELECT * FROM obs_ctd_full_base UNION ALL BY NAME SELECT * FROM obs_ctd_full)
  SELECT f.cruise_key, s.site_key, f.depth_min_m AS depth_m,
         max(f.measurement_value) FILTER (WHERE f.measurement_type = 'temperature_ave')   AS temp,
         max(f.measurement_value) FILTER (WHERE f.measurement_type = 'salinity_ave_corr') AS sal
  FROM f JOIN sample s USING (sample_key)
  WHERE right(f.sample_key, 1) = 'd' AND f.measurement_qual IS NULL AND f.depth_min_m <= 450
    AND f.measurement_type IN ('temperature_ave', 'salinity_ave_corr') AND s.site_key IN ({unique(d_sta$site_key)*})
  GROUP BY ALL") |>
  filter(!is.na(temp), !is.na(sal)) |>
  mutate(
    sa    = gsw_SA_from_SP(sal, depth_m, -119, 33),
    sigma = gsw_sigma0(sa, gsw_CT_from_t(sa, temp, depth_m)),
    when  = if_else(cruise_key == CRUISE, "fall 2026", "normal"))
SIG_ALL <- c(25.5, 26)
d_oa <- d_ia |> group_by(site_key, cruise_key, when) |>
  group_modify(\(d, ...) on_sigma(d) |> filter(sigma %in% SIG_ALL)) |> ungroup()
d_dz <- d_oa |> filter(when == "normal") |> group_by(site_key, sigma) |>
  summarize(n = sum(!is.na(depth)), depth_n = median(depth, na.rm = T), temp_n = median(temp, na.rm = T), .groups = "drop") |>
  filter(n >= 4) |>
  inner_join(d_oa |> filter(when == "fall 2026", !is.na(depth)) |> select(site_key, sigma, depth_26 = depth, temp_26 = temp), by = c("site_key", "sigma")) |>
  mutate(group = if_else(site_key %in% inner$site_key, "inner Bight", "seaward"), dz = depth_26 - depth_n, dt = temp_26 - temp_n)
d_dz |>
  group_by(`density surface (σθ)` = f1(sigma), stations = group) |>
  summarize(
    `stations with a baseline` = n(), `median deeper by (m)` = round(median(dz)), `range (m)` = glue("{round(min(dz))} to {round(max(dz))}"),
    `median warmer on the surface (°C)` = round(median(dt), 2), .groups = "drop") |>
  kable(align = "r", caption = "Every station of the cruise deep enough to hold the surface: how far two density surfaces lay below their baseline depth (the median of the six November baseline casts at the station), and the temperature change on them.")
Table 17: Every station of the cruise deep enough to hold the surface: how far two density surfaces lay below their baseline depth (the median of the six November baseline casts at the station), and the temperature change on them.
density surface (σθ) stations stations with a baseline median deeper by (m) range (m) median warmer on the surface (°C)
25.5 inner Bight 9 87 70 to 118 0.72
25.5 seaward 18 27 -7 to 63 0.61
26.0 inner Bight 9 80 61 to 106 0.56
26.0 seaward 18 22 -14 to 57 0.34

The displacement is not confined to the record station. Across the cruise the same surfaces lay deeper than their baseline at 49 of 54 station-surface pairs: by a median of 84 m in the inner Bight and 26 m at the seaward stations.

So the depressed pycnocline accounts for most of the departure below about 80 m, as expected of a deep warm layer, and the layer itself is a different water mass. A baseline on density surfaces for every station, built from the one-metre casts of the whole baseline period, would make this routine; here it is done by hand, from six cruises.

NoteA flaw in the salinity normal, found while drawing this figure

The diagram draws the normal from the bottle series because the CTD salinity normal at this station is wrong at 90–130 m: 33.89–34.12 where the bottles give 33.72–33.85. One cast of the November 2007 cruise carries unflagged salinities up to 35.34 there, which no water off California reaches, and they enter the mean. It does not touch the temperature normal, nor the salinity normal of the warm layer above 60 m, whose standard deviation is about 0.11. It is recorded here because this analysis is where it surfaced.

7 The event in context

7.1 What the agencies were reporting in fall 2026

These are other institutions’ statements, quoted as published and read on 12–13 November 2026. They are context for the measurements above, not part of them.

  • A strong El Niño is in progress. NOAA’s Climate Prediction Center, in its ENSO Diagnostic Discussion of 12 November 2026 (NOAA Climate Prediction Center 2026), keeps an El Niño Advisory in force: “El Niño continues to strengthen, with a strong-to-very strong El Niño likely through January-March 2027”. Its Niño-3.4 index for October was +2.5 °C. That is a relative index (the tropical mean is subtracted (Oldenborgh et al. 2021; L’Heureux et al. 2024)), which NOAA has used officially since February 2026, so it is not comparable with the Niño-3.4 values quoted for earlier events without saying which index is meant. At the equator NOAA reports “a deeper-than-average thermocline and anomalies exceeding +10.0°C at depth in the eastern Pacific Ocean”: large departures at thermocline depth are how this event looks at its source as well.
  • A marine heatwave was already there. NOAA Fisheries’ California Current Marine Heatwave Tracker (updated 30 October 2026) (NOAA Integrated Ecosystem Assessment 2026) has followed a heatwave off California, NEP25A, since May 2025, and says of the recent warming: “Although the current MHW off California preceded the El Niño, we now infer that we are seeing additional warming due to El Niño, primarily through the arrival of Kelvin waves, which act to further deepen the surface mixed layer, reduce upwelling, and therefore lead to surface layer warming. It is unclear if we can separate the warming that was already in place in California from the additional warming due to the El Niño-forced Kelvin waves.”
  • Scripps Pier’s century-long record. The Shore Stations Program has measured the sea surface at the pier by hand every day since 1916. Its plot for 2026 (Shore Stations Program, Scripps Institution of Oceanography 2026) gives 24.0 °C for 12 November, counts 74 daily record highs in 2026 so far, and marks the days of early November as records for their dates. (This is the long manual record; the automated station above is a separate instrument on the same pier.)
  • Gliders. Scripps’s underwater gliders have repeated CalCOFI line 90 for twenty years. The group’s El Niño page (Instrument Development Group, Scripps Institution of Oceanography 2026) says of that line: “The warm water anomaly is now extending the deepest we’ve seen in 20 years of monitoring.”
  • A published anomaly at thermocline depth, farther north. In Monterey Bay, MBARI reported on 29 October 2026 (Monterey Bay Aquarium Research Institute 2026) that the temperature at 60 m “reached 18.18 degrees Celsius (64.72 degrees Fahrenheit), surpassing the time series record high set on November 19, 1997”, with temperatures “more than seven degrees centigrade over the long-term average”. That is the same kind of number as the one on this page, a departure at the depth of the thermocline, from an independent mooring about 600 km to the north-west, and a little over half as large.

Read together: the water CalCOFI measured arrived on top of a marine heatwave that had been in place for a year and a half, during a strong El Niño. The measurements on this page do not separate the two, and NOAA says it cannot yet either.

7.2 The glider index, not yet at its record in September

code
gl_last <- slice_tail(d_gl, n = 1)
gl_top  <- slice_max(d_gl, scti, n = 1)
gl_rank <- sum(d_gl$scti > gl_last$scti) + 1
# CalCOFI's own casts on that stretch of line 90, at 50-60 m: the cruises whose six stations all have a normal
d_l90 <- q("
  SELECT cruise_key, count(*) AS n, avg(anom) AS anom, string_agg(CAST(CAST(station AS INTEGER) AS VARCHAR), ' ' ORDER BY station) AS stations
  FROM cell WHERE dataset_key = 'calcofi_ctd-cast' AND line = 90 AND station BETWEEN 27 AND 54 AND depth_bin = 50 AND anom IS NOT NULL
  GROUP BY cruise_key")
l90 <- function(cruise) d_l90 |> filter(cruise_key == cruise)
stopifnot(l90(CRUISE)$stations == l90("2015-11-32OC")$stations, l90(CRUISE)$n == 6, gl_top$date > as.Date("2015-10-01"), gl_top$date < as.Date("2016-02-01"))

ggplot(d_gl, aes(date, scti)) +
  geom_hline(yintercept = 0, colour = INK, linewidth = 0.3) +
  geom_line(colour = COL_NORM, linewidth = 0.7) +
  geom_point(data = gl_top, colour = COL_2015, size = 2.6) +
  geom_point(data = gl_last, colour = COL_2026, size = 2.6) +
  geom_text(data = gl_top, aes(label = glue("{format(date, '%b %Y')}  {fs(scti)} °C")), colour = INK, size = 3.3, hjust = 1, nudge_x = -200, nudge_y = 0.1) +
  geom_text(data = gl_last, aes(label = glue("{format(date, '%b %Y')}  {fs(scti)} °C")), colour = INK, fontface = "bold", size = 3.3, hjust = 1, nudge_x = -200) +
  scale_x_date(breaks = as.Date(paste0(seq(2008, 2026, 2), "-01-01")), date_labels = "%Y", expand = expansion(mult = c(0.01, 0.03))) +
  scale_y_continuous(labels = fsa) +
  labs(
    title    = "At 50 m on line 90, the gliders' three-month mean was climbing toward its 2015 record",
    subtitle = "Southern California Temperature Index (°C): coast to 200 km offshore, three-month running mean",
    x = NULL, y = NULL,
    caption  = "Scripps Instrument Development Group, California Underwater Glider Network (doi:10.21238/S8SPRAY7292).") +
  theme_story()
A time series from 2007 to 2026. The index stays within about 1.5 degrees of zero until 2014, peaks at 3.3 degrees in December 2015, and rises steeply through 2026 to 2.8 degrees in September.
Figure 11: The Southern California Temperature Index of the Scripps glider group: the temperature departure at 50 m along CalCOFI line 90 from the coast to 200 km offshore, as a three-month running mean, monthly from January 2007 to the latest value published when this page was rendered. Data: California Underwater Glider Network, doi:10.21238/S8SPRAY7292.

The glider group publishes one number for line 90, the Southern California Temperature Index (Figure 11): “the interannual temperature anomaly at 50m depth along the coastal section of Line 90 (coast to 200-km offshore) with a 3-month running mean applied” (Rudnick et al. 2016). Its latest value, centred on September 2026, is +2.8 °C, the third highest of 237 months since 2007; the record is +3.3 °C, centred on December 2015. The index ends six weeks before the cruise and averages three months, so it does not yet cover what the ship found, and it neither confirms nor contradicts it. CalCOFI’s own casts on that stretch of the line say what to expect: its six stations averaged +8.7 °C at 50–60 m on the fall 2026 cruise, and +3.1 °C in November 2015, when the index centred on that month was +3.3 °C. The index for November 2026 will be the independent check on a record at that depth.

7.3 How large earlier warm events were

What their observers published about the earlier warm events, with the baseline each used. No study uses the 1993–2013 normal of this page, and most report averages over a cruise, a section or a month, not single stations, so sizes compare only loosely. Words in quotation marks are the authors’.

code
# published values, each read in the source named (or in its abstract, where the last column says so)
d_lit <- read_csv(file.path(DIR_DATA, "literature_ranges.csv"))
d_lit |>
  transmute(
    event, `where and what` = what, reported, `against` = baseline,
    source = glue("[@{key}]{if_else(read == 'abstract', ' (abstract)', '')}")) |>
  kable(caption = "Temperature departures published for earlier warm events off Southern California and Baja California, each against its own baseline.")
Table 18: Temperature departures published for earlier warm events off Southern California and Baja California, each against its own baseline.
event where and what reported against source
1957–59 sea surface on the CalCOFI sections, January 1958 1 to 3 °C the CalCOFI mean of 1949 to 1954 or 1955 (Reid 1960)
1957–59 a layer 10 to 30 m thick below the usual depth of the thermocline (50 m inshore, 100 m offshore), January 1958 2 to 4 °C, falling to less than 0.5 °C beneath it the same (Reid 1960)
1957–59 mixed layer, January 1958 about 1.5 °C warmer, about 0.2 saltier, 10 to 30 m deeper the same (Reid 1960)
1982–83 California Current, large scale sea surface about 1 to 2 °C; “depression of the thermocline by 50 m or more”; subsurface warming about 3 to 4 °C the 30-year mean (Simpson 1983) (abstract)
1982–83 off California, at the surface and at 100 m “as large as +4°C at the surface and as large as +5° to +6°C at 100 m”; the thermocline along the coast 50 to 100 m deeper not stated (McLain et al. 1985)
1982–83 depth of the 14 °C isotherm off San Diego, winter mean over 40 m deeper than normal (about 20 m in winter 1957–58) winters 1971–84 (McLain et al. 1985)
1982–83 subsurface salinity 0.1 to 0.3 lower than normal as the temperature (Simpson 1984) (abstract)
1997–98 CalCOFI station 90.30, upper thermocline, November 1997 “greater than 4°”, with the surface “between 1° and 2° above normal” 1950–92 (Hayward et al. 1999)
1997–98 CalCOFI station 90.60, thermocline, December 1997 “greater than 6°”, persisting until September 1998 1950–92 (Hayward et al. 1999)
1997–98 CalCOFI grid at 10 m, September–October 1997 everywhere above normal, “with the coastal band well exceeding 3.5°C” long-term CalCOFI means (Lynn et al. 1998)
1997–98 inshore countercurrent, surface water, January–February 1998 temperature “greater than +3°C”; salinity “as much as +0.5” long-term CalCOFI means (Lynn et al. 1998)
1997–98 Baja California, line 120 off Punta Eugenia, 30–40 m, 24 September to 5 October 1997 “maximum values (8°C and 0.8)” in temperature and salinity; the surface layer above 26 °C and 34.8 October means, 1950–78 (Lynn et al. 1998)
1997–98 Baja California, line 120, near the coast at 50 m, October 1997 “up to 8.7 °C warmer and S=0.8 saltier” the climatology (1950–78) (Durazo and Baumgartner 2002) (abstract)
2014–16 CalCOFI mixed layer, Southern California Bight, winter to spring 2015 “on average >3˚C warmer” monthly means, 1984–2013 (Leising et al. 2015)
2014–16 CalCOFI stations at 100 m “on the order of 0.5˚C, increasing to as much as 1.5˚C during the 2015–16 El Niño” 1984–2012 (McClatchie et al. 2016)
2014–16 glider sections on lines 66.7, 80 and 90, mean of 10–100 m “frequently greater than 3 °C and exceeded 4 °C on Lines 66.7 and 90.0” 2007–2013 (Ren and Rudnick 2021)
2014–16 satellite sea-surface temperature, January 2014 to August 2016 “a maximum SST anomaly of 6.2°C off Southern California” not verified (Gentemann et al. 2017) (abstract)
2014–16 daily bottom temperature at 7–10 m, kelp forests of the Santa Barbara Channel “daily deviations as high as + 5.8 °C” 2001–2015 mean for the month (Reed et al. 2016)
2014–16 upper-ocean salinity off southern California, 2015 “unusually fresh” 1984–2012 (McClatchie et al. 2016)
2014–16 Baja California, line 100 off Ensenada, upper 300 m, September 2015 “The highest positive temperature anomalies (~5 ºC)” seasonal means, 1997–2016 (Durazo et al. 2017)
August 2018 Scripps Pier, daily sea-surface temperature the record of 1931 “was broken four times over 9 days, peaking at 26.4 °C on 9 August 2018” a temperature, not a departure (Fumo et al. 2020) (abstract)

Three things follow from setting these beside the release.

The ranking sees the earlier events at the sizes their observers reported. The largest value in the table for today’s grid is the “greater than 6°” that Hayward et al. (1999) found in the thermocline at station 90.60 in December 1997. That cruise is in the release (1997-12-32QU, 9 stations). Its largest value here is +6.5 °C, at station 90.0 53.0, 80–90 m, against the seasonal normal because December has no monthly one. At station 90.60 itself the release gives +5.4 °C against that normal, which is not the paper’s 1950–92 baseline, and +6.2 °C against the mean of the other December cruises. For 1982–83 the release’s largest is +6.1 °C (1983-11-31JD, station 90.0 60.0, 50–60 m), where McLain et al. (1985) give “+5° to +6°C at 100 m”. For November 2015 the upper 50 m averages +3.4 °C over the fall 2026 stations, where glider sections gave departures “frequently greater than 3 °C” for 10–100 m against 2007–2013 (Ren and Rudnick 2021). One cruise the literature describes is not in the release: NOAA ship McArthur, 17–22 November 1997, the first of the extra cruises added that winter (Lynn et al. 1998), on which station 90.30 showed thermocline departures “greater than 4°” (Hayward et al. 1999).

The largest published value is from Baja California, and it is smaller. On the first cruise of the Mexican IMECOCAL programme, in early October 1997, the water 30 to 40 m down off Punta Eugenia (line 120) was 8 °C above the 1950–78 October mean and 0.8 saltier (Lynn et al. 1998), “up to 8.7 °C” at 50 m (Durazo and Baumgartner 2002). That cruise is not in the CalCOFI database. CalCOFI’s own casts on those lines in the 1957–59 El Niño are, and the whole-record ranking finds the same size there, +8.5 °C in October 1958. It is the nearest published analogue to fall 2026: a warm, salty surface layer lying where the thermocline normally is, in the autumn of a very strong El Niño. Fall 2026 found that structure off San Diego, and larger.

At the sea surface fall 2026 is not beyond what 2014–16 produced; beneath it, it is. The largest departures published for 2014–16 near the surface off Southern California are about 6 °C: 6.2 °C in satellite sea-surface temperature (Gentemann et al. 2017) and 5.8 °C in daily bottom temperature at 7–10 m in the Santa Barbara Channel (Reed et al. 2016). That is the size of the 5 to 8 °C at the inner-Bight stations of this cruise. The difference is underneath. In 2015 the warming was “confined to the surface layer (upper ~50 m)” (Leising et al. 2015) and reached 0.5 to 1.5 °C at 100 m (McClatchie et al. 2016); in fall 2026 the 50–200 m layer averages +2.7 °C over 27 stations. That is why the record on this page rests on the values below the surface and on the layer averages, not on the sea surface.

7.4 Marine heatwaves, and why the largest numbers are below the surface

A marine heatwave has a standard definition: “a prolonged discrete anomalously warm water event” that “lasts for five or more days, with temperatures warmer than the 90th percentile based on a 30-year historical baseline period” (Hobday et al. 2016), graded from moderate to extreme by how many times the local gap between the mean and that percentile is exceeded (Hobday et al. 2018). It is defined on daily sea-surface temperature, which a cruise cannot supply. NOAA’s tracker identifies heatwaves in satellite sea-surface temperature by a rule of its own, on strength and area (NOAA Integrated Ecosystem Assessment 2026); that is the heatwave named above.

By that yardstick the well-known events are a few degrees. The regional mean on the peak day of the ten examples Hobday et al. (2018) tabulate runs from 1.92 to 5.10 °C against 1983–2012; the largest is the Santa Barbara Channel in October 2015, and the Northeast Pacific “Blob” is 2.56 °C. Eight prominent events reviewed by Smale et al. (2019) had maximum intensities of “3.5 to 9.5°C above climatological SST”. The +5.1 °C mean of the upper 50 m over 32 stations is at the top of the first range, and it is a 50 m layer, not a skin temperature.

Below the surface the numbers are larger, and the literature says why: “These subsurface anomalies are often larger than surface anomalies, due to the movement of the strong vertical temperature gradients around the thermocline” (Capotondi et al. 2024). At moorings in the tropical western Pacific the mean intensity of subsurface heatwaves “shows a peak of about 5.2 °C at 150 m, and the maximal mean intensity reaches 8.9 °C” (Hu et al. 2021), and a model study finds that deep-reaching events “tend to reach deepest along the west coasts of the Americas, especially in the California Current System” (Köhn et al. 2024). No published temperature departure found in the search behind this page, for California or anywhere else, reaches 12.8 °C. That is weak evidence by itself, because papers report averages far more often than single stations. The evidence for the record is the ranking above.

7.5 How El Niño warms these waters

The review by Jacox et al. (2017) names three routes. The measurements on this page bear on two of them.

  • Waves along the coast. “During an El Niño, these waves tend to deepen the pycnocline and nutricline” (Jacox et al. 2017): coastally trapped waves that travel poleward from the equator. Earlier events deepened the thermocline off Southern California by tens of metres in cruise and winter means: the mixed layer by 10 to 30 m in January 1958 (Reid 1960), the 14 °C isotherm off San Diego by more than 40 m in winter 1982–83, and the thermocline along the coast “by 50 to 100 m” (McLain et al. 1985). At the record station in fall 2026 the density surfaces lay 79 to 113 m below their November depths (above).
  • Water from the south. “anomalous advection of surface waters from the south, as observed during the 1997-98 El Niño”, which “may amplify surface warming and water column stratification” (Jacox et al. 2017). Its mark is salt, and fall 2026 is the saltiest cruise on record in the inner Bight.
  • Winds. A changed atmosphere over the North Pacific weakens the winds that drive upwelling. A cruise does not measure this.

El Niños differ, and the same literature says so. The subsurface water of 1982–83 was fresher than normal, not saltier (Simpson 1984). Gliders in the 2009–10 event found isopycnals “abnormally deep” but “no anomalous water masses in the region” (Todd et al. 2011). In 2015–16 the effects on the California Current were “weaker than expected based on tropical sea surface temperature anomalies” (Jacox et al. 2016). And the background has moved: “An overall warming trend of 1.3°C in the ocean surface, a deepening in the depth of the mean thermocline (18 m)” between 1950 and 1999 (Di Lorenzo et al. 2005), which a fixed 1993–2013 normal folds into any recent departure.

8 What this does and does not show

code
d_cov <- q("
  SELECT CASE dataset_key WHEN 'calcofi_bottle' THEN 'bottle' ELSE 'CTD' END AS series, CAST((cruise_year // 10) * 10 AS INTEGER) || 's' AS decade,
         count(DISTINCT cruise_key) AS cruises, count(DISTINCT cruise_key) FILTER (WHERE anom IS NOT NULL) AS with_monthly_normal,
         count(DISTINCT cruise_key) FILTER (WHERE anom_season IS NOT NULL) AS with_seasonal_normal,
         CAST(round(100.0 * count(anom) / count(*)) AS INTEGER) AS pct_values_with_monthly_normal
  FROM cell GROUP BY ALL ORDER BY series DESC, decade")
n_site <- q("SELECT count(DISTINCT site_key) AS n, min(line) AS l0, max(line) AS l1 FROM cell WHERE anom IS NOT NULL")
months <- q("SELECT DISTINCT cruise_month AS m FROM cell WHERE anom IS NOT NULL ORDER BY 1")$m
kable(d_cov, col.names = c("series", "decade", "cruises", "with a monthly normal", "with a seasonal normal", "% of values with a monthly normal"),
      caption = "How much of the record has a normal to compare with.")
Table 19: How much of the record has a normal to compare with.
series decade cruises with a monthly normal with a seasonal normal % of values with a monthly normal
bottle 1940s 27 0 0 0
bottle 1950s 287 89 151 11
bottle 1960s 94 55 68 17
bottle 1970s 52 21 37 10
bottle 1980s 63 34 60 28
bottle 1990s 48 38 48 74
bottle 2000s 40 39 40 89
bottle 2010s 41 37 41 73
bottle 2020s 5 4 5 74
CTD 1990s 34 26 33 83
CTD 2000s 42 41 42 87
CTD 2010s 40 37 40 81
CTD 2020s 27 25 27 79
  • “The record” is the part of the record with a baseline. A normal exists for 81 stations of the present grid (lines 66.7 to 93.4) and for the months with at least five cruises in 1993–2013: January, February, April, July, August, October, November. Earlier decades sampled other months and other stations far more often. “The largest on record” means the largest among 340 of 681 cruises. The baseline-free comparisons (shared stations, record temperatures) and the yardstick that reaches every station do not have this limit and give the same answer.
  • The baseline is thin. 6 to 8 November cruises per bin on line 93.3. The baseline table bounds what that can change: the peak departure stays between 11.4 and 13.0 °C.
  • Coverage. 36 stations in 8 days, where a full cruise occupies 65 to 75. The layer averages are over those stations only; a whole-grid average would be lower and cannot be computed for this cruise.
  • Preliminary. The casts are one-metre averages processed at sea. Two sensors agreeing within 0.006 °C and bottle salinities agreeing within 0.002 leave little for final calibration to change.
  • Single values or layer averages. A ranking of single values rewards the thermocline, where a displaced layer makes the largest numbers, and it is where bad values in old data surface. The layer average over fixed stations is the fairer claim. Both rank fall 2026 first.
  • Peaks between cruises. CalCOFI samples four times a year. The peak of the 1997–98 El Niño on line 90 was caught because extra cruises were added that winter (Lynn et al. 1998), and one of them is not in the release (above). An earlier event’s largest departure may have fallen between cruises; so may this one’s.
  • A defect in an earlier release’s one-metre table did not reach this page. In releases v2026.11.05 and v2026.11.09 the supplemental table obs_ctd_full was published with most casts missing for 22 cruises between April 2015 and April 2026: a fault in the release export, not in the data, found while this page was being written. Release v2026.11.12, from which the page is now computed, corrected it: those 22 objects were replaced by whole ones at the same addresses, and its catalog lists every object once, where the catalog of v2026.11.09 lists 24 of them twice. Every departure, ranking and layer mean on this page is computed from the thinned series (obs_env) and the climatology table, which were complete throughout. The one-metre table is read for seven cruises only, fall 2026 and the six November cruises of the baseline (2001, 2002, 2005, 2009, 2010, 2013). None of them is among the 22, and for each the published object holds every cast the release’s sample table lists (924 casts in all, checked each time the page is rendered).
  • The page was first computed from release v2026.11.09. That version is kept as it was. Of the 20 release objects the page reads, 16 are the very same objects in both releases. The other 4 are partitions of the climatology table, recomputed in v2026.11.12 with the same 131,214 rows and the same counts of cruises and values. Their means differ from the earlier ones on 1,378 rows and by at most 0.000001 (°C, or units of salinity), the last stored decimal, so no number on the page moved.
  • Cause. These measurements describe the water. They do not attribute it, and neither, yet, does NOAA: a marine heatwave has been in place off California since 2025 and a strong El Niño arrived on top of it.

9 Methods

  • Data. CalCOFI Integrated Database release v2026.11.12, read through its catalog with calcofi4r (cc_catalog(), cc_release_sources()); every object is listed with its URL under Data sources. Tables: obs_env (the thinned CTD series and the bottle series, with the release’s quality predicate qual_ok), climatology, obs_ctd_full (one-metre CTD casts of the cruise), sample, sample_measurement, cruise.
  • A cell is one cruise × station × 10 m depth bin of one series: the mean of its quality-ok values.
  • A departure is a cell minus the climatology row of the same series, station, depth bin and measurement type for the cruise’s month (cruise.month_median, the month of its median cast). The seasonal departure uses the row’s season_mean (December–February, March–May, June–August, September–November).
  • A layer mean averages a station’s profile over every 10 m bin of the layer, after linear interpolation in depth between sampled bins (never across more than 60 m, never beyond the sampled range), and requires every bin. A cruise mean averages the stations.
  • The map’s shading is ordinary kriging by calcofi4r::cc_interpolate(), the interpolator of the Explorer’s contour maps, clipped to the hull of the stations (plus 15 km), masked over land and limited to the range of the measured values. Colours are the cmocean maps (Thyng et al. 2016). Density is TEOS-10 potential density anomaly, from the gsw package.
  • Mixed-layer depth is the release’s mld_sigma_theta_0125, in the registry’s words “Mixed-layer depth, sigma-theta increase of 0.125 kg/m3 from 10 m (Levitus 1982)” (calcofi4db::ctd_mld(criterion = ‘sigma_theta’, threshold = 0.125, ref_depth = 10) on the 1 m bins; an alternative criterion published beside the headline mld_sigma_theta_002 (questions Q01)), with its own November normal. The release’s headline criterion is stricter and stops at a thin warm skin on some casts; the looser one is used here because the question is how deep the warm layer reaches.
  • The whole-record yardstick compares a cell with the mean of the other cruises, before fall 2026, of the same series at the same station, calendar month and depth bin, where at least five exist. Two casts that hold bad values (shown above) are left out of it and of the per-event maxima.
  • Salinity across events uses the bottle series’ values and normals (bottle casts end in 2021), and the fall 2026 CTD against the same bottle normals, because the CTD salinity normal carries unflagged spikes.
  • Published values quoted under context were each read in the source cited, or in its abstract where the table says so; every quotation was checked against a saved copy of the text. Each entry of the bibliography was built from its Crossref or DataCite record.
  • Outside sources (buoys, the Scripps Pier shore station, satellite analyses, Argo, the glider index) are fetched by scripts/temperature_anomaly_outside_sources.py and kept as small tables in data/2026-11_temperature-anomaly/, because the buoy files hold only the last 45 days.

10 Data sources

Everything on this page is computed from public data. The release objects read, by the URL the release catalog gives for each:

code
d_src |>
  transmute(table, partition, `size (MB)` = round(mb, 1), url = glue("<a href='{url}'>{sub(paste0(BASE_URL, '/'), '', url, fixed = T)}</a>")) |>
  kable(escape = F, caption = glue("Objects of release {VER} read by this page ({f1(sum(d_src$mb), 0)} MB), under {BASE_URL}/."))
Table 20: Objects of release v2026.11.12 read by this page (143 MB), under https://storage.googleapis.com/calcofi-db/.
table partition size (MB) url
cruise 0.0 ducklake/tables/cruise/73d6749c193a2ae25bef6b39/cruise.parquet
sample 27.9 ducklake/tables/sample/281d6cadb2499cf167c0e2d1/sample.parquet
sample_measurement 2.9 ducklake/tables/sample_measurement/22ae7fe19734df335c776957/sample_measurement.parquet
measurement_type 0.0 ducklake/tables/measurement_type/37dd1f7a289aa6b428ed094f/measurement_type.parquet
obs_env temperature_ave 10.8 ducklake/tables/obs_env/measurement_type=temperature_ave/582f88850d1c0d7e98f9b12c/data_0.parquet
obs_env temperature 7.3 ducklake/tables/obs_env/measurement_type=temperature/49ef6948a8a96a058768c629/data_0.parquet
obs_env salinity_ave_corr 10.0 ducklake/tables/obs_env/measurement_type=salinity_ave_corr/e6b9cbe8286b3868929f9578/data_0.parquet
obs_env salinity 7.1 ducklake/tables/obs_env/measurement_type=salinity/2287492cbccdd25739fd781a/data_0.parquet
climatology temperature_ave 0.5 ducklake/tables/climatology/measurement_type=temperature_ave/96799c5f3c2f9c97cba73420/data_0.parquet
climatology temperature 0.3 ducklake/tables/climatology/measurement_type=temperature/937ceedd110fa47421a3563f/data_0.parquet
climatology salinity_ave_corr 0.5 ducklake/tables/climatology/measurement_type=salinity_ave_corr/47329f73774b7d289953d30f/data_0.parquet
climatology salinity 0.3 ducklake/tables/climatology/measurement_type=salinity/b020d5571a572add0a3272e5/data_0.parquet
climatology mld_sigma_theta_0125 0.0 ducklake/tables/climatology/measurement_type=mld_sigma_theta_0125/def26b9825929b5e52c26084/data_0.parquet
obs_ctd_full 2026-11-33P4 5.6 ducklake/tables/obs_ctd_full/cruise_key=2026-11-33P4/e9187443126d7abbfdf30f1f/data_0.parquet
obs_ctd_full 2001-10-32NM 9.1 ducklake/tables/obs_ctd_full/cruise_key=2001-10-32NM/2f52223818b73e5afb1a7add/data_0.parquet
obs_ctd_full 2002-11-32NM 8.5 ducklake/tables/obs_ctd_full/cruise_key=2002-11-32NM/aaf4637c51abb55b3630cb86/data_0.parquet
obs_ctd_full 2013-11-32NM 14.5 ducklake/tables/obs_ctd_full/cruise_key=2013-11-32NM/2ebbb65707b58bf2578d3da4/data_0.parquet
obs_ctd_full 2010-11-32NM 13.3 ducklake/tables/obs_ctd_full/cruise_key=2010-11-32NM/6abc79ed9f8f8a416d18f48c/data_0.parquet
obs_ctd_full 2005-11-32NM 9.6 ducklake/tables/obs_ctd_full/cruise_key=2005-11-32NM/e69634c7ecc49bd15c5f5057/data_0.parquet
obs_ctd_full 2009-11-32NM 14.9 ducklake/tables/obs_ctd_full/cruise_key=2009-11-32NM/aab854cb85829a52ab55af7e/data_0.parquet

To cite this page: CalCOFI (2026). The November 2026 temperature anomaly off Southern California. https://calcofi.io/workflows/2026-11_temperature-anomaly.html, with the release citation above for the data. The page is computed from release v2026.11.12; its first version, computed from v2026.11.09, is kept at https://calcofi.io/workflows/2026-11_temperature-anomaly_v2026.11.09.html.

Outside sources, with the URL of every request and when it was made:

code
d_osrc |>
  mutate(
    source = case_when(
      str_detect(url, "ndbc.noaa.gov")   ~ "NOAA National Data Buoy Center",
      str_detect(url, "Oisst")           ~ "NOAA OISST v2.1 (CoastWatch ERDDAP)",
      str_detect(url, "MUR")             ~ "JPL MUR SST v4.1 (CoastWatch ERDDAP)",
      str_detect(url, "ifremer")         ~ "Argo (Ifremer ERDDAP)",
      str_detect(url, "scripps-pier")    ~ "SCCOOS automated shore station, Scripps Pier (IOOS sensors ERDDAP)",
      str_detect(url, "spraydata")       ~ "Southern California Temperature Index, Scripps glider group (Spray ERDDAP)",
      TRUE                               ~ "other"),
    url = glue("<a href='{url}'>{str_trunc(url, 110)}</a>")) |>
  select(source, accessed_utc, status, url) |>
  dt_(escape = F, caption = "Every request to an outside source.")
Table 21
code
d_bstn |>
  transmute(
    buoy, name, latitude = lat, longitude = lon, `km to the nearest cast` = km_to_nearest_cast, `record read` = glue("{substr(first_utc, 1, 10)} to {substr(last_utc, 1, 10)}"),
    page = glue("<a href='{page}'>station page</a>"), data = glue("<a href='{url}'>realtime file</a>")) |>
  kable(escape = F, caption = "Buoys and the tide station read (NDBC keeps the last 45 days in these files).")
Table 22: Buoys and the tide station read (NDBC keeps the last 45 days in these files).
buoy name latitude longitude km to the nearest cast record read page data
46225 Torrey Pines Outer 32.933 -117.391 2.3 2026-09-28 to 2026-11-12 station page realtime file
46254 Scripps Nearshore 32.868 -117.267 9.3 2026-09-28 to 2026-11-12 station page realtime file
46258 Mission Bay West 32.749 -117.502 11.2 2026-09-28 to 2026-11-12 station page realtime file
46232 Point Loma South 32.517 -117.425 38.0 2026-09-28 to 2026-11-12 station page realtime file
46086 San Clemente Basin 32.504 -118.029 17.4 2026-10-12 to 2026-11-12 station page realtime file
46224 Oceanside Offshore 33.178 -117.472 29.3 2026-09-28 to 2026-11-12 station page realtime file
46222 San Pedro 33.614 -118.314 20.8 2026-09-28 to 2026-11-12 station page realtime file
46025 Santa Monica Basin 33.765 -119.077 15.3 2026-09-28 to 2026-11-12 station page realtime file
46047 Tanner Bank 32.418 -119.535 26.5 2026-09-28 to 2026-11-12 station page realtime file
46219 San Nicolas Island 33.226 -119.891 13.3 2026-09-28 to 2026-11-12 station page realtime file
46069 South Santa Rosa 33.657 -120.227 26.1 2026-09-28 to 2026-11-12 station page realtime file
46053 East Santa Barbara 34.246 -119.842 48.9 2026-09-28 to 2026-11-12 station page realtime file
46221 Santa Monica Bay 33.860 -118.641 4.3 2026-09-28 to 2026-11-12 station page realtime file
46251 Santa Cruz Basin 33.769 -119.565 38.6 2026-09-28 to 2026-11-12 station page realtime file
46253 San Pedro South 33.576 -118.182 12.5 2026-09-28 to 2026-11-12 station page realtime file
46256 Long Beach Channel 33.700 -118.201 10.5 2026-09-28 to 2026-11-12 station page realtime file
LJAC1 9410230 32.867 -117.257 9.6 2026-09-28 to 2026-11-12 station page realtime file

11 Acknowledgements

The measurements are CalCOFI’s: the data were obtained from the California Cooperative Oceanic Fisheries Investigations, are available at https://calcofi.org/ and, as the integrated database used here, at https://calcofi.io/. CalCOFI data are licensed under the Creative Commons Attribution 4.0 International License. The November 2026 casts were collected aboard R/V Sally Ride and are preliminary.

The outside sources are credited as their providers ask:

  • Buoy data from CDIP, Scripps Institution of Oceanography (https://cdip.ucsd.edu/): data were furnished by the Coastal Data Information Program, Integrative Oceanography Division, operated by the Scripps Institution of Oceanography. Other buoys and the La Jolla tide station: NOAA National Data Buoy Center, https://www.ndbc.noaa.gov/, read 13 November 2026.
  • The Scripps Pier automated shore station is operated by the Southern California Coastal Ocean Observing System (SCCOOS) and was read through the IOOS sensors ERDDAP. The century-long manual record cited under context is the Shore Stations Program’s: “Data provided by the Shore Stations Program sponsored at Scripps Institution of Oceanography by California Department of Parks and Recreation, Natural Resources Division, Award# C1670003.”
  • Argo: “These data were collected and made freely available by the International Argo Program and the national programs that contribute to it. (https://argo.ucsd.edu, https://www.ocean-ops.org). The Argo Program is part of the Global Ocean Observing System.” Argo (2000), https://doi.org/10.17882/42182.
  • The Southern California Temperature Index: Rudnick, D. L., K. D. Zaba, R. E. Todd, and R. E. Davis, 2017: A climatology using data from the California Underwater Glider Network - Dataset. Scripps Institution of Oceanography, Instrument Development Group. https://doi.org/10.21238/S8SPRAY7292, read 13 November 2026.
  • NOAA OISST v2.1 (NOAA National Centers for Environmental Information, https://doi.org/10.25921/RE9P-PT57) and JPL MUR SST v4.1 (“These data were provided by JPL under support by NASA MEaSUREs program”; https://doi.org/10.5067/GHGMR-4FJ04), both through NOAA CoastWatch West Coast ERDDAP.

12 Code

Every figure and table above has its code folded beside it. The steps that run before the summary are hidden at the top of the page so that the summary comes first; they are shown here, in the order they run. The whole notebook is 2026-11_temperature-anomaly.qmd.

Setup

code
librarian::shelf(
  calcofi4r, cmocean, DBI, dplyr, DT, duckdb, ggplot2, ggrepel, glue, gsw, here, htmltools, knitr,
  patchwork, purrr, readr, rnaturalearth, sf, stringr, terra, tibble, tidyr,
  quiet = T)
options(readr.show_col_types = F, knitr.kable.NA = "")

# constants ----
VER       <- "v2026.11.12"    # the release this page is computed from
VER_PREV  <- "v2026.11.09"    # the release its first version was computed from (archived beside it): compared under the caveats
CRUISE    <- "2026-11-33P4"   # R/V Sally Ride, 31 October to 7 November 2026
core      <- c("093.3 028.0", "093.3 030.0")   # the two stations at the heart of the warm layer
BASE_URL  <- "https://storage.googleapis.com/calcofi-db"
DIR_DATA  <- here("data/2026-11_temperature-anomaly")   # small tables this page writes or keeps
DIR_CACHE <- Sys.getenv("CALCOFI_CACHE_DIR", tools::R_user_dir("calcofi", "cache"))
KM_PER_STATION <- 7.386       # +proj=calcofi: a line is equidistant, 7.386 km (4 nmi) per station unit
ANOM_MAX  <- 13               # the top of the departure scale, shared by the map and the section (°C)
dir.create(DIR_DATA, showWarnings = F, recursive = T)

# brand v2 inks (https://calcofi.io/brand/v2/theme.css) ----
INK      <- "#182b49"
MUTED    <- "#66686a"
GRID     <- "#e4e4e4"
SAND     <- "#f5f0e6"
STONE    <- "#b6b1a9"
COL_2026 <- "#b3261e"
COL_2015 <- "#c69214"
COL_NORM <- "#00629b"

# number formats: one decimal, a signed departure with a true minus, thousands ----
f1  <- function(x, d = 1) formatC(x, format = "f", digits = d)
fs  <- function(x, d = 1) sub("-", "−", sprintf(paste0("%+.", d, "f"), x), fixed = T)
fk  <- function(x) format(x, big.mark = ",", trim = T)
fsa <- function(x, d = 0) ifelse(!is.na(x) & abs(x) < 0.5 * 10^-d, formatC(0, format = "f", digits = d), fs(x, d))   # axis labels: a bare 0
nb  <- function(x) gsub("–", "\u2060–\u2060", gsub("-", "\u2011", x, fixed = T), fixed = T)   # no line break inside a key or a range
dt_ <- function(d, ...) datatable(
  d, rownames = F, class = "compact stripe", extensions = "Buttons",
  options = list(dom = "Bfrtip", pageLength = 12, buttons = c("copy", "csv")), ...)

# plot theme ----
theme_story <- function(base_size = 12) {
  theme_minimal(base_size = base_size) +
    theme(
      text                  = element_text(colour = INK),
      axis.text             = element_text(colour = MUTED),
      panel.grid.major      = element_line(colour = GRID, linewidth = 0.3),
      panel.grid.minor      = element_blank(),
      plot.title            = element_text(face = "bold", size = rel(1.12)),
      plot.subtitle         = element_text(colour = MUTED, size = rel(0.9), margin = margin(b = 8)),
      plot.caption          = element_text(colour = MUTED, size = rel(0.72), hjust = 0, lineheight = 1.15),
      plot.title.position   = "plot",
      plot.caption.position = "plot",
      strip.text            = element_text(face = "bold", colour = INK, hjust = 0),
      legend.position       = "none")}

Release objects, through the catalog

code
# the release catalog is the only source of object URLs (calcofi4r::cc_catalog() / cc_release_sources()):
# every table below is read from the URLs the catalog lists, never from a path built by hand
CAT   <- cc_catalog(VER)
con   <- dbConnect(duckdb())
d_src <- tibble()   # every object this page reads: the table under "Data sources"

# a release object by its catalog URL, kept in a local cache (objects are content-addressed and immutable) ----
mirror <- function(url) {
  path <- file.path(DIR_CACHE, sub(paste0(BASE_URL, "/"), "", url, fixed = T))
  if (!file.exists(path)) {
    dir.create(dirname(path), recursive = T, showWarnings = F)
    curl::curl_download(url, paste0(path, ".part"), quiet = T)
    file.rename(paste0(path, ".part"), path)}
  path}

# a DuckDB view over one release table: all of its objects, or the partitions named in `parts` ----
release_view <- function(table, parts = NULL, cols = "*", name = table) {
  src  <- cc_release_sources(CAT, table)
  urls <- src$urls
  if (!is.null(parts))
    urls <- unique(unlist(lapply(parts, \(p) grep(glue("={p}/"), urls, fixed = T, value = T))))   # the catalog lists some objects twice
  stopifnot(length(urls) >= 1, is.null(parts) || length(urls) == length(parts))
  files <- vapply(urls, mirror, "", USE.NAMES = F)
  dbExecute(con, glue(
    "CREATE OR REPLACE VIEW {name} AS SELECT {cols} FROM read_parquet(",
    "[{paste0(\"'\", files, \"'\", collapse = ', ')}], hive_partitioning = {tolower(src$hive)}, union_by_name = true)"))
  d_src <<- bind_rows(d_src, tibble(
    table = table, partition = if (is.null(parts)) NA_character_ else parts, url = urls, mb = file.size(files) / 1e6))
  invisible(urls)}

# the tables this page reads ----
release_view("cruise")
release_view("sample", cols = "* EXCLUDE (geom)")
release_view("sample_measurement")
release_view("measurement_type")
release_view("obs_env",      parts = c("temperature_ave", "temperature", "salinity_ave_corr", "salinity"))
release_view("climatology",  parts = c("temperature_ave", "temperature", "salinity_ave_corr", "salinity", "mld_sigma_theta_0125"))
release_view("obs_ctd_full", parts = CRUISE)

Every temperature cell and its departure

code
CREATE OR REPLACE TABLE cell AS
-- every temperature cell in the record with its departure from the release's own climatology.
-- a CELL is one cruise x station (site_key) x 10 m depth bin of one dataset: the mean of its quality-ok observations.
-- its baseline is the climatology row of the SAME dataset, station, depth bin and measurement type for the CRUISE's
-- month (obs_env.cruise_month = cruise.month_median), the rule every CalCOFI app applies. A cell whose month has no
-- monthly baseline keeps anom NULL: never 0. The seasonal baseline (the cruise's season) rides along as anom_season.
WITH o AS (
  SELECT dataset_key, measurement_type, cruise_key, site_key, depth_bin,
         any_value(cruise_month) AS cruise_month, any_value(year) AS cruise_year,
         avg(value) AS v, count(*) AS n_obs, avg(depth_min_m) AS depth_m,
         avg(latitude) AS latitude, avg(longitude) AS longitude, min(datetime) AS datetime
  FROM obs_env
  WHERE measurement_type IN ('temperature_ave', 'temperature')          -- CTD sensor-pair average; bottle (QC'd)
    AND dataset_key IN ('calcofi_ctd-cast', 'calcofi_bottle')
    AND qual_ok AND value IS NOT NULL AND depth_bin IS NOT NULL AND site_key IS NOT NULL
  GROUP BY ALL)
SELECT o.*,
       TRY_CAST(split_part(o.site_key, ' ', 1) AS DOUBLE) AS line,
       TRY_CAST(split_part(o.site_key, ' ', 2) AS DOUBLE) AS station,
       c.clim_mean, c.clim_sd, c.clim_n, c.n_cruises, c.season_mean, c.season_sd, c.season_n_cruises,
       o.v - c.clim_mean   AS anom,
       o.v - c.season_mean AS anom_season
FROM o
LEFT JOIN climatology c
  ON c.dataset_key = o.dataset_key AND c.measurement_type = o.measurement_type AND c.site_key = o.site_key
 AND c.month = o.cruise_month AND c.depth_bin = o.depth_bin

Cruises, and the one-metre casts of the cruise

code
CREATE OR REPLACE TABLE cruise_ref AS
-- one row per cruise: its dates, its month (the median cast month) and the stage of its CTD casts
SELECT c.cruise_key, c.year, c.month_median AS cruise_month, c.date_min, c.date_max, c.date_median, c.ship_name,
       (SELECT string_agg(DISTINCT s.data_stage, ', ' ORDER BY s.data_stage) FROM sample s
        WHERE s.cruise_key = c.cruise_key AND s.dataset_key = 'calcofi_ctd-cast' AND s.sample_type = 'cast') AS ctd_stage
FROM cruise c
code
CREATE OR REPLACE TABLE cast_1m AS
-- the November 2026 casts at the CTD's full 1 m resolution (obs_ctd_full), with their station
SELECT s.site_key, f.sample_key, right(f.sample_key, 1) AS direction, f.depth_min_m AS depth_m,
       f.measurement_type, f.measurement_value AS value, f.measurement_qual, f.datetime, f.latitude, f.longitude
FROM obs_ctd_full f JOIN sample s USING (sample_key)
WHERE f.measurement_type IN ('temperature_ave', 'temperature_1', 'temperature_2', 'salinity_1', 'salinity_2',
                             'salinity_ave_corr', 'sigma_theta_1', 'salinity_btl', 'oxygen_btl_ml_l', 'oxygen_ml_l_1')

Profiles on every 10 m bin, and layer means

code
CREATE OR REPLACE MACRO interp_profile(col) AS TABLE
-- an anomaly (or temperature) profile on every 10 m bin from 0 to 190 m: linear interpolation IN DEPTH between the
-- bins that were sampled (never across more than 60 m, never beyond the deepest or above the shallowest sampled bin,
-- never in time or between stations). It puts the bottle series (standard depths) on the CTD's footing.
WITH a AS (SELECT dataset_key, cruise_key, site_key, depth_bin, col AS a FROM cell WHERE col IS NOT NULL AND depth_bin < 260),
casts AS (SELECT DISTINCT dataset_key, cruise_key, site_key FROM a),
t AS (SELECT c.*, b.depth_bin FROM casts c, (SELECT unnest(range(0, 200, 10)) AS depth_bin) b)
SELECT t.dataset_key, t.cruise_key, t.site_key, t.depth_bin,
       CASE WHEN lo.depth_bin = hi.depth_bin THEN lo.a
            WHEN hi.depth_bin - lo.depth_bin <= 60 THEN lo.a + (hi.a - lo.a) * (t.depth_bin - lo.depth_bin) / (hi.depth_bin - lo.depth_bin) END AS a
FROM t
ASOF LEFT JOIN a lo ON lo.dataset_key = t.dataset_key AND lo.cruise_key = t.cruise_key AND lo.site_key = t.site_key AND lo.depth_bin <= t.depth_bin
ASOF LEFT JOIN a hi ON hi.dataset_key = t.dataset_key AND hi.cruise_key = t.cruise_key AND hi.site_key = t.site_key AND hi.depth_bin >= t.depth_bin
code
CREATE OR REPLACE TABLE prof AS
-- the three interpolated profiles side by side. The key columns are the USING columns (coalesced over the three sides):
-- a cruise in a month with no monthly normal (September 1997) has no row on the anom side and must keep its keys.
SELECT dataset_key, cruise_key, site_key, depth_bin, m.a AS anom, s.a AS anom_season, v.a AS temp
FROM interp_profile(anom) m
FULL JOIN interp_profile(anom_season) s USING (dataset_key, cruise_key, site_key, depth_bin)
FULL JOIN interp_profile(v) v USING (dataset_key, cruise_key, site_key, depth_bin)
code
CREATE OR REPLACE TABLE station_layer AS
-- one row per cast x layer: the depth-mean where the layer is complete (every 10 m bin of it present)
WITH l AS (SELECT * FROM (VALUES ('surface (0-10 m)', 0, 0), ('0-50 m', 0, 40), ('50-200 m', 50, 190), ('0-200 m', 0, 190)) AS t(layer, b0, b1))
SELECT p.dataset_key, p.cruise_key, p.site_key, l.layer,
       TRY_CAST(split_part(p.site_key, ' ', 1) AS DOUBLE) AS line, TRY_CAST(split_part(p.site_key, ' ', 2) AS DOUBLE) AS station,
       CASE WHEN count(p.anom)        = (l.b1 - l.b0) / 10 + 1 THEN avg(p.anom) END        AS anom,
       CASE WHEN count(p.anom_season) = (l.b1 - l.b0) / 10 + 1 THEN avg(p.anom_season) END AS anom_season,
       CASE WHEN count(p.temp)        = (l.b1 - l.b0) / 10 + 1 THEN avg(p.temp) END        AS temp
FROM prof p JOIN l ON p.depth_bin BETWEEN l.b0 AND l.b1
GROUP BY p.dataset_key, p.cruise_key, p.site_key, l.layer, l.b0, l.b1

Each cruise over the fall 2026 stations, and on shared stations

code
CREATE OR REPLACE TABLE cruise_layer AS
-- every cruise's layer mean over ONE fixed set of stations: the ones the November 2026 cruise occupied.
-- `covered`: the cruise occupied at least 60 % of the stations November 2026 has for that layer.
WITH fp AS (SELECT DISTINCT site_key FROM cell WHERE cruise_key = '2026-11-33P4' AND dataset_key = 'calcofi_ctd-cast'),
n26 AS (SELECT layer, count(anom) AS n_ref, count(anom_season) AS n_ref_season FROM station_layer WHERE cruise_key = '2026-11-33P4' GROUP BY layer),
x AS (
  SELECT s.dataset_key, s.cruise_key, s.layer,
         count(s.anom) AS n_sta, avg(s.anom) AS anom, max(s.anom) AS anom_max_station,
         count(s.anom_season) AS n_sta_season, avg(s.anom_season) AS anom_season, avg(s.temp) AS temp
  FROM station_layer s SEMI JOIN fp USING (site_key)
  GROUP BY ALL)
SELECT x.*, n26.n_ref, n26.n_ref_season,
       x.n_sta >= 0.6 * n26.n_ref AS covered, x.n_sta_season >= 0.6 * n26.n_ref_season AS covered_season,
       c.year, c.cruise_month, c.date_min, c.date_max
FROM x JOIN n26 USING (layer) LEFT JOIN cruise_ref c USING (cruise_key)
code
CREATE OR REPLACE TABLE paired AS
-- the strictest comparison: November 2026 against every other cruise ON THE STATIONS THEY SHARE, by three yardsticks:
-- the departure from the monthly normal, from the seasonal normal, and the layer's temperature itself (no baseline)
WITH ref AS (SELECT site_key, layer, anom AS a26, anom_season AS s26, temp AS t26 FROM station_layer WHERE cruise_key = '2026-11-33P4' AND dataset_key = 'calcofi_ctd-cast')
SELECT s.dataset_key, s.cruise_key, s.layer,
       count(*)           FILTER (WHERE s.anom IS NOT NULL AND r.a26 IS NOT NULL)        AS n_month,
       avg(s.anom)        FILTER (WHERE s.anom IS NOT NULL AND r.a26 IS NOT NULL)        AS anom_other,
       avg(r.a26)         FILTER (WHERE s.anom IS NOT NULL AND r.a26 IS NOT NULL)        AS anom_2026,
       count(*)           FILTER (WHERE s.anom_season IS NOT NULL AND r.s26 IS NOT NULL) AS n_season,
       avg(s.anom_season) FILTER (WHERE s.anom_season IS NOT NULL AND r.s26 IS NOT NULL) AS season_other,
       avg(r.s26)         FILTER (WHERE s.anom_season IS NOT NULL AND r.s26 IS NOT NULL) AS season_2026,
       count(*)           FILTER (WHERE s.temp IS NOT NULL AND r.t26 IS NOT NULL)        AS n_temp,
       avg(s.temp)        FILTER (WHERE s.temp IS NOT NULL AND r.t26 IS NOT NULL)        AS temp_other,
       avg(r.t26)         FILTER (WHERE s.temp IS NOT NULL AND r.t26 IS NOT NULL)        AS temp_2026
FROM station_layer s JOIN ref r USING (site_key, layer)
WHERE s.cruise_key <> '2026-11-33P4'
GROUP BY ALL

The numbers of the summary

code
q <- function(sql, ...) dbGetQuery(con, glue_sql(sql, ..., .con = con)) |> as_tibble()

# two casts hold bad values, not warm water (shown under "Single measurements"): left out where events are compared ----
invisible(dbExecute(con, "
  CREATE OR REPLACE VIEW cell_ok AS
  SELECT * FROM cell
  WHERE NOT (cruise_key = '1994-01-31JD' AND dataset_key = 'calcofi_ctd-cast' AND site_key = '093.3 028.0' AND depth_bin >= 510)
    AND NOT (cruise_key = '1959-10-31OR' AND site_key = '093.3 035.0')"))

# the record cell and the previous record ----
d_cell26 <- q("SELECT * FROM cell WHERE cruise_key = {CRUISE} AND anom IS NOT NULL ORDER BY anom DESC")
top      <- d_cell26[1, ]
prev     <- q("SELECT * FROM cell WHERE cruise_key <> {CRUISE} AND anom IS NOT NULL ORDER BY anom DESC LIMIT 1")
d_share  <- q("
  WITH r AS (SELECT cruise_key, anom, row_number() OVER (ORDER BY anom DESC) AS rk FROM cell WHERE anom IS NOT NULL)
  SELECT count(*) AS n_cells, count(DISTINCT cruise_key) AS n_cruises,
         count(*) FILTER (WHERE rk <= 50  AND cruise_key = {CRUISE}) AS of_top_50,
         count(*) FILTER (WHERE rk <= 100 AND cruise_key = {CRUISE}) AS of_top_100,
         count(*) FILTER (WHERE cruise_key = {CRUISE} AND anom > {prev$anom}) AS n_above_prev,
         min(substr(cruise_key, 1, 4)) AS yr0
  FROM r")
n_cruises_all <- q("SELECT count(DISTINCT cruise_key) AS n FROM cell")$n

# each earlier warm event's largest single departure, by the monthly normal and by the seasonal one ----
d_evmax <- q("
  WITH ev AS (SELECT * FROM (VALUES ('1957–59', 1957, 1959), ('1982–83', 1982, 1983), ('1997–98', 1997, 1998), ('2014–16', 2014, 2016)) t(event, y0, y1))
  SELECT ev.event, max(c.anom) AS anom, arg_max(c.cruise_key, c.anom) AS cruise_key, arg_max(c.site_key, c.anom) AS site_key,
         arg_max(c.depth_bin, c.anom) AS depth_bin, max(c.anom_season) AS anom_s, arg_max(c.cruise_key, c.anom_season) AS cruise_s,
         arg_max(c.site_key, c.anom_season) AS site_s, arg_max(c.depth_bin, c.anom_season) AS bin_s
  FROM cell_ok c JOIN ev ON c.cruise_year BETWEEN ev.y0 AND ev.y1 GROUP BY ev.event ORDER BY ev.event")
evm <- function(e) d_evmax[d_evmax$event == e, ]
sta <- function(site_key) sub("^0", "", gsub(" 0+", " ", site_key))      # "093.3 030.0" -> "93.3 30.0"
stopifnot(abs(c(evm("1982–83")$anom, evm("1997–98")$anom, evm("1997–98")$anom_s) - 6) < 0.6)   # "near +6 °C" in the summary

# layer means over the stations the cruise occupied ----
d_layer <- q("SELECT * FROM cruise_layer WHERE covered") |>
  mutate(series = if_else(dataset_key == "calcofi_bottle", "bottle", "CTD"))
lay <- function(layer_, cruise_ = CRUISE, ds = "calcofi_ctd-cast") d_layer |>
  filter(layer == layer_, cruise_key == cruise_, dataset_key == ds)
runner <- function(layer_) d_layer |> filter(layer == layer_, cruise_key != CRUISE) |> slice_max(anom, n = 1, with_ties = F)

# the cruise, station by station ----
d_sta <- q("
  SELECT s.site_key, s.line, s.station, s.layer, s.anom, s.anom_season, s.temp, p.lat, p.lon, p.t0
  FROM station_layer s
  JOIN (SELECT site_key, avg(latitude) AS lat, avg(longitude) AS lon, min(datetime) AS t0 FROM cell
        WHERE cruise_key = {CRUISE} AND depth_bin = 0 GROUP BY site_key) p USING (site_key)
  WHERE s.cruise_key = {CRUISE}") |>
  mutate(km_offshore = (station - 26.4) * KM_PER_STATION)
sfc   <- d_sta |> filter(layer == "surface (0-10 m)", !is.na(anom))
# the inner Southern California Bight: the stations inshore of the front the cruise crossed
inner <- sfc |> filter((line >= 88 & station <= 37) | (line < 88 & station <= 51))
outer <- sfc |> anti_join(inner, by = "site_key")
stopifnot(min(inner$anom) > max(outer$anom))   # the two groups do not overlap: a front, not a gradient

# salinity and mixed-layer depth on the inshore end of line 93.3 ----
d_sal <- q("
  SELECT o.site_key, o.depth_bin, avg(o.value) AS sal, any_value(c.clim_mean) AS clim, any_value(c.clim_sd) AS sd
  FROM obs_env o LEFT JOIN climatology c
    ON c.measurement_type = o.measurement_type AND c.dataset_key = o.dataset_key AND c.site_key = o.site_key
   AND c.depth_bin = o.depth_bin AND c.month = o.cruise_month
  WHERE o.cruise_key = {CRUISE} AND o.measurement_type = 'salinity_ave_corr' AND o.qual_ok
    AND o.site_key IN ({core*}) AND o.depth_bin <= 40
  GROUP BY ALL")
d_mld <- q("
  SELECT s.site_key, m.measurement_value AS mld, c.clim_mean AS clim, c.n_cruises
  FROM sample_measurement m JOIN sample s USING (sample_key)
  LEFT JOIN climatology c ON c.measurement_type = m.measurement_type AND c.site_key = s.site_key AND c.month = 11 AND c.depth_bin IS NULL
  WHERE s.cruise_key = {CRUISE} AND m.measurement_type = 'mld_sigma_theta_0125'
    AND s.site_key IN ('093.3 026.7', '093.3 028.0', '093.3 030.0')")

mt   <- q("SELECT description, derivation FROM measurement_type WHERE measurement_type = 'mld_sigma_theta_0125'")
cr   <- q("SELECT * FROM cruise_ref WHERE cruise_key = {CRUISE}")
n_st <- n_distinct(d_sta$site_key)
k <- list(
  top_anom   = top$anom,  top_v = top$v, top_clim = top$clim_mean, top_n = top$n_cruises,
  top_site   = top$site_key, top_bin = top$depth_bin, top_date = as.Date(top$datetime),
  top_km     = round((top$station - 26.4) * KM_PER_STATION),
  prev_anom  = prev$anom, prev_cruise = prev$cruise_key,
  l50        = lay("0-50 m")$anom,   l50_n  = lay("0-50 m")$n_sta,   l50_prev  = runner("0-50 m"),
  l200       = lay("50-200 m")$anom, l200_n = lay("50-200 m")$n_sta, l200_prev = runner("50-200 m"),
  feb98      = lay("0-50 m", "1998-02-31JD")$anom,
  sal        = range(d_sal$sal), sal_anom = range(d_sal$sal - d_sal$clim),
  mld        = range(d_mld$mld), mld_clim = range(d_mld$clim))
stopifnot(top$site_key == "093.3 030.0", top$depth_bin == 40, nrow(cr) == 1)

Temperature and salinity of every cruise in the inner Bight

code
# temperature and salinity departures of every cruise over the inner-Bight stations, upper 50 m, against the BOTTLE
# series' normals (quality-controlled; the CTD salinity normal carries unflagged spikes). Bottle casts through 2021;
# the fall 2026 cruise from its CTD, whose salinity matches the bottles drawn on board (see "Bottles").
# a station counts when at least three of its five 10 m bins have a value and a normal; a cruise when 8 stations do
d_tsx_all <- q("
  WITH o AS (
    SELECT cruise_key, CASE WHEN measurement_type LIKE 'salinity%' THEN 'S' ELSE 'T' END AS var, site_key, depth_bin,
           any_value(cruise_month) AS m, avg(value) AS v
    FROM obs_env
    WHERE qual_ok AND depth_bin <= 40 AND site_key IN ({inner$site_key*})
      AND ((dataset_key = 'calcofi_bottle'   AND measurement_type IN ('temperature', 'salinity'))
        OR (dataset_key = 'calcofi_ctd-cast' AND measurement_type IN ('temperature_ave', 'salinity_ave_corr') AND cruise_key = {CRUISE}))
    GROUP BY ALL),
  a AS (
    SELECT o.cruise_key, o.var, o.site_key,
           count(c.clim_mean)   AS bins,   avg(o.v - c.clim_mean)   AS anom,      -- against the monthly normal
           count(c.season_mean) AS bins_s, avg(o.v - c.season_mean) AS anom_s     -- against the seasonal normal
    FROM o JOIN climatology c
      ON c.dataset_key = 'calcofi_bottle' AND c.measurement_type = CASE o.var WHEN 'S' THEN 'salinity' ELSE 'temperature' END
     AND c.site_key = o.site_key AND c.depth_bin = o.depth_bin AND c.month = o.m
    GROUP BY ALL)
  SELECT a.cruise_key, r.year, r.cruise_month,
         count(*) FILTER (WHERE var = 'T' AND bins >= 3) AS n_t, avg(anom) FILTER (WHERE var = 'T' AND bins >= 3) AS t_anom,
         count(*) FILTER (WHERE var = 'S' AND bins >= 3) AS n_s, avg(anom) FILTER (WHERE var = 'S' AND bins >= 3) AS s_anom,
         min(anom) FILTER (WHERE var = 'S' AND bins >= 3) AS s_min, max(anom) FILTER (WHERE var = 'S' AND bins >= 3) AS s_max,
         count(*) FILTER (WHERE var = 'S' AND bins_s >= 3) AS n_ss, avg(anom_s) FILTER (WHERE var = 'S' AND bins_s >= 3) AS s_season
  FROM a JOIN cruise_ref r USING (cruise_key) GROUP BY ALL")
d_tss   <- d_tsx_all |> filter(n_ss >= 8) |> arrange(desc(s_season))        # by the seasonal normal: more cruises
d_tsx   <- d_tsx_all |> filter(n_t >= 8, n_s >= 8)                          # by the monthly normal
tsx     <- function(cruise) d_tsx |> filter(cruise_key == cruise)
fs0     <- function(x, d = 2) if (abs(x) < 0.5 * 10^-d) f1(0, d) else fs(x, d)   # a departure that rounds to zero carries no sign
ts26    <- tsx(CRUISE)
ts_prev <- d_tsx |> filter(cruise_key != CRUISE) |> slice_max(s_anom, n = 1)
stopifnot(
  nrow(ts26) == 1, ts26$s_anom > ts_prev$s_anom, ts_prev$cruise_key == "1998-02-31JD", abs(tsx("2015-11-32OC")$s_anom) < 0.05,
  d_tss$cruise_key[1:2] == c(CRUISE, "1998-02-31JD"), nrow(d_tss) > nrow(d_tsx), "1997-09-32NM" %in% d_tss$cruise_key)   # the seasonal normal gives the same order

Outside sources (scripts/temperature_anomaly_outside_sources.py, run once)

code
#!/usr/bin/env python3
"""Outside sources for 2026-11_temperature-anomaly.qmd: measurements that never passed through the CalCOFI pipeline,
for the days and places of the November 2026 CTD casts.

  1. Buoys: NDBC / CDIP buoys and the NOS La Jolla tide station. NDBC's realtime2 files hold the last 45 days only,
     which is why this runs once and its small tables are kept in the repo.
       buoy_stations.csv   every station used: id, name, position, the URL read
       buoys_at_casts.csv  the water temperature reported nearest in time to each cast, for stations within MAX_KM
       buoy_series.csv     hourly mean water temperature of those stations over the whole file (about 45 days)
  2. Satellite analyses at each cast's position on the cast's day, from NOAA CoastWatch West Coast ERDDAP:
     NOAA OISST v2.1 near real time (0.25 degree; `sst` and its `anom` against 1971-2000) and
     JPL MUR v4.1 (0.01 degree; `analysed_sst`, and `sstAnom` against the 2003-2014 MUR climatology).
       satellite_at_casts.csv
  3. Argo float profiles in and around the cruise's box and dates, from the Ifremer ERDDAP.
       argo_profiles.csv
  4. The SCCOOS automated shore station on Scripps Pier (temperature and salinity at the coast, 2013 to now), as daily
     means of the values that pass the station's own quality tests, from the IOOS sensors ERDDAP (Axiom).
       pier_daily.csv
  5. The Southern California Temperature Index of the Scripps glider group (California Underwater Glider Network):
     the temperature departure at 50 m on CalCOFI line 90, coast to 200 km offshore, three-month running mean,
     monthly since 2007, from the group's ERDDAP.
       glider_index.csv
  6. sources.csv: every URL requested, and when.

usage: temperature_anomaly_outside_sources.py <casts.csv> <cache_dir> <out_dir>
  casts.csv is written by the notebook from the release (site_key, cast_id, time_utc, lat, lon, ctd_t_top3m).
  Responses are cached in cache_dir, so a second run repeats no request that already succeeded; ERDDAP answers 503
  under load, and a value it could not serve is left empty and filled by the next run. OUTSIDE_OFFLINE=1 rebuilds the
  tables from the cache alone.
Only cast positions and times go out, to public data services; nothing identifies who asks.
"""
import csv, hashlib, math, os, sys, time, urllib.request
from collections import defaultdict
from datetime import datetime, timezone, timedelta

UA      = {"User-Agent": "Mozilla/5.0 (data-check script)"}
MAX_KM  = 15.0     # a buoy is compared with a cast when it is this close
MAX_MIN = 45       # and reported within this many minutes of it
BUOYS   = ["46225", "46254", "46258", "46232", "46086", "46224", "46222", "46025", "46047", "46219", "46069", "46053",
           "46221", "46251", "46253", "46256", "LJAC1"]
SERIES  = ["46225", "46254", "LJAC1", "46258", "46232", "46086", "46221", "46219", "46047"]   # kept as hourly series
NDBC    = "https://www.ndbc.noaa.gov"
ERDDAP  = "https://coastwatch.pfeg.noaa.gov/erddap/griddap/"
ARGO    = "https://erddap.ifremer.fr/erddap/tabledap/ArgoFloats.csv"
PIER    = "https://erddap.sensors.axds.co/erddap/tabledap/scripps-pier-automated-shore-sta-1.csv"
GLIDER  = "https://spraydata.ucsd.edu/erddap/tabledap/socal_index_monthly_v1.csv?time,scti"
SOURCES = []

def fetch(url, cache_dir, name=None, tries=3, wait=4):
  """the body of a URL, from the cache when a previous run already has it; None when the server will not serve it"""
  f = os.path.join(cache_dir, name or hashlib.sha1(url.encode()).hexdigest()[:16] + ".txt")
  if os.path.exists(f) and os.path.getsize(f) > 0:
    SOURCES.append((url, datetime.fromtimestamp(os.path.getmtime(f), timezone.utc).strftime("%Y-%m-%dT%H:%MZ"), "ok"))
    return open(f, encoding="utf-8", errors="replace").read()
  if os.environ.get("OUTSIDE_OFFLINE"):                        # build the tables from the cache alone, asking no server
    return None
  err = None
  for i in range(tries):
    try:
      with urllib.request.urlopen(urllib.request.Request(url, headers=UA), timeout=45) as r:
        body = r.read()
      open(f, "wb").write(body)
      SOURCES.append((url, datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%MZ"), "ok"))
      return body.decode("utf-8", "replace")
    except Exception as e:
      err = e; time.sleep(wait * (i + 1))
  print(f"  not served: {url} ({err})", file=sys.stderr, flush=True)
  SOURCES.append((url, datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%MZ"), f"failed: {err}"))
  return None

def km(lat1, lon1, lat2, lon2):
  p1, p2 = math.radians(lat1), math.radians(lat2)
  a = math.sin((p2 - p1) / 2) ** 2 + math.cos(p1) * math.cos(p2) * math.sin(math.radians(lon2 - lon1) / 2) ** 2
  return 6371.0 * 2 * math.asin(math.sqrt(a))

def write(path, rows, fields=None):
  with open(path, "w", newline="") as f:
    w = csv.DictWriter(f, fieldnames=fields or list(rows[0].keys())); w.writeheader(); w.writerows(rows)
  print(f"wrote {path} ({len(rows)} rows)", flush=True)

def glider_index(cache, out):
  txt = fetch(GLIDER, cache, "glider_index_tabledap.csv")
  if txt:
    rows = list(csv.reader(txt.strip().splitlines()))
    write(os.path.join(out, "glider_index.csv"),
          [dict(month=r[0][:7], scti=round(float(r[1]), 3)) for r in rows[2:] if len(r) > 1 and r[1] not in ("", "NaN")])

def main():
  casts_csv, cache, out = sys.argv[1:4]
  os.makedirs(cache, exist_ok=True); os.makedirs(out, exist_ok=True)
  casts = list(csv.DictReader(open(casts_csv)))
  for c in casts:
    c["t"] = datetime.strptime(c["time_utc"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)
    c["lat"], c["lon"] = float(c["lat"]), float(c["lon"])

  # ---- 1. buoys ----
  tbl = fetch(f"{NDBC}/data/stations/station_table.txt", cache, "station_table.txt")
  pos = {}
  for ln in tbl.splitlines():
    p = ln.split("|")
    if len(p) > 6 and p[0].upper() in BUOYS:
      w = p[6].split()                                         # "32.933 N 117.391 W (...)"
      pos[p[0].upper()] = dict(name=p[4].split(" - ")[0].strip(), lat=float(w[0]) * (1 if w[1] == "N" else -1),
                               lon=float(w[2]) * (-1 if w[3] == "W" else 1))
  stations, pairs, series = [], [], []
  for b in BUOYS:
    url = f"{NDBC}/data/realtime2/{b}.txt"
    txt = fetch(url, cache, f"ndbc_{b}.txt")
    if not txt or b not in pos: continue
    obs = []
    for ln in txt.splitlines():
      p = ln.split()
      if ln.startswith("#") or len(p) < 15 or p[14] == "MM": continue          # column 15 is WTMP, degC
      obs.append((datetime(*map(int, p[:5]), tzinfo=timezone.utc), float(p[14])))
    if not obs: continue
    near = min(km(c["lat"], c["lon"], pos[b]["lat"], pos[b]["lon"]) for c in casts)
    stations.append(dict(buoy=b, name=pos[b]["name"], lat=pos[b]["lat"], lon=pos[b]["lon"], km_to_nearest_cast=round(near, 1),
                         first_utc=min(o[0] for o in obs).strftime("%Y-%m-%dT%H:%MZ"), last_utc=max(o[0] for o in obs).strftime("%Y-%m-%dT%H:%MZ"),
                         n_obs=len(obs), url=url, page=f"{NDBC}/station_page.php?station={b.lower()}"))
    for c in casts:
      d = km(c["lat"], c["lon"], pos[b]["lat"], pos[b]["lon"])
      if d > MAX_KM: continue
      t, v = min(obs, key=lambda o: abs(o[0] - c["t"]))
      if abs(t - c["t"]) > timedelta(minutes=MAX_MIN): continue
      day = [x for tt, x in obs if abs(tt - c["t"]) <= timedelta(hours=12)]
      pairs.append(dict(site_key=c["site_key"], cast_time_utc=c["time_utc"], ctd_t_top3m=c["ctd_t_top3m"], buoy=b, buoy_name=pos[b]["name"],
                        km_apart=round(d, 1), buoy_time_utc=t.strftime("%Y-%m-%dT%H:%MZ"), buoy_wtmp=v,
                        buoy_minus_ctd=round(v - float(c["ctd_t_top3m"]), 2), buoy_24h_min=min(day), buoy_24h_max=max(day)))
    if b in SERIES:
      hours = defaultdict(list)
      for t, v in obs: hours[t.strftime("%Y-%m-%dT%H:00Z")].append(v)
      series += [dict(buoy=b, hour_utc=h, wtmp=round(sum(v) / len(v), 2), n=len(v)) for h, v in sorted(hours.items())]
  pairs.sort(key=lambda r: (r["cast_time_utc"], r["km_apart"]))
  write(os.path.join(out, "buoy_stations.csv"), stations)
  write(os.path.join(out, "buoys_at_casts.csv"), pairs)
  write(os.path.join(out, "buoy_series.csv"), series)

  # ---- 3. Argo (before the satellites: it is one quick request) ----
  t0 = (min(c["t"] for c in casts) - timedelta(days=16)).strftime("%Y-%m-%dT00:00:00Z")
  t1 = (max(c["t"] for c in casts) + timedelta(days=6)).strftime("%Y-%m-%dT00:00:00Z")
  box = (min(c["lat"] for c in casts) - 0.7, max(c["lat"] for c in casts) + 0.8, min(c["lon"] for c in casts) - 0.6, max(c["lon"] for c in casts) + 0.4)
  url = (f"{ARGO}?platform_number,cycle_number,time,latitude,longitude,pres,temp,psal,temp_qc&time%3E={t0}&time%3C={t1}"
         f"&latitude%3E={box[0]:.2f}&latitude%3C={box[1]:.2f}&longitude%3E={box[2]:.2f}&longitude%3C={box[3]:.2f}&pres%3C=160")
  txt = fetch(url, cache, "argo.csv")
  if txt:
    rows = list(csv.reader(txt.strip().splitlines()))
    write(os.path.join(out, "argo_profiles.csv"), [dict(zip(rows[0], r)) for r in rows[2:]], rows[0])

  # ---- 4. Scripps Pier: daily means of temperature and of salinity, each where its own QC aggregate is 1 (pass) ----
  day = {}
  for var, key in (("sea_water_temperature_ctd", "temp"), ("sea_water_practical_salinity_ctd", "sal")):
    txt = fetch(f"{PIER}?time,{var}&{var}_qc_agg=1&orderByMean(%22time/1day%22)", cache, f"pier_{key}_daily.csv")
    for ln in (txt or "").strip().splitlines()[2:]:
      t, v = ln.split(",")[:2]
      if v not in ("NaN", ""): day.setdefault(t[:10], {})[key] = round(float(v), 3)
  if day:
    write(os.path.join(out, "pier_daily.csv"), [dict(date=d, temp=v.get("temp", ""), sal=v.get("sal", "")) for d, v in sorted(day.items())])

  # ---- 5. the glider group's temperature index: one small file, month (the centre of the three-month mean) and value ----
  glider_index(cache, out)

  # ---- 2. satellite analyses ----
  # OISST: one gridded request per day over the cruise's box. MUR: one point request per cast and variable.
  lat0, lat1 = min(c["lat"] for c in casts) - 0.3, max(c["lat"] for c in casts) + 0.3
  lon0, lon1 = min(c["lon"] for c in casts) - 0.3, max(c["lon"] for c in casts) + 0.3
  def oisst(var, day):
    q = f"{var}%5B({day}T12:00:00Z)%5D%5B(0.0)%5D%5B({lat0:.2f}):1:({lat1:.2f})%5D%5B({lon0:.2f}):1:({lon1:.2f})%5D"
    txt = fetch(f"{ERDDAP}ncdcOisst21NrtAgg_LonPM180.csv?{q}", cache, f"oisst_{var}_{day}.csv")
    pts = []
    for ln in (txt or "").strip().splitlines()[2:]:
      p = ln.split(",")
      if p[-1] not in ("NaN", ""): pts.append((float(p[-3]), float(p[-2]), float(p[-1])))
    return pts
  def nearest(pts, c, max_km=25):
    if not pts: return None
    la, lo, v = min(pts, key=lambda q: km(c["lat"], c["lon"], q[0], q[1]))
    return round(v, 2) if km(c["lat"], c["lon"], la, lo) <= max_km else None
  def mur(ds, var, c):
    day = c["t"].strftime("%Y-%m-%d")
    q = f"{var}%5B({day}T09:00:00Z)%5D%5B({c['lat']:.3f})%5D%5B({c['lon']:.3f})%5D"
    txt = fetch(f"{ERDDAP}{ds}.csv?{q}", cache, f"mur_{var}_{day}_{c['site_key'].replace(' ', '_')}.csv", tries=2)
    try: return round(float(txt.strip().splitlines()[2].split(",")[-1]), 2)
    except Exception: return None
  grids = {day: (oisst("sst", day), oisst("anom", day)) for day in sorted({c["t"].strftime("%Y-%m-%d") for c in casts})}
  sat = []
  for c in casts:
    g = grids[c["t"].strftime("%Y-%m-%d")]
    sat.append(dict(site_key=c["site_key"], cast_time_utc=c["time_utc"], lat=c["lat"], lon=c["lon"], ctd_t_top3m=c["ctd_t_top3m"],
                    oisst_sst=nearest(g[0], c), oisst_anom=nearest(g[1], c),
                    mur_sst=mur("jplMURSST41", "analysed_sst", c), mur_anom=mur("jplMURSST41anom1day", "sstAnom", c)))
    print("  ", sat[-1]["site_key"], sat[-1]["ctd_t_top3m"], sat[-1]["oisst_sst"], sat[-1]["oisst_anom"], sat[-1]["mur_sst"], sat[-1]["mur_anom"], flush=True)
  write(os.path.join(out, "satellite_at_casts.csv"), sat)
  for k in ("oisst_sst", "oisst_anom", "mur_sst", "mur_anom"):
    print(f"  {k}: {sum(r[k] is not None for r in sat)} of {len(sat)} casts", flush=True)

  write(os.path.join(out, "sources.csv"), [dict(url=u, accessed_utc=t, status=s) for u, t, s in SOURCES])

if __name__ == "__main__":
  main()

The animation is a page of its own in the Explorer’s repository, driven by one clock and stepped frame by frame into the video: story/elnino-2026/ at the commit it was rendered from (CalCOFI/explore#55). render.sh is the whole pipeline in one command: it derives the page’s data from the analysis database (build_data.sql), builds the page, captures 900 frames in headless Chrome (capture.mjs) and encodes them with ffmpeg. Its files, read from that commit:

story/elnino-2026/README.md (142 lines)
# The 2026 warm water off Southern California, in 30 seconds

The rendered film is under the summary of <https://calcofi.io/workflows/2026-11_temperature-anomaly.html>, whose
Code section lists these files at the commit the film was rendered from. It was first rendered from release
v2026.11.09 (that render is at <https://www.youtube.com/watch?v=5ReTP7iafkc>) and again from v2026.11.12 on
2026-11-13, when the page's data came out byte for byte the same: only `page/data/release.json`, and so the credit
line, changed.

A story page of its own in this repo: one fixed 1920 × 1080 stage driven by **one clock** (`t`, 0 to 30 s), so the
same page plays live in a browser and is stepped frame by frame into a video. It is not part of the Explorer: it has
its own Vite root and its own `tsconfig.json` here, `npm run build` and `npm test` never see it, and nothing in `src/`
changed.

What it draws is the Explorer's own, imported rather than copied:

| piece | from |
|---|---|
| colour ramps (cmocean *thermal* for temperature, *balance* for the difference from normal) | `src/ramps.ts` |
| the interpolated maps and their isolines (thin-plate spline, blank beyond 60 km of a station, land clipped) | `src/contour.ts` + `src/contour.worker.ts` |
| the sea floor (GEBCO 2025 terrain PMTiles, decoded in the page) and its depth ramp | `src/basemap.ts` (`BATHY_URL`, `BATHY_RAMP`); the decode is `src/curtain.tsx`'s `loadMosaic()`, repeated in `page/terrain.ts` because that module is React |
| the 3-D section (a curtain along the line, the floor as a mesh, vertical exaggeration baked in) | the recipe of `src/curtain.tsx`, as a smaller deck.gl scene in `page/main.ts` |
| fonts and tokens | the brand's own files, copied verbatim into `page/brand/` (calcofi.io/brand/v2: `fonts.css`, `theme.css`, Source Sans 3, Teko), dark |

## Two scales, fixed for the whole film

| | ramp | range | legend ticks |
|---|---|---|---|
| temperature at the surface | cmocean *thermal* | 11 to 26 °C | 12, 16, 20, 24 |
| difference from normal (maps, year bars and the section) | cmocean *balance* | −13 to +13 °C | −12, −6, 0, +6, +12 |

Neither is ever rescaled: a redder frame is a warmer ocean. The consequence is intended and is the story: ordinary
years are pale, 2014–15 pink, 2026 red, and the darkest red appears only under the surface in the last beat.

## The beats

| t (s) | beat | words on screen |
|---|---|---|
| 0 – 5.2 | The nine November cruises of the 1993–2013 baseline, one after another: the ship's track, each station at the surface (0–10 m) coloured by its temperature. The first is on screen from the first frame and holds 1.2 s; the others 0.5 s each. | "November" · the year · "Every fall, a ship measures the ocean off California" · the ship and its station count (stations with a 0–10 m CTD value on that cruise: the dots on screen) |
| 5.2 – 8.2 | All of them together: each station's values close into one, the release's own November normal there (a station with fewer than five cruises has none, and its dots leave). | "1993–2013" · "All of them together: the normal" · "Normal = the 1993–2013 average for November (9 cruises)" |
| 8.2 – 11 | The normal interpolated: first on a coarse regular grid, drawn as its cells, then the map with its isotherms. | "The normal, mapped between the stations" · "Normal = the 1993–2013 average for November" |
| 11 – 15 | The next year, 2014: its track, its stations, its grid, its map. | "2014" · "The next year: one cruise, its stations, its map" · "75 stations" |
| 15 – 17 | The same cruise as its difference from the normal. | "The same cruise, as its difference from normal" · "Red is warmer than normal, blue is cooler" |
| 17 – 24 | Each November since, 2015 to 2026, against the same normal; 2026 holds two seconds. | the year · "Each November since, against the same normal" · the station count; on 2026: "At the surface: 5 to 8 °C warmer than normal near the coast" |
| 24 – 30 | The camera tilts. The map splits along line 93.3: the half behind stays as the sea surface, the half in front leaves, and the section hangs below it: the difference from normal, surface to 200 m, all seven stations, vertical exaggeration × 300. | "Line 93.3, off San Diego" · "2026" · "+12.8 °C" · "at 40–50 m depth: the largest departure in CalCOFI's record, 1949–2026" · "25 °C water down to 55 m" |

Throughout: a *preliminary data* pill on any cruise whose CTD casts are not `final` in the release (2021 onward); the
credit "CalCOFI · calcofi.io · CTD casts · release v2026.11.12".

**The strip** along the bottom says which cruise, out of all of them. Every November cruise is a dot on the years'
line (the other months' CTD cruises a faint texture behind it); the one on screen is yellow with its year under it;
2018 and 2020, whose fall cruise ran in October, are two empty dashed slots marked "no November cruise" (found from
the data, not listed). From 2014 on each cruise the film has played keeps a bar: its mean surface difference from normal **over the
stations the 2026 cruise occupied** (`cruises.json` `mean_anom_fp`), so the bars compare the same stations every year.

## Where each number on screen comes from

No number is typed in `page/main.ts`. `build_data.sql` writes them, and stops the build if one cannot be said.

| on screen | field of `page/data/` | what it is |
|---|---|---|
| "+12.8 °C" | `facts.json` `max_anom` | the largest departure of any cell of the cruise (station × 10 m bin) from the release's November normal |
| "at 40–50 m depth" | `facts.json` `max_anom_bin` (and `max_anom_station` for the ring on the section) | that cell's bin and station |
| "CalCOFI's record, 1949–2026" | `facts.json` `record_from`, `record_to` | the first and last cruise year in the CTD and bottle series |
| "25 °C water down to 55 m" | `facts.json` `layer_temp`, `layer_depth` | at the core stations (28 and 30) the mean of the 1 m bins of the upper 50 m, rounded; and the deepest 1 m bin, counted down from the surface without a break, still within 0.5 °C of it |
| "5 to 8 °C warmer than normal near the coast" | `facts.json` `coast_min`, `coast_max`, rounded | the 0–10 m departures at the 17 stations of the inner Southern California Bight ((line ≥ 88 and station ≤ 37) or (line < 88 and station ≤ 51)). The other 18 stations run `offshore_min` to `offshore_max`; the build fails if the two ranges overlap |
| the year bars and "+4.3 °C" over the current one | `cruises.json` `mean_anom_fp` | the mean 0–10 m departure over the 2026 cruise's stations |
| "9 cruises", "75 stations", the ship | `cruises.json` (`n_stations`, `ship`) | counted from the release: the baseline's November cruises; the stations of a cruise that have a 0–10 m CTD value (the dots on screen, which can be fewer than the cruise occupied) |
| the empty slots, "no November cruise" | derived in the page | the years from 2014 with no November cruise in `strip.json` |
| "release v2026.11.12" | `release.json` | the release the analysis database was built from |

That the largest departure of the cruise is also the largest "in CalCOFI's record" is the finding of
`analysis/` (out/findings.md); the page only repeats it.

## Files

| file | what it is |
|---|---|
| `build_data.sh`, `build_data.sql` | Derive `page/data/*.json` from the analysis database (`analysis/01`–`04`, which read release objects through the catalog). Deterministic: no timestamp, no network. |
| `page/data/*.json` | `cruises` (the 20 November cruises and their roles), `stations` (cruise × station at 0–10 m: position, time, temperature, normal, difference), `normal` (the November climatology at 0–10 m), `strip` (every CTD cruise), `section` (line 93.3, November 2026, every 10 m bin), `facts`, `release`. Committed, so the page builds without the database. |
| `page/index.html`, `page/style.css` | The stage: the canvas, the column of words, the two legends, the strip. |
| `page/main.ts` | The clock, the beats, the deck.gl scene, the words. `layersAt(t)`, `camAt(t)`, `wordsAt(t)`, `stripSvg(t)` are pure functions of `t`. `selfCheck()` verifies that the section stays in the frame through the whole camera move. |
| `page/terrain.ts` | The terrain mosaic, the flat shaded sea floor of the bird's-eye beats, and the 3-D floor mesh: the terrain itself beside the section's line, low-passed away from it (an island at × 300 is a needle otherwise), fading into the ground with distance. |
| `page/brand/` | The brand's fonts and tokens as files (see its README). |
| `vite.config.ts`, `tsconfig.json` | The page's own Vite root (dev 5180, preview 5181, `dist/` here, git-ignored) and type check. |
| `capture.mjs` | Headless Chrome (puppeteer-core): waits for `window.__story.ready`, stops if the page's check fails, steps `setT(k / 30)`, screenshots each frame, encodes with ffmpeg. `--shots 3.2,12.5` writes single frames instead; `--query cam3=8.84,66,-32,1270,452` tries another 3-D camera. |
| `capture/webgl_probe.mjs` | Proves that headless Chrome draws WebGL2 on this machine (it does: ANGLE on Metal, default flags). |
| `capture/strings.mjs` | Lists every string the page's DOM puts on screen, beat by beat, with the second it first appears: the audit to check against the findings. |
| `render.sh` | All of it in one command. |
| `analysis/` | The findings (Job 1): owned by that work, not by the page. |

## Re-render

Needs: the analysis database (`analysis/`, see `analysis/findings.template.md`), `npm ci`, Google Chrome, `ffmpeg`
(`brew install ffmpeg`).

```sh
# from the repo root, on branch story-elnino-2026
story/elnino-2026/render.sh                              # the deliverables, about 2.5 minutes
story/elnino-2026/render.sh try_v3 --from 24 --to 30     # a rough cut of part of it → $JOB/out/rough/try_v3.mp4
```

`render.sh` with no argument rebuilds `page/data/*.json`, type-checks and builds the page, serves the build on port
5182, captures 900 frames and writes, under `JOB` (default `~/_big/calcofi/story_elnino_2026-11`):

- `out/calcofi_elnino_2026_30s.mp4`: 1920 × 1080, 30 fps, H.264 `yuv420p`, `+faststart`, no audio, 30.0 s;
- `out/calcofi_elnino_2026_poster.png`: the last captured frame, lossless;
- `out/frames/`: a frame per beat pulled from the MP4 (two for beats 6 and 7), five of them also at 390 px wide.

The same, step by step:

```sh
JOB=~/_big/calcofi/story_elnino_2026-11
story/elnino-2026/build_data.sh $JOB                                   # 1. page/data/*.json from $JOB/work/elnino.duckdb
npx tsc -p story/elnino-2026/tsconfig.json                             # 2. type-check the page
npx vite build --config story/elnino-2026/vite.config.ts               # 3. the static page, story/elnino-2026/dist/
npx vite preview --config story/elnino-2026/vite.config.ts &           # 4. serve it on http://localhost:5181/
node story/elnino-2026/capture.mjs --url http://localhost:5181/ --out $JOB/work/frames/final \
  --mp4 $JOB/out/calcofi_elnino_2026_30s.mp4 --poster $JOB/out/calcofi_elnino_2026_poster.png
```

Look at single moments without rendering everything:

```sh
node story/elnino-2026/capture.mjs --url http://localhost:5181/ --out $JOB/work/shots --shots 0,10.6,23.5,26.2,29.9
```

Every string on screen, in order (run it after a change to the words, and check the list against the findings):

```sh
node story/elnino-2026/capture/strings.mjs http://localhost:5181/
```

It reads the DOM: the column, the pill, the legends, the strip, beat 7's callout, tag and record label. The labels drawn
inside the scene are not DOM text: the four place names, the isoline values (even isotherms as "16°", every degree of
difference as "+2"), the section's "+4" and "+8", and its depth marks "50 m", "100 m", "150 m".

Live, with hot reload: `npx vite --config story/elnino-2026/vite.config.ts`, then <http://localhost:5180/>. Space
pauses, ← → step a second, `?t=12.5` holds one moment.

The page fetches one thing from the network when it starts, and waits for it before the first frame: 24 terrain tiles
by range request from the GEBCO archive on `storage.googleapis.com/calcofi-db/bathymetry/`. Fonts, tokens and data are
in the bundle. After the page is ready a capture touches no network.
story/elnino-2026/render.sh (36 lines)
#!/bin/zsh
# one command from the analysis database to the video:
#   story/elnino-2026/render.sh                      the deliverables: $JOB/out/calcofi_elnino_2026_30s.mp4, the poster
#                                                    (its last frame, lossless) and $JOB/out/frames/ (a frame per beat,
#                                                    pulled from the MP4, some also at phone width)
#   story/elnino-2026/render.sh <name> [capture.mjs args, e.g. --from 24 --to 30]
#                                                    a rough cut: $JOB/out/rough/<name>.mp4
# Rebuilds page/data/*.json, type-checks and builds the page, serves the build on its own port for the length of the
# capture (capture.mjs stops if the page's own check fails), encodes, probes.
set -euo pipefail
HERE=${0:A:h}; REPO=${HERE:h:h}
JOB=${JOB:-$HOME/_big/calcofi/story_elnino_2026-11}; PORT=${PORT:-5182}
cd $REPO
if (( $# )); then NAME=$1; shift; MP4=$JOB/out/rough/$NAME.mp4; EXTRA=("$@")
else NAME=final; MP4=$JOB/out/calcofi_elnino_2026_30s.mp4; EXTRA=(--poster $JOB/out/calcofi_elnino_2026_poster.png); fi

$HERE/build_data.sh $JOB > /dev/null
npx tsc -p story/elnino-2026/tsconfig.json
npx vite build --config story/elnino-2026/vite.config.ts | tail -1
npx vite preview --config story/elnino-2026/vite.config.ts --port $PORT --strictPort > $JOB/logs/preview_$NAME.log 2>&1 &
PREVIEW=$!; trap "kill $PREVIEW 2>/dev/null" EXIT
until curl -s -o /dev/null http://localhost:$PORT/; do sleep 0.3; done
rm -rf $JOB/work/frames/$NAME
node story/elnino-2026/capture.mjs --url http://localhost:$PORT/ --out $JOB/work/frames/$NAME --mp4 $MP4 "${EXTRA[@]}"
ffprobe -v error -show_entries stream=codec_name,profile,pix_fmt,width,height,r_frame_rate,nb_frames:format=duration,size -of default=nw=1 $MP4

if [[ $NAME == final ]]; then   # a frame per beat (two for beats 6 and 7), from the MP4 itself; four of them at phone width
  F=$JOB/out/frames; rm -rf $F; mkdir -p $F
  for spec in b1_cruises:0.5 b2_normal:7.9 b3_map:10.6 b4_next_year:14.7 b5_difference:16.6 b6a_2021:19.4 b6b_2026:23.5 b7a_tilt:26.2 b7b_section:29.9; do
    ffmpeg -y -loglevel error -ss ${spec##*:} -i $MP4 -frames:v 1 $F/${spec%%:*}_t${spec##*:}.png
  done
  for n in b1_cruises_t0.5 b3_map_t10.6 b5_difference_t16.6 b6b_2026_t23.5 b7b_section_t29.9; do
    ffmpeg -y -loglevel error -i $F/$n.png -vf scale=390:-2 $F/phone390_$n.png
  done
  ls $F
fi
story/elnino-2026/build_data.sh (11 lines)
#!/bin/zsh
# derive the story page's JSON from the analysis database. usage: build_data.sh [job_dir]
# needs: the analysis database built by analysis/01-04 *.sql (see analysis/findings.template.md, "How this was computed")
set -euo pipefail
HERE=${0:A:h}
JOB=${1:-$HOME/_big/calcofi/story_elnino_2026-11}
OUT=$HERE/page/data
mkdir -p $OUT
sed "s|__OUT__|$OUT|g" $HERE/build_data.sql | duckdb -no-agent -readonly $JOB/work/elnino.duckdb
print "{\"release\": \"$(cat $JOB/work/release/VERSION)\"}" > $OUT/release.json
ls -la $OUT
story/elnino-2026/build_data.sql (114 lines)
.bail on
-- the story page's data, derived from the analysis database (analysis/01-04 *.sql over release objects mirrored
-- through the catalog by analysis/fetch_release.py). Run by build_data.sh, which substitutes __OUT__.
-- Everything is the CTD series (calcofi_ctd-cast, temperature_ave, quality-ok), the 0-10 m bin for the maps, and the
-- release's own climatology (month 11) for the normal: no number here is computed any other way than the app computes it.

-- the November cruises: cruise.month_median = 11 (obs_env.cruise_month), CTD
CREATE OR REPLACE TEMP TABLE nov AS
SELECT c.cruise_key, any_value(r.year) AS year, any_value(r.date_min) AS date_min, any_value(r.date_max) AS date_max,
       any_value(r.ship_name) AS ship, any_value(s.data_stage) AS data_stage
FROM cell c JOIN cruise_ref r USING (cruise_key)
LEFT JOIN cruise_stage s ON s.cruise_key = c.cruise_key AND s.dataset_key = 'calcofi_ctd-cast'
WHERE c.dataset_key = 'calcofi_ctd-cast' AND c.cruise_month = 11 AND c.depth_bin = 0
GROUP BY c.cruise_key;

-- one row per cruise x station at the surface (the 0-10 m bin), in the order the ship worked them
COPY (
  SELECT c.cruise_key, c.site_key, c.line, c.station, round(c.longitude, 4) AS lon, round(c.latitude, 4) AS lat,
         epoch(c.datetime)::BIGINT AS t, round(c.v, 3) AS temp, round(c.clim_mean, 3) AS clim, c.n_cruises,
         round(c.anom, 3) AS anom
  FROM cell c SEMI JOIN nov USING (cruise_key)
  WHERE c.dataset_key = 'calcofi_ctd-cast' AND c.depth_bin = 0
  ORDER BY c.cruise_key, c.datetime
) TO '__OUT__/stations.json' (FORMAT json, ARRAY true);

-- the cruises, with their role in the story and two station means of the surface anomaly:
-- over every station the cruise occupied that has a normal, and over the stations the November 2026 cruise occupied
COPY (
  WITH a AS (
    SELECT c.cruise_key, count(*) AS n_stations, count(c.anom) AS n_anom, avg(c.anom) AS mean_anom,
           count(c.anom) FILTER (WHERE f.site_key IS NOT NULL) AS n_anom_fp, avg(c.anom) FILTER (WHERE f.site_key IS NOT NULL) AS mean_anom_fp,
           min(c.v) AS temp_min, max(c.v) AS temp_max, min(c.anom) AS anom_min, max(c.anom) AS anom_max
    FROM cell c LEFT JOIN footprint f USING (site_key)
    WHERE c.dataset_key = 'calcofi_ctd-cast' AND c.depth_bin = 0 GROUP BY c.cruise_key)
  SELECT n.cruise_key, n.year, n.date_min, n.date_max, n.ship, n.data_stage,
         CASE WHEN n.year BETWEEN 1993 AND 2013 THEN 'baseline' WHEN n.year = 2014 THEN 'first' ELSE 'series' END AS role,
         a.n_stations, a.n_anom, round(a.mean_anom, 3) AS mean_anom, a.n_anom_fp, round(a.mean_anom_fp, 3) AS mean_anom_fp,
         round(a.temp_min, 2) AS temp_min, round(a.temp_max, 2) AS temp_max, round(a.anom_min, 2) AS anom_min, round(a.anom_max, 2) AS anom_max
  FROM nov n JOIN a USING (cruise_key) ORDER BY n.cruise_key
) TO '__OUT__/cruises.json' (FORMAT json, ARRAY true);

-- the November normal at the surface: the climatology rows (month 11, 0-10 m) with a monthly mean, at each station's
-- mean position over the November casts made there
COPY (
  WITH pos AS (
    SELECT site_key, avg(longitude) AS lon, avg(latitude) AS lat, any_value(line) AS line, any_value(station) AS station
    FROM cell WHERE dataset_key = 'calcofi_ctd-cast' AND cruise_month = 11 AND depth_bin = 0 GROUP BY site_key)
  SELECT k.site_key, p.line, p.station, round(p.lon, 4) AS lon, round(p.lat, 4) AS lat, round(k.clim_mean, 3) AS clim,
         round(k.clim_sd, 3) AS sd, k.n_cruises, k.clim_n AS n_obs
  FROM clim k JOIN pos p USING (site_key)
  WHERE k.dataset_key = 'calcofi_ctd-cast' AND k.measurement_type = 'temperature_ave' AND k.month = 11 AND k.depth_bin = 0
    AND k.clim_mean IS NOT NULL
  ORDER BY p.line, p.station
) TO '__OUT__/normal.json' (FORMAT json, ARRAY true);

-- every CTD cruise, for the time strip ("which cruise, out of all cruises")
COPY (
  SELECT r.cruise_key, r.year, r.month_median AS month, r.date_median, r.month_median = 11 AS november
  FROM cruise_ref r SEMI JOIN (SELECT DISTINCT cruise_key FROM cell WHERE dataset_key = 'calcofi_ctd-cast') c USING (cruise_key)
  ORDER BY r.date_median
) TO '__OUT__/strip.json' (FORMAT json, ARRAY true);

-- the section: line 93.3 on the November 2026 cruise, every measured 10 m bin, with its normal and its departure
COPY (
  SELECT c.site_key, c.station, round(c.longitude, 4) AS lon, round(c.latitude, 4) AS lat, c.depth_bin,
         round(c.v, 3) AS temp, round(c.clim_mean, 3) AS clim, c.n_cruises, round(c.anom, 3) AS anom
  FROM cell c
  WHERE c.cruise_key = '2026-11-33P4' AND c.dataset_key = 'calcofi_ctd-cast' AND c.line = 93.3
  ORDER BY c.station, c.depth_bin
) TO '__OUT__/section.json' (FORMAT json, ARRAY true);

-- the numbers the captions quote, so the page states nothing it did not read here (page/data/facts.json)
--   max_anom, max_anom_station, max_anom_bin   the hero of beat 7: the largest departure of the cruise, its station and 10 m bin
--   record_from, record_to                     the years the record spans (every CTD and bottle cruise in the release)
--   layer_temp, layer_depth, layer_site        "25 C water down to 55 m": at the core stations (28 and 30) the mean of the
--                                              1 m bins of the upper 50 m, rounded; and the deepest 1 m bin, counted down
--                                              from the surface without a break, still within 0.5 C of it
--   coast_*, offshore_*                        the 2026 map's caption: the 0-10 m departures of the inner Southern California
--                                              Bight ((line >= 88 and station <= 37) or (line < 88 and station <= 51)) and
--                                              of the other stations. The caption says "N to M C near the coast", so the
--                                              two groups must not overlap: the build stops if they do.
CREATE OR REPLACE TEMP TABLE surf26 AS
SELECT site_key, line, station, anom, ((line >= 88 AND station <= 37) OR (line < 88 AND station <= 51)) AS coast
FROM cell WHERE cruise_key = '2026-11-33P4' AND dataset_key = 'calcofi_ctd-cast' AND depth_bin = 0 AND anom IS NOT NULL;
SELECT CASE WHEN max(anom) FILTER (WHERE NOT coast) >= min(anom) FILTER (WHERE coast)
            THEN error('the coast and offshore station groups overlap: "N to M C warmer near the coast" would not hold')
            ELSE 'station groups do not overlap' END AS check_groups
FROM surf26;

COPY (
  WITH core AS (
    SELECT site_key, round(avg(value) FILTER (WHERE depth_m <= 50)) AS t0
    FROM cast_1m WHERE measurement_type = 'temperature_ave' AND direction = 'd' AND measurement_qual IS NULL
      AND site_key IN ('093.3 028.0', '093.3 030.0') GROUP BY site_key),
  layer AS (
    SELECT c.site_key, c.t0, min(p.depth_m) FILTER (WHERE p.value < c.t0 - 0.5) - 1 AS depth
    FROM core c JOIN cast_1m p USING (site_key)
    WHERE p.measurement_type = 'temperature_ave' AND p.direction = 'd' AND p.measurement_qual IS NULL GROUP BY c.site_key, c.t0)
  SELECT (SELECT round(max(anom), 1) FROM cell WHERE cruise_key = '2026-11-33P4')                      AS max_anom,
         (SELECT arg_max(site_key, anom) FROM cell WHERE cruise_key = '2026-11-33P4')                  AS max_anom_site,
         (SELECT arg_max(station, anom) FROM cell WHERE cruise_key = '2026-11-33P4')                   AS max_anom_station,
         (SELECT arg_max(depth_bin, anom) FROM cell WHERE cruise_key = '2026-11-33P4')                 AS max_anom_bin,
         (SELECT min(cruise_year) FROM cell)                                                           AS record_from,
         (SELECT max(cruise_year) FROM cell)                                                           AS record_to,
         (SELECT arg_max(t0, depth)::INTEGER FROM layer)                                               AS layer_temp,
         (SELECT max(depth)::INTEGER FROM layer)                                                       AS layer_depth,
         (SELECT arg_max(site_key, depth) FROM layer)                                                  AS layer_site,
         (SELECT count(*) FROM surf26 WHERE coast)                                                     AS coast_n,
         (SELECT round(min(anom), 1) FROM surf26 WHERE coast)                                          AS coast_min,
         (SELECT round(max(anom), 1) FROM surf26 WHERE coast)                                          AS coast_max,
         (SELECT count(*) FROM surf26 WHERE NOT coast)                                                 AS offshore_n,
         (SELECT round(min(anom), 1) FROM surf26 WHERE NOT coast)                                      AS offshore_min,
         (SELECT round(max(anom), 1) FROM surf26 WHERE NOT coast)                                      AS offshore_max
) TO '__OUT__/facts.json' (FORMAT json, ARRAY true);
story/elnino-2026/capture.mjs (61 lines)
// capture the story page frame by frame with headless Chrome, then encode it.
//   node story/elnino-2026/capture.mjs --url http://localhost:5181/ --out <dir> [--shots 0.5,6,12] [--from 0 --to 30] [--mp4 <file>] [--poster <png>]
// --shots  writes one PNG per listed time (seconds) into <dir> and stops: the way to look at a beat
// otherwise every frame t = k / fps for k in [from·fps, to·fps) is written to <dir>/f_%05d.png, and with --mp4 the
// frames are encoded to H.264 (yuv420p, +faststart, no audio) at the page's own fps.
// The page is driven through window.__story (page/main.ts): `ready` resolves when the fonts, the terrain tiles and the
// interpolated surfaces are in, and setT(t) resolves once that frame is on screen, so no frame is half-loaded.
import puppeteer from "puppeteer-core";
import fs from "node:fs";
import path from "node:path";
import { spawnSync } from "node:child_process";

const arg = (k, d) => { const i = process.argv.indexOf(`--${k}`); return i > 0 ? process.argv[i + 1] : d; };
const url = arg("url", "http://localhost:5181/"), out = arg("out"), shots = arg("shots"), mp4 = arg("mp4"), poster = arg("poster");
const query = arg("query", "");   // extra page parameters, e.g. --query cam3=8.7,66,-50,1250,470 to try a camera (main.ts CAM3D_SPEC)
if (!out) { console.error("--out <dir> is required"); process.exit(2); }
fs.mkdirSync(out, { recursive: true });

const browser = await puppeteer.launch({
  executablePath: process.env.CHROME ?? "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
  headless: true,   // ANGLE on Metal gives headless Chrome a real WebGL2 context on this machine (capture/webgl_probe.mjs)
  args: ["--window-size=1920,1080", "--hide-scrollbars", "--force-color-profile=srgb", "--disable-background-timer-throttling", "--disable-renderer-backgrounding"],
  defaultViewport: { width: 1920, height: 1080, deviceScaleFactor: 1 },
});
const page = await browser.newPage();
page.on("pageerror", (e) => console.log("PAGEERROR", e.message));
page.on("console", (m) => { if (m.type() === "error" || m.type() === "warning") console.log(`console.${m.type()}:`, m.text().slice(0, 300)); });
page.on("requestfailed", (r) => console.log("REQUEST FAILED", r.url().slice(0, 140), r.failure()?.errorText));
const t0 = Date.now();
await page.goto(`${url}?t=0${query ? `&${query}` : ""}`, { waitUntil: "domcontentloaded" });
await page.waitForFunction(() => typeof window.__story === "object", { timeout: 60000 });   // (a promise would be awaited: test the object)
await page.evaluate(() => window.__story.ready.then(() => true));
const info = await page.evaluate(() => ({ duration: window.__story.duration, fps: window.__story.fps, terrain: window.__story.terrain, check: window.__story.check }));
console.log(`ready in ${((Date.now() - t0) / 1000).toFixed(1)} s`, JSON.stringify(info));
// the page checks itself (main.ts selfCheck()): the section must stay in the frame through the whole camera move
if (!info.check?.sectionInFrame && !query) { console.error("STOP: the section leaves the frame during beat 7", JSON.stringify(info.check)); await browser.close(); process.exit(1); }
if (info.terrain?.missing) console.log(`WARNING: ${info.terrain.missing} of ${info.terrain.tiles} terrain tiles missing`);

const frame = async (t, file) => {
  await page.evaluate((x) => window.__story.setT(x), t);
  await page.screenshot({ path: file, type: "png", optimizeForSpeed: true });
};
if (shots) {
  for (const t of shots.split(",").map(Number)) { const f = path.join(out, `t_${t.toFixed(2).padStart(5, "0")}.png`); await frame(t, f); console.log("wrote", f); }
} else {
  const from = Number(arg("from", 0)), to = Number(arg("to", info.duration)), k0 = Math.round(from * info.fps), k1 = Math.round(to * info.fps);
  for (let k = k0; k < k1; k++) {
    await frame(k / info.fps, path.join(out, `f_${String(k).padStart(5, "0")}.png`));
    if (k % 60 === 0) console.log(`frame ${k} / ${k1}  (${((Date.now() - t0) / 1000).toFixed(0)} s)`);
  }
  console.log(`captured ${k1 - k0} frames in ${((Date.now() - t0) / 1000).toFixed(0)} s`);
  if (poster) { fs.mkdirSync(path.dirname(poster), { recursive: true }); fs.copyFileSync(path.join(out, `f_${String(k1 - 1).padStart(5, "0")}.png`), poster); console.log("wrote", poster); }   // the last frame, as captured (lossless)
  if (mp4) {
    fs.mkdirSync(path.dirname(mp4), { recursive: true });
    const r = spawnSync("ffmpeg", ["-y", "-loglevel", "error", "-framerate", String(info.fps), "-start_number", String(k0), "-i", path.join(out, "f_%05d.png"),
      "-frames:v", String(k1 - k0), "-c:v", "libx264", "-preset", "slow", "-crf", "18", "-pix_fmt", "yuv420p", "-movflags", "+faststart", "-an", mp4], { stdio: "inherit" });
    if (r.status !== 0) { console.error("ffmpeg failed"); process.exit(1); }
    console.log("wrote", mp4);
  }
}
await browser.close();
story/elnino-2026/page/index.html (54 lines)
<!doctype html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CalCOFI · November 2026 · the warm water off Southern California</title>
<!-- the calcofi.io brand, v2: its own fonts.css, theme.css and font files, copied verbatim into page/brand/ (see
     brand/README.md) so the page needs nothing from calcofi.io when it starts. Dark, and not theme.js: the story is one
     fixed look for a video, it has no theme toggle and must not read a visitor's cookie. -->
<link rel="stylesheet" href="./brand/fonts.css">
<link rel="stylesheet" href="./brand/theme.css">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="stage">
  <div id="map"></div>
  <div id="scrim"></div>
  <div id="scrim-strip"></div>

  <div id="col">
    <div id="kicker"></div>
    <div id="year"></div>
    <div id="pill">preliminary data</div>
    <div id="caption"></div>
    <div id="caption2"></div>
  </div>

  <div id="legends">
    <div class="legend" id="legend-temp">
      <div class="legend-title">Temperature at the surface</div>
      <div class="legend-bar"></div>
      <div class="legend-ticks"></div>
    </div>
    <div class="legend" id="legend-anom">
      <div class="legend-title">Difference from normal</div>
      <div class="legend-bar"></div>
      <div class="legend-ticks"></div>
    </div>
  </div>

  <div id="callout">
    <div id="callout-big"></div>
    <div id="callout-text"></div>
  </div>
  <svg id="leader" width="1920" height="1080" viewBox="0 0 1920 1080"></svg>
  <div id="tag"></div>

  <svg id="strip" width="1920" height="244" viewBox="0 0 1920 244"></svg>
  <div id="credit"></div>
  <div id="loading">loading …</div>
</div>
<script type="module" src="./main.ts"></script>
</body>
</html>
story/elnino-2026/page/main.ts (585 lines)
// The 2026 warm water off Southern California in 30 seconds, from CalCOFI's November cruises.
//
// ONE CLOCK: every pixel is a pure function of t (seconds, 0 … 30). The page plays live (requestAnimationFrame sets t)
// and can be stepped (`?t=12.5`, or window.__story.setT(t) from capture.mjs), so a capture is deterministic.
//
// What it draws is the Explorer's own: the ramps (src/ramps.ts: cmocean thermal and balance), the interpolator and its
// isolines (src/contour.ts + contour.worker.ts: the thin-plate spline of the Contours lens, blank beyond 60 km of a
// station, land clipped), the sea floor (the GEBCO terrain tiles of src/basemap.ts) and the 3-D section recipe of
// src/curtain.tsx. The numbers are the release's (page/data/*.json, written by ../build_data.sh from the analysis
// database): the 0–10 m bin of each CTD cast, and the `climatology` table's November rows as the normal. Every number a
// caption shows is read from page/data/facts.json or cruises.json: none is typed here.
import { Deck, MapView, COORDINATE_SYSTEM, WebMercatorViewport, SimpleMeshLayer, ScatterplotLayer, PathLayer, TextLayer, BitmapLayer, GeoJsonLayer } from "deck.gl";
import { rampColors, rampCss } from "../../../src/ramps";
import { computeSurface, landMask, isolines, joinSegments, labelPoints, thinLabels, surfaceImage, cellToLonLat, type SurfaceGrid } from "../../../src/contour";
import { loadMosaic, mosaicBounds, flatBathy, floorMesh, type FloorMesh } from "./terrain";
import cruisesJson from "./data/cruises.json";
import stationsJson from "./data/stations.json";
import normalJson from "./data/normal.json";
import stripJson from "./data/strip.json";
import sectionJson from "./data/section.json";
import factsJson from "./data/facts.json";
import releaseJson from "./data/release.json";

// ── the data ─────────────────────────────────────────────────────────────────────────────────────────────────────
interface Cruise { cruise_key: string; year: number; date_min: string; date_max: string; ship: string; data_stage: string; role: string;
  n_stations: number; n_anom: number; mean_anom: number; n_anom_fp: number; mean_anom_fp: number }
interface Sta { cruise_key: string; site_key: string; line: number; station: number; lon: number; lat: number; t: number; temp: number; clim: number | null; anom: number | null }
interface Normal { site_key: string; line: number; station: number; lon: number; lat: number; clim: number; n_cruises: number }
interface StripCruise { cruise_key: string; year: number; month: number; date_median: string; november: boolean }
interface Sec { site_key: string; station: number; lon: number; lat: number; depth_bin: number; temp: number; clim: number | null; anom: number | null }
interface Facts { max_anom: number; max_anom_station: number; max_anom_bin: number; record_from: number; record_to: number; layer_temp: number; layer_depth: number;
  coast_n: number; coast_min: number; coast_max: number; offshore_n: number; offshore_min: number; offshore_max: number }

const cruises = cruisesJson as Cruise[], normal = normalJson as Normal[], strip = stripJson as StripCruise[], section = sectionJson as Sec[];
const facts = (factsJson as Facts[])[0];
const RELEASE = (releaseJson as { release: string }).release;
const byCruise = new Map<string, Sta[]>();
for (const s of stationsJson as Sta[]) (byCruise.get(s.cruise_key) ?? byCruise.set(s.cruise_key, []).get(s.cruise_key)!).push(s);
const stationsOf = (c: Cruise) => byCruise.get(c.cruise_key)!;
const baseline = cruises.filter((c) => c.role === "baseline"), first = cruises.find((c) => c.role === "first")!, series = cruises.filter((c) => c.role === "series");
const last = series[series.length - 1];
const normalBySite = new Map(normal.map((n) => [n.site_key, n]));

// ── the frame, the clock, the beats ──────────────────────────────────────────────────────────────────────────────
const W = 1920, H = 1080, DURATION = 30, FPS = 30;
const B1 = 0, B2 = 5.2, B3 = 8.2, B4 = 11.0, B5 = 15.0, B6 = 17.0, B7 = 24.0;
const B1_FIRST = 1.2, B1_STEP = (B2 - B1_FIRST) / (baseline.length - 1);   // the first cruise holds 1.2 s, the others 0.5 s
const B6_STEP = 0.55;                                                      // the last cruise then holds to B7
const beat6Start = (i: number) => B6 + i * B6_STEP;
/** beat 1: which baseline cruise is showing, and how far through its slot */
function beat1(t: number): { k: number; p: number } {
  if (t < B1_FIRST) return { k: 0, p: t / B1_FIRST };
  const k = Math.min(baseline.length - 1, 1 + Math.floor((t - B1_FIRST) / B1_STEP));
  return { k, p: (t - B1_FIRST - (k - 1) * B1_STEP) / B1_STEP };
}
const beat6 = (t: number) => Math.min(series.length - 1, Math.max(0, Math.floor((t - B6) / B6_STEP)));

/** the two scales of the whole film: never rescaled, so a redder frame is a warmer ocean */
const TEMP: [number, number] = [11, 26], ANOM: [number, number] = [-13, 13];
const MASK_KM = 60, EDGE = 5;
const SECTION_LINE = 93.3, SECTION_DEPTH = 200, EXAG = 300;   // the section's vertical exaggeration, the sea floor's too

const clamp01 = (x: number) => Math.min(1, Math.max(0, x));
const ramp = (t: number, a: number, b: number) => clamp01((t - a) / (b - a));
const ease = (x: number) => x * x * (3 - 2 * x);
const lerp = (a: number, b: number, f: number) => a + (b - a) * f;
type RGB = [number, number, number];
type RGBA = [number, number, number, number];
/** the interpolation of src/map.tsx colorScale(), over a ramp of src/ramps.ts */
function scale(domain: [number, number], rampId: string): (v: number) => RGB {
  const [lo, hi] = domain, R = rampColors(rampId);
  return (v) => {
    const x = clamp01((v - lo) / (hi - lo)) * (R.length - 1), i = Math.min(R.length - 2, Math.floor(x)), f = x - i;
    return [lerp(R[i][0], R[i + 1][0], f), lerp(R[i][1], R[i + 1][1], f), lerp(R[i][2], R[i + 1][2], f)];
  };
}
const tempColor = scale(TEMP, "thermal"), anomColor = scale(ANOM, "balance");
const INK: RGB = [233, 237, 243], MUTED: RGB = [159, 176, 200], NAVY: RGB = [8, 18, 32];
const rgba = (c: RGB, a: number): RGBA => [c[0], c[1], c[2], Math.round(255 * clamp01(a))];
const css = (c: RGB) => `rgb(${c.map(Math.round).join(",")})`;
const signed = (v: number, d = 1) => `${v > 0 ? "+" : v < 0 ? "−" : ""}${Math.abs(v).toFixed(d)}`;

// ── the section's stations, and metres from its middle ───────────────────────────────────────────────────────────
const secStations = [...new Map(section.map((s) => [s.station, s])).values()].sort((a, b) => a.station - b.station);
/** the section as its face is seen in beat 7 (from the south-east): offshore on the left, the coast on the right */
const faceStations = secStations.slice().reverse();
const lon0 = secStations.reduce((a, s) => a + s.lon, 0) / secStations.length, lat0 = secStations.reduce((a, s) => a + s.lat, 0) / secStations.length;
const kx = 111320 * Math.cos((lat0 * Math.PI) / 180), ky = 110540;
const off = (lon: number, lat: number): [number, number] => [(lon - lon0) * kx, (lat - lat0) * ky];
const stationAt = (n: number) => secStations.find((s) => s.station === n) ?? secStations[1];

// ── the cameras ──────────────────────────────────────────────────────────────────────────────────────────────────
interface Cam { longitude: number; latitude: number; zoom: number; pitch: number; bearing: number }
const q = new URLSearchParams(location.search);
// bird's-eye: the standard pattern in the frame's right two thirds, clear of the column and the strip
const fit = new WebMercatorViewport({ width: W, height: H }).fitBounds([[-124.75, 29.45], [-116.85, 35.45]], { padding: { left: 720, right: 20, top: 16, bottom: 250 } });
const CAM2D: Cam = { longitude: fit.longitude, latitude: fit.latitude, zoom: fit.zoom, pitch: 0, bearing: 0 };
// oblique: the section's face from its south side, the coast on the right as on the map, close and low enough that the
// warm core at the inshore end is the largest thing in the frame while all seven stations stay in it. (Turned further
// toward the west the inshore end would be nearer still, but San Diego's own coast then stands in front of it.)
// Stated as zoom, pitch, bearing and WHERE ON SCREEN the section's middle sits; the centre follows
// (`?cam3=zoom,pitch,bearing,x,y` to try another).
const camQ = q.get("cam3")?.split(",").map(Number);
const CAM3D_SPEC = camQ?.length === 5 ? { zoom: camQ[0], pitch: camQ[1], bearing: camQ[2], at: [camQ[3], camQ[4]] } : { zoom: 8.84, pitch: 66, bearing: -32, at: [1270, 452] };
const viewport = (c: Cam) => new WebMercatorViewport({ width: W, height: H, ...c });
const PIVOT: [number, number] = [lon0, lat0];
/** the camera with this zoom, pitch and bearing that puts the section's middle at a pixel */
function camWithPivotAt(zoom: number, pitch: number, bearing: number, px: number[]): Cam {
  const c = viewport({ longitude: PIVOT[0], latitude: PIVOT[1], zoom, pitch, bearing }).panByPosition(PIVOT, px);
  return { longitude: c.longitude as number, latitude: c.latitude as number, zoom, pitch, bearing };
}
const CAM3D: Cam = camWithPivotAt(CAM3D_SPEC.zoom, CAM3D_SPEC.pitch, CAM3D_SPEC.bearing, CAM3D_SPEC.at);
// the move between them carries the section's middle along a straight line on screen while zoom, pitch and bearing ease,
// so the section never leaves the frame (interpolating the centre itself let the zoom outrun it: the line ran off the
// right edge half-way)
const P2D = viewport(CAM2D).project(PIVOT), P3D = CAM3D_SPEC.at;
function camAt(t: number): Cam {
  const e = ease(ramp(t, B7 + 0.2, B7 + 2.7));
  if (e <= 0) return CAM2D;
  if (e >= 1) return CAM3D;
  return camWithPivotAt(lerp(CAM2D.zoom, CAM3D.zoom, e), lerp(CAM2D.pitch, CAM3D.pitch, e), lerp(CAM2D.bearing, CAM3D.bearing, e), [lerp(P2D[0], P3D[0], e), lerp(P2D[1], P3D[1], e)]);
}
const PX_PER_DEG = (512 * 2 ** CAM2D.zoom) / 360;   // bird's-eye pixels per degree of longitude
/** a lon/lat moved by screen pixels under the bird's-eye camera (the ring of beat 2) */
const nudge = (lon: number, lat: number, dx: number, dy: number): [number, number] => [lon + dx / PX_PER_DEG, lat - (dy * Math.cos((lat * Math.PI) / 180)) / PX_PER_DEG];

// ── the surfaces: the Contours lens's spline, once per map ───────────────────────────────────────────────────────
type Bounds = [number, number, number, number];
interface Surf { canvas: HTMLCanvasElement; bounds: Bounds; coarse?: { canvas: HTMLCanvasElement; bounds: Bounds };
  lines: { path: [number, number][]; level: number }[]; labels: { position: [number, number]; text: string; angle: number }[]; n: number;
  grid: SurfaceGrid; behind?: HTMLCanvasElement; front?: HTMLCanvasElement }
const surfs = new Map<string, Surf>();
async function buildSurf(key: string, pts: { lon: number; lat: number; z: number }[], kind: "temp" | "anom", withCoarse: boolean) {
  const color = kind === "temp" ? tempColor : anomColor;
  const paint = (x: number): RGBA => [...color(x), 255];
  const one = async (cellDeg: number) => {
    const s = await computeSurface(pts, "tps", { cellDeg, maskKm: MASK_KM });
    const land = await landMask(s.grid);
    for (let o = 0; o < s.values.length; o++) if (land[o]) s.values[o] = NaN;
    // the app blanks a surface beyond 60 km of a station and fades its last 15 km (contour.ts EDGE_KM). The offshore
    // stations are 74 km apart, so the middle of four is 52 km from each: inside the surface, but inside that fade
    // too. The 60 km rule stays; the fade is the last EDGE km (surfaceImage() reads (maskKm − dist) / 15).
    for (let o = 0; o < s.dist.length; o++) s.dist[o] = MASK_KM - ((MASK_KM - s.dist[o]) * 15) / EDGE;
    return s;
  };
  const s = await one(0.04), g = s.grid;
  const levels = kind === "temp" ? Array.from({ length: 15 }, (_, i) => 12 + i) : Array.from({ length: 25 }, (_, i) => i - 12).filter((v) => v !== 0);
  const lines: Surf["lines"] = [], labels: (Surf["labels"][number] & { x: number; y: number })[] = [];
  for (const iso of isolines(s.values, g.nx, g.ny, levels)) {
    const polys = joinSegments(iso.segs).filter((p) => p.length > 10);
    for (const p of polys) lines.push({ level: iso.level, path: p.map(([x, y]) => cellToLonLat(g, x, y)) });   // isolines run through cell CENTRES
    const text = kind === "temp" ? `${iso.level}°` : signed(iso.level, 0);
    if (kind === "anom" || iso.level % 2 === 0)
      for (const p of labelPoints(polys, 80)) { const position = cellToLonLat(g, p.x, p.y); labels.push({ position, text, angle: p.angle, x: position[0] * PX_PER_DEG, y: position[1] * PX_PER_DEG * 1.19 }); }
  }
  const surf: Surf = { canvas: surfaceImage(s.values, g.nx, g.ny, paint, 255, s.dist, MASK_KM), bounds: [g.lon0, g.latS, g.lon1, g.latN], lines, n: pts.length, grid: g,
    labels: thinLabels(labels, 190) };
  if (withCoarse) {   // the same spline on a coarse regular grid, drawn as its cells: "interpolated to the grid" made visible
    const c = await one(0.28);
    surf.coarse = { canvas: surfaceImage(c.values, c.grid.nx, c.grid.ny, paint, 255, c.dist, MASK_KM), bounds: [c.grid.lon0, c.grid.latS, c.grid.lon1, c.grid.latN] };
  }
  surfs.set(key, surf);
}

/** the block diagram of beat 7: the surface map split along the section's line into the part BEHIND the section (kept, as
 *  the sea surface the section hangs from) and the part in FRONT of it (which leaves, so the section's face is seen).
 *  Cut on a canvas four times the grid, along the stations' own polyline, so the edge is a line and not a staircase. */
function splitAlongLine(f: Surf) {
  const g = f.grid, K = 4, R = Math.PI / 180, merc = (lat: number) => Math.log(Math.tan(Math.PI / 4 + (lat * R) / 2));
  const px = (lon: number, lat: number): [number, number] => [((lon - g.lon0) / g.cellDeg) * K, ((merc(g.latN) - merc(lat)) / (g.cellDeg * R)) * K];
  const P = secStations.map((s) => px(s.lon, s.lat)), n = P.length, FAR = 6000;
  const ext = (a: [number, number], b: [number, number]): [number, number] => { const d = Math.hypot(a[0] - b[0], a[1] - b[1]); return [a[0] + ((a[0] - b[0]) / d) * FAR, a[1] + ((a[1] - b[1]) / d) * FAR]; };
  const line = [ext(P[0], P[1]), ...P, ext(P[n - 1], P[n - 2])];
  const mk = (north: boolean) => {
    const cv = document.createElement("canvas"); cv.width = g.nx * K; cv.height = g.ny * K;
    const ctx = cv.getContext("2d")!;
    ctx.beginPath(); line.forEach(([x, y], k) => (k ? ctx.lineTo(x, y) : ctx.moveTo(x, y)));
    const y = north ? -FAR : FAR + cv.height;   // the other lines are north of 93.3 (up the canvas): that side is "behind"
    ctx.lineTo(line[line.length - 1][0], y); ctx.lineTo(line[0][0], y); ctx.closePath(); ctx.clip();
    ctx.imageSmoothingEnabled = true; ctx.imageSmoothingQuality = "high"; ctx.drawImage(f.canvas, 0, 0, cv.width, cv.height);
    return cv;
  };
  f.behind = mk(true); f.front = mk(false);
}

// ── the section's texture: stations across, depth down, the departure from the November normal ───────────────────
/** the curtain image for line 93.3, as its face is seen: bilinear between stations and between the 10 m bins that were
 *  measured, never below a cast's deepest bin except toward a deeper neighbour (the sea floor mesh covers what lies
 *  under the shelf). Isolines every 4 °C; the 4 and the 8 carry their value, the 12 is marked by the record's own label. */
function sectionTexture(): HTMLCanvasElement {
  const N = faceStations.length, GX = 40, nx = (N - 1) * GX + 1, ny = SECTION_DEPTH / 2 + 1;   // 2 m rows
  const col = faceStations.map((st) => section.filter((c) => c.station === st.station && c.anom != null).sort((a, b) => a.depth_bin - b.depth_bin));
  const at = (i: number, depth: number): number | null => {   // station i at a depth: linear between bin centres
    const c = col[i]; if (!c.length) return null;
    const zc = (k: number) => c[k].depth_bin + 5;
    if (depth <= zc(0)) return c[0].anom!;
    if (depth > c[c.length - 1].depth_bin + 10) return null;
    for (let k = 1; k < c.length; k++) if (depth <= zc(k)) return lerp(c[k - 1].anom!, c[k].anom!, (depth - zc(k - 1)) / (zc(k) - zc(k - 1)));
    return c[c.length - 1].anom!;
  };
  const v = new Float32Array(nx * ny).fill(NaN);
  for (let j = 0; j < ny; j++) for (let x = 0; x < nx; x++) {
    const i = Math.min(N - 2, Math.floor(x / GX)), f = (x - i * GX) / GX, a = at(i, j * 2), b = at(i + 1, j * 2);
    v[j * nx + x] = a != null && b != null ? lerp(a, b, f) : a != null ? (f <= 0.5 ? a : NaN) : b != null ? (f >= 0.5 ? b : NaN) : NaN;
  }
  const small = document.createElement("canvas"); small.width = nx; small.height = ny;
  const sc = small.getContext("2d")!, img = sc.createImageData(nx, ny);
  for (let o = 0; o < nx * ny; o++) if (Number.isFinite(v[o])) { const c = anomColor(v[o]); img.data[o * 4] = c[0]; img.data[o * 4 + 1] = c[1]; img.data[o * 4 + 2] = c[2]; img.data[o * 4 + 3] = 255; }
  sc.putImageData(img, 0, 0);
  const K = 6, cv = document.createElement("canvas"); cv.width = nx * K; cv.height = ny * K;
  const ctx = cv.getContext("2d")!; ctx.imageSmoothingEnabled = true; ctx.imageSmoothingQuality = "high"; ctx.drawImage(small, 0, 0, cv.width, cv.height);
  ctx.lineWidth = 5; ctx.lineJoin = "round"; ctx.font = `700 60px "Source Sans 3", sans-serif`; ctx.textAlign = "center"; ctx.textBaseline = "middle";
  for (const iso of isolines(v, nx, ny, [4, 8, 12])) {
    const polys = joinSegments(iso.segs).filter((p) => p.length > 8);
    ctx.strokeStyle = "rgba(255,255,255,0.92)";
    for (const p of polys) { ctx.beginPath(); p.forEach(([x, y], k) => (k ? ctx.lineTo((x + 0.5) * K, (y + 0.5) * K) : ctx.moveTo((x + 0.5) * K, (y + 0.5) * K))); ctx.stroke(); }
    const longest = polys.sort((a, b) => b.length - a.length)[0];
    if (longest && iso.level < 12) {
      const [x, y] = longest[Math.floor(longest.length * 0.42)];
      const tx = (x + 0.5) * K, ty = (y + 0.5) * K, text = `+${iso.level}`, w = ctx.measureText(text).width + 26;
      ctx.fillStyle = css(anomColor(iso.level)); ctx.fillRect(tx - w / 2, ty - 36, w, 72);
      ctx.fillStyle = "#fff"; ctx.fillText(text, tx, ty + 3);
    }
  }
  return cv;
}

// ── the scene ────────────────────────────────────────────────────────────────────────────────────────────────────
const el = document.getElementById("map")!;
const deck = new Deck({
  parent: el as HTMLDivElement, width: W, height: H, useDevicePixels: 1,
  views: new MapView({ repeat: false, controller: false }),
  viewState: { ...CAM2D, maxPitch: 85 },
  deviceProps: { type: "webgl", webgl: { preserveDrawingBuffer: true } },
  layers: [],
} as any);

const FONT = `"Source Sans 3", system-ui, sans-serif`;
const TEXT = { fontFamily: FONT, fontWeight: 700, fontSettings: { sdf: true, fontSize: 72, buffer: 10, radius: 14 }, outlineWidth: 3, outlineColor: [8, 18, 32, 255] as RGBA, sizeUnits: "pixels" as const, characterSet: "auto" as const };
const SECTION_PLACE = "San Diego";
const PLACES = [
  { name: "Los Angeles", lon: -118.24, lat: 34.05 }, { name: "San Diego", lon: -117.16, lat: 32.72 },
  { name: "Santa Barbara", lon: -119.7, lat: 34.42 }, { name: "Ensenada", lon: -116.6, lat: 31.86 },
];
// everything that lies ON the sea surface is drawn in order, never depth-tested: two coplanar quads under a tilted camera
// fight, and a billboard label standing on the land's plane was cut in half by it
const FLAT = { parameters: { depthWriteEnabled: false, depthCompare: "always" } as any };
const M3D = { coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS, coordinateOrigin: [lon0, lat0, 0] as [number, number, number] };

let land: any = null, bathy: { canvas: HTMLCanvasElement; bounds: Bounds } | null = null;
let floor: FloorMesh | null = null, curtainTex: HTMLCanvasElement | null = null;

/** the ship's track through a cruise's stations, drawn to a fraction p of its length; returns the path and how many
 *  stations it has reached (fractional: the next one is on its way) */
function trackTo(st: Sta[], p: number): { path: [number, number][]; reached: number } {
  const f = clamp01(p) * (st.length - 1), k = Math.floor(f), g = f - k;
  const path = st.slice(0, k + 1).map((s) => [s.lon, s.lat] as [number, number]);
  if (k < st.length - 1 && g > 0) path.push([lerp(st[k].lon, st[k + 1].lon, g), lerp(st[k].lat, st[k + 1].lat, g)]);
  return { path, reached: f };
}

interface Dot { lon: number; lat: number; r: number; fill: RGBA; line: RGBA }
const noValue = (a: number) => ({ fill: rgba(NAVY, 0.0), line: rgba(MUTED, 0.9 * a) });   // sampled, no normal there: a ring, never a colour
interface Shown { key: string; opacity: number; coarse?: number; lines?: number; split?: number }

function layersAt(t: number) {
  const L: any[] = [];
  const in7 = t >= B7, u7 = t - B7;
  const flat = 1 - ease(ramp(u7, 0.3, 1.6));           // the bird's-eye layers leave as the camera tilts
  const dots: Dot[] = [], shown: Shown[] = [];
  let track: { path: [number, number][]; opacity: number } | null = null, ship: [number, number] | null = null;

  // ── the 3-D stage, under everything flat ──
  if (in7 && floor) {
    L.push(new SimpleMeshLayer({ id: "floor3d", ...M3D, data: [0], getPosition: () => [0, 0, 0],
      mesh: { attributes: { positions: { value: floor.positions, size: 3 }, texCoords: { value: floor.texCoords, size: 2 }, normals: { value: floor.normals, size: 3 } }, indices: { value: floor.indices, size: 1 } } as any,
      texture: floor.texture, getColor: [255, 255, 255, 255], material: { ambient: 0.55, diffuse: 0.5, shininess: 4, specularColor: [10, 14, 20] } }));
    const d = ease(ramp(u7, 1.4, 2.9)), N = faceStations.length;
    if (d > 0 && curtainTex) {
      const pos = new Float32Array(N * 2 * 3), tex = new Float32Array(N * 2 * 2), idx = new Uint32Array((N - 1) * 6);
      faceStations.forEach((s, i) => {
        const [x, y] = off(s.lon, s.lat), uu = i / (N - 1);
        pos.set([x, y, 0], i * 3); tex.set([uu, 0], i * 2);
        pos.set([x, y, -SECTION_DEPTH * EXAG * d], (N + i) * 3); tex.set([uu, d], (N + i) * 2);
      });
      let k = 0; for (let i = 0; i < N - 1; i++) { const a = i, b = i + 1, c = N + i, e = N + i + 1; idx[k++] = a; idx[k++] = c; idx[k++] = b; idx[k++] = b; idx[k++] = c; idx[k++] = e; }
      L.push(new SimpleMeshLayer({ id: "curtain", ...M3D, data: [0], getPosition: () => [0, 0, 0],
        mesh: { attributes: { positions: { value: pos, size: 3 }, texCoords: { value: tex, size: 2 } }, indices: { value: idx, size: 1 } } as any,
        texture: curtainTex, getColor: [255, 255, 255, 255], material: false, parameters: { cullMode: "none" } as any }));
      const top = faceStations.map((s) => [...off(s.lon, s.lat), 0] as [number, number, number]);
      const frame = [...top, ...top.slice().reverse().map(([x, y]) => [x, y, -SECTION_DEPTH * EXAG * d] as [number, number, number]), top[0]];
      L.push(new PathLayer({ id: "curtain-frame", ...M3D, data: [frame], getPath: (p: any) => p, widthUnits: "pixels", getWidth: 3, getColor: [255, 255, 255, 190] }));
      // depth marks just inside the offshore edge (outside it they ran into the column's words), a tick on the edge for each
      const edge = faceStations[0], [ex, ey] = off(edge.lon, edge.lat), next = faceStations[1], [nx2, ny2] = off(next.lon, next.lat);
      const marks = [50, 100, 150].filter((z) => z <= SECTION_DEPTH * d - 8), tk = 0.035;
      L.push(new PathLayer({ id: "curtain-ticks", ...M3D, ...FLAT, data: marks, getPath: (z: number) => [[ex, ey, -z * EXAG], [ex + (nx2 - ex) * tk, ey + (ny2 - ey) * tk, -z * EXAG]], widthUnits: "pixels", getWidth: 3, getColor: [255, 255, 255, 230] }));
      L.push(new TextLayer({ id: "curtain-depths", ...M3D, ...TEXT, ...FLAT, data: marks,
        getPosition: (z: number) => [ex + (nx2 - ex) * tk, ey + (ny2 - ey) * tk, -z * EXAG], getText: (z: number) => `${z} m`, getSize: 38, getColor: rgba(INK, 1), getTextAnchor: "start", getAlignmentBaseline: "center", getPixelOffset: [10, 0] }));
    }
  }

  // ── the sea floor from above ──
  if (bathy && flat > 0) L.push(new BitmapLayer({ id: "bathy", ...FLAT, image: bathy.canvas, bounds: bathy.bounds, opacity: flat }));

  // ── which surface, which dots, which track: the beats ──
  if (t < B2) {                                                        // 1 · the baseline's November cruises, one after another
    const { k, p } = beat1(t), st = stationsOf(baseline[k]);
    const tr = trackTo(st, k === 0 ? ramp(p, 0.06, 0.7) : ramp(p, 0.04, 0.72));
    track = { path: tr.path, opacity: 1 }; ship = tr.path[tr.path.length - 1];
    // the first cruise is on screen from the first frame (its track then draws through it); the others arrive with the ship
    st.forEach((s, i) => { const a = k === 0 ? 1 : ramp(tr.reached, i - 0.4, i + 0.1); if (a > 0) dots.push({ lon: s.lon, lat: s.lat, r: 13 * (0.6 + 0.4 * a), fill: rgba(tempColor(s.temp), a), line: rgba(NAVY, 0.9 * a) }); });
  } else if (t < B3) {                                                 // 2 · all of them together → the average at each station
    const u = t - B2, conv = ease(ramp(u, 1.1, 2.0)), ring = 16 * (1 - conv), a = ramp(u, 0, 0.3);
    baseline.forEach((c, k) => {
      const ang = (2 * Math.PI * k) / baseline.length - Math.PI / 2;
      for (const s of stationsOf(c)) {
        const n = normalBySite.get(s.site_key), keep = n ? 1 - ramp(conv, 0.75, 1) : 1 - ramp(conv, 0, 0.6);
        if (keep <= 0) continue;
        const [lon, lat] = nudge(n?.lon ?? s.lon, n?.lat ?? s.lat, Math.cos(ang) * ring, Math.sin(ang) * ring);
        dots.push({ lon, lat, r: lerp(6, 4, conv), fill: rgba(tempColor(s.temp), a * keep), line: rgba(NAVY, 0.7 * a * keep) });
      }
    });
    const grow = ease(ramp(u, 1.5, 2.2));
    if (grow > 0) for (const n of normal) dots.push({ lon: n.lon, lat: n.lat, r: 13 * grow, fill: rgba(tempColor(n.clim), grow), line: rgba(NAVY, 0.9 * grow) });
  } else if (t < B4) {                                                 // 3 · the averages, interpolated to the regular grid
    const u = t - B3, fine = ease(ramp(u, 1.35, 2.0));
    shown.push({ key: "normal", opacity: fine, coarse: ease(ramp(u, 0.1, 0.8)) * (1 - fine), lines: ramp(u, 1.7, 2.2) });
    const r = lerp(13, 6.5, ease(ramp(u, 0.2, 1.1)));
    for (const n of normal) dots.push({ lon: n.lon, lat: n.lat, r, fill: rgba(tempColor(n.clim), 1), line: rgba(NAVY, 0.9) });
  } else if (t < B5) {                                                 // 4 · the next year: its track, its samples, its grid
    const u = t - B4, out = 1 - ramp(u, 0, 0.45), st = stationsOf(first);
    if (out > 0) { shown.push({ key: "normal", opacity: out, lines: out }); for (const n of normal) dots.push({ lon: n.lon, lat: n.lat, r: 6.5, fill: rgba(tempColor(n.clim), out), line: rgba(NAVY, 0.9 * out) }); }
    const tr = trackTo(st, ramp(u, 0.5, 2.2)), fine = ease(ramp(u, 2.95, 3.5));
    if (u >= 0.5) { track = { path: tr.path, opacity: 1 - ramp(u, 2.4, 3.2) * 0.75 }; if (u < 2.3) ship = tr.path[tr.path.length - 1]; }
    shown.push({ key: "first-temp", opacity: fine, coarse: ease(ramp(u, 2.3, 2.9)) * (1 - fine), lines: ramp(u, 3.2, 3.7) });
    const r = lerp(13, 6.5, ease(ramp(u, 2.4, 3.2)));
    st.forEach((s, i) => { const a = u < 0.5 ? 0 : ramp(tr.reached, i - 0.4, i + 0.1); if (a > 0) dots.push({ lon: s.lon, lat: s.lat, r: r * (0.6 + 0.4 * a), fill: rgba(tempColor(s.temp), a), line: rgba(NAVY, 0.9 * a) }); });
  } else if (t < B6) {                                                 // 5 · that year's departure from the normal
    const u = t - B5, x = ease(ramp(u, 0.25, 1.05));
    shown.push({ key: "first-temp", opacity: 1 - x, lines: 1 - x }, { key: "first-anom", opacity: x, lines: x });
    for (const s of stationsOf(first)) {
      if (s.anom == null) { dots.push({ lon: s.lon, lat: s.lat, r: 6.5, fill: rgba(tempColor(s.temp), 1 - x), line: x < 0.5 ? rgba(NAVY, 0.9) : rgba(MUTED, 0.9) }); continue; }
      const a = tempColor(s.temp), b = anomColor(s.anom);
      dots.push({ lon: s.lon, lat: s.lat, r: 6.5, fill: rgba([lerp(a[0], b[0], x), lerp(a[1], b[1], x), lerp(a[2], b[2], x)], 1), line: rgba(NAVY, 0.9) });
    }
  } else {                                                             // 6 · each November since; 7 · the last one, under the surface
    const i = beat6(t), x = ramp(t - beat6Start(i), 0, 0.18);
    const cur = series[i], prev = i ? `anom-${series[i - 1].cruise_key}` : "first-anom";
    if (x < 1) shown.push({ key: prev, opacity: 1 - x, lines: 1 - x });
    shown.push(in7 ? { key: `anom-${cur.cruise_key}`, opacity: 1, lines: flat, split: 1 - flat } : { key: `anom-${cur.cruise_key}`, opacity: x, lines: x });
    for (const s of stationsOf(cur)) {
      const onLine = in7 && s.line === SECTION_LINE, a = in7 ? (onLine ? 1 : lerp(1, 0.35, 1 - flat)) : 1;
      const style = s.anom == null ? noValue(a) : { fill: rgba(anomColor(s.anom), a), line: rgba(onLine ? INK : NAVY, 0.9 * a) };
      dots.push({ lon: s.lon, lat: s.lat, r: onLine ? lerp(6.5, 9, 1 - flat) : 6.5, ...style });
    }
  }

  // ── the surfaces (each its own layer: only its opacity changes from frame to frame) ──
  for (const s of shown) {
    const f = surfs.get(s.key); if (!f) continue;
    if (s.coarse && f.coarse && s.coarse > 0.003) L.push(new BitmapLayer({ id: `coarse-${s.key}`, ...FLAT, image: f.coarse.canvas, bounds: f.coarse.bounds, opacity: s.coarse,
      textureParameters: { minFilter: "nearest", magFilter: "nearest" } as any }));
    if (s.split != null && f.behind && f.front) {   // beat 7: the half behind the section stays as the sea surface, the half in front leaves
      L.push(new BitmapLayer({ id: `behind-${s.key}`, ...FLAT, image: f.behind, bounds: f.bounds, opacity: s.opacity }));
      if (s.split < 0.997) L.push(new BitmapLayer({ id: `front-${s.key}`, ...FLAT, image: f.front, bounds: f.bounds, opacity: s.opacity * (1 - s.split) }));
    } else if (s.opacity > 0.003) L.push(new BitmapLayer({ id: `surf-${s.key}`, ...FLAT, image: f.canvas, bounds: f.bounds, opacity: s.opacity }));
  }
  // ── the land, over the surfaces and the sea floor ──
  if (land) L.push(new GeoJsonLayer({ id: "land", data: land, stroked: true, filled: true, getFillColor: [36, 50, 74, 255], getLineColor: [159, 176, 200, 210], lineWidthUnits: "pixels", getLineWidth: 2 }));
  // ── the isolines: every degree, the even ones heavier, their values large enough for a phone ──
  for (const s of shown) {
    const f = surfs.get(s.key), a = s.lines ?? 0; if (!f || a <= 0.003) continue;
    const anom = s.key.includes("anom");
    L.push(new PathLayer({ id: `iso-${s.key}`, ...FLAT, data: f.lines, getPath: (d: any) => d.path, widthUnits: "pixels", opacity: a,
      getWidth: (d: any) => (d.level % 2 === 0 ? 4 : 2.2),
      getColor: (d: any) => (anom ? (d.level > 0 ? [112, 10, 30, 255] : [20, 48, 122, 255]) : [8, 18, 32, 205]) as RGBA, jointRounded: true, capRounded: true }));
    L.push(new TextLayer({ id: `isolab-${s.key}`, ...TEXT, ...FLAT, data: f.labels, getPosition: (d: any) => d.position, getText: (d: any) => d.text, getSize: 40,   // upright: a value turned along a steep isoline did not read
      getColor: [255, 255, 255, 255], opacity: a, getTextAnchor: "middle", getAlignmentBaseline: "center" }));
  }
  // ── the grid itself, faintly: every station that has a November normal ──
  const gridA = (t < B2 ? 0.55 : t < B3 ? 0.55 * (1 - ramp(t - B2, 1.5, 2.2)) : 0) + (t >= B4 && t < B5 ? 0.45 * ramp(t - B4, 0, 0.5) * (1 - ramp(t - B4, 2.4, 3.2)) : 0);
  if (gridA > 0.01) L.push(new ScatterplotLayer({ id: "grid", ...FLAT, data: normal, getPosition: (n: Normal) => [n.lon, n.lat], radiusUnits: "pixels", getRadius: 3.2, getFillColor: rgba(MUTED, 1), opacity: gridA }));
  // the places: four names from above; under the tilted camera only the one the section belongs to, larger
  const placeProps = { ...FLAT, getPosition: (p: any) => [p.lon, p.lat] as [number, number] };
  const others = in7 ? PLACES.filter((p) => p.name !== SECTION_PLACE) : PLACES, othersA = in7 ? flat : 1;
  if (othersA > 0.01) {
    L.push(new ScatterplotLayer({ id: "places-dot", ...placeProps, data: others, radiusUnits: "pixels", getRadius: 4.5, getFillColor: rgba(INK, 0.9), opacity: othersA, billboard: true }));
    L.push(new TextLayer({ id: "places", ...TEXT, ...placeProps, fontWeight: 600, data: others, getText: (p: any) => p.name, getSize: 32, getColor: rgba(INK, 0.95), opacity: othersA,
      getTextAnchor: "start", getAlignmentBaseline: "center", getPixelOffset: [13, 0] }));
  }
  if (in7) {
    const sd = PLACES.filter((p) => p.name === SECTION_PLACE);
    L.push(new ScatterplotLayer({ id: "place-dot-3d", ...placeProps, data: sd, radiusUnits: "pixels", getRadius: 6, getFillColor: rgba(INK, 0.95), billboard: true }));
    L.push(new TextLayer({ id: "place-3d", ...TEXT, ...placeProps, data: sd, getText: (p: any) => p.name, getSize: lerp(32, 46, 1 - flat), getColor: rgba(INK, 1),
      getTextAnchor: "middle", getAlignmentBaseline: "top", getPixelOffset: [0, 16] }));
  }
  if (track && track.path.length > 1) L.push(new PathLayer({ id: "track", ...FLAT, data: [track], getPath: (d: any) => d.path, widthUnits: "pixels", getWidth: 3, getColor: rgba(INK, 0.85), opacity: track.opacity, jointRounded: true, capRounded: true }));
  if (in7) L.push(new PathLayer({ id: "line-3d", ...FLAT, data: [secStations.map((s) => [s.lon, s.lat])], getPath: (d: any) => d, widthUnits: "pixels", getWidth: 3, getColor: rgba(INK, 0.9 * ease(ramp(u7, 0.6, 1.6))) }));
  L.push(new ScatterplotLayer({ id: "dots", ...FLAT, data: dots, getPosition: (d: Dot) => [d.lon, d.lat], radiusUnits: "pixels", getRadius: (d: Dot) => d.r, getFillColor: (d: Dot) => d.fill,
    stroked: true, lineWidthUnits: "pixels", getLineWidth: 1.6, getLineColor: (d: Dot) => d.line, billboard: true }));
  if (ship) L.push(new ScatterplotLayer({ id: "ship", ...FLAT, data: [ship], getPosition: (d: any) => d, radiusUnits: "pixels", getRadius: 7, getFillColor: [255, 255, 255, 255], stroked: true, lineWidthUnits: "pixels", getLineWidth: 5, getLineColor: [255, 255, 255, 90] }));
  return L;
}

// ── the words, the legends, the strip (DOM over the canvas) ──────────────────────────────────────────────────────
const $ = (id: string) => document.getElementById(id)!;
function legend(id: string, rampId: string, domain: [number, number], ticks: number[], fmt: (v: number) => string, unit: string) {
  const root = $(id); (root.querySelector(".legend-bar") as HTMLElement).style.background = rampCss(rampId);
  const tk = root.querySelector(".legend-ticks")!;
  tk.innerHTML = ticks.map((v) => `<span style="left:${((v - domain[0]) / (domain[1] - domain[0])) * 100}%">${fmt(v)}</span>`).join("") + `<span class="unit" style="left:100%;margin-left:14px">${unit}</span>`;
}
legend("legend-temp", "thermal", TEMP, [12, 16, 20, 24], (v) => String(v), "°C");
legend("legend-anom", "balance", ANOM, [-12, -6, 0, 6, 12], (v) => (v > 0 ? `+${v}` : v < 0 ? `−${-v}` : "0"), "°C");
$("credit").innerHTML = `<b>CalCOFI</b> · calcofi.io<br>CTD casts · release ${RELEASE}`;

// the strip: which cruise, out of all of them. Every November cruise is a dot on the years' line (the other months' CTD
// cruises a faint texture behind it), the one on screen is the yellow one with its year under it, and each cruise the
// film has played since the baseline keeps a bar: its mean surface departure over the stations the 2026 cruise occupied
// (cruises.json mean_anom_fp: the same stations every year).
const SX0 = 120, SX1 = 1800, SY = 140, Y0 = 1993, Y1 = 2027.3, BAR = 22, BAR_W = 34;
const decYear = (d: string) => { const [y, m, dd] = d.split("-").map(Number); return y + (m - 1) / 12 + (dd - 1) / 365; };
const sx = (yr: number) => SX0 + ((yr - Y0) / (Y1 - Y0)) * (SX1 - SX0);
const stripX = new Map(strip.map((c) => [c.cruise_key, sx(decYear(c.date_median))]));
const NOV = strip.filter((c) => c.november);
const novYears = new Set(NOV.map((c) => c.year));
/** the years since the baseline with no November cruise: read off the data, never listed */
const MISSING = Array.from({ length: last.year - first.year }, (_, i) => first.year + i).filter((y) => !novYears.has(y));
const NOV_X = sx(2014.87) - sx(2014);   // where in a year's slot a November cruise falls
const NOTE_X = MISSING.length ? sx((MISSING[0] + MISSING[MISSING.length - 1]) / 2) + NOV_X : -1e6, NOTE_HALF = 140;   // the empty slots' label: its middle and half its width
function stripSvg(t: number): string {
  const s: string[] = [], inBase = t >= B2 && t < B4;
  s.push(`<rect x="${sx(1993)}" y="${SY - 58}" width="${sx(2014) - sx(1993)}" height="74" rx="8" fill="rgba(159,176,200,${inBase ? 0.34 : 0.13})"/>`);
  s.push(`<text x="${sx(1993) + 18}" y="${SY - 20}" font-size="36" font-weight="600" style="fill:rgba(233,237,243,${inBase ? 1 : 0.78})">the normal: 1993–2013</text>`);
  s.push(`<line x1="${SX0 - 24}" y1="${SY}" x2="${SX1 + 24}" y2="${SY}" stroke="rgba(159,176,200,0.65)" stroke-width="2.5"/>`);
  for (const c of strip) if (!c.november) { const x = stripX.get(c.cruise_key)!; s.push(`<line x1="${x}" y1="${SY - 5}" x2="${x}" y2="${SY + 5}" stroke="rgba(159,176,200,0.28)" stroke-width="2"/>`); }
  // which cruise is showing, and which have played
  let cur: Cruise | null = null; const played: Cruise[] = [];
  if (t < B2) cur = baseline[beat1(t).k];
  if (t >= B4 && t < B6) cur = first;
  if (t >= B5) played.push(first);
  if (t >= B6) { const i = beat6(t); cur = series[i]; played.push(...series.slice(0, i + 1)); }
  for (const c of played) {
    const x = stripX.get(c.cruise_key)!, grow = c === first ? ease(ramp(t - B5, 0.4, 1.1)) : ease(ramp(t - beat6Start(series.indexOf(c)), 0, 0.2));
    const h = c.mean_anom_fp * BAR * grow, on = c === cur, lx = Math.min(x, SX1 - 60);
    // the value over the bar on screen: above its bar, above a neighbouring empty slot, and above the slots' own label
    const ly = Math.min(SY - h, SY - 32) - 16 - (t >= B6 && lx + 95 > NOTE_X - NOTE_HALF && lx - 95 < NOTE_X + NOTE_HALF ? 34 : 0);
    s.push(`<rect x="${x - BAR_W / 2}" y="${h >= 0 ? SY - h : SY}" width="${BAR_W}" height="${Math.max(2, Math.abs(h))}" fill="${css(anomColor(c.mean_anom_fp))}" stroke="${on ? "#ffcd00" : "rgba(233,237,243,0.85)"}" stroke-width="${on ? 4 : 1.5}"/>`);
    if (on) s.push(`<text x="${lx}" y="${ly}" font-size="46" font-weight="700" text-anchor="middle" style="fill:#ffffff" paint-order="stroke" stroke="#0f1a2e" stroke-width="8">${signed(c.mean_anom_fp)} °C</text>`);
  }
  if (t >= B5) s.push(`<text x="${sx(2014) - 70}" y="${SY - 72}" font-size="32" text-anchor="end" opacity="${ramp(t - B5, 0.4, 1.1)}">bars: surface, at 2026's stations</text>`);
  // the years with no November cruise: two empty slots
  if (t >= B6) {
    for (const y of MISSING) s.push(`<rect x="${sx(y) + NOV_X - BAR_W / 2}" y="${SY - 30}" width="${BAR_W}" height="30" fill="none" stroke="rgba(159,176,200,0.95)" stroke-width="2.5" stroke-dasharray="7 5"/>`);
    if (MISSING.length) s.push(`<text x="${NOTE_X}" y="${SY - 42}" font-size="30" text-anchor="middle">no November cruise</text>`);
  }
  for (const c of NOV) {
    const x = stripX.get(c.cruise_key)!, on = c.cruise_key === cur?.cruise_key, lit = inBase && c.year <= 2013;
    s.push(`<circle cx="${x}" cy="${SY}" r="${on ? 14 : 8}" fill="${on ? "#ffcd00" : lit ? "#ffffff" : "rgba(233,237,243,0.8)"}" stroke="#0f1a2e" stroke-width="2.5"/>`);
    if (on) s.push(`<path d="M${x - 16} ${SY + 34} L${x + 16} ${SY + 34} L${x} ${SY + 16} Z" fill="#ffcd00"/>`);
  }
  // few, large year labels; the current cruise's own year in yellow (a decade label beside it steps aside)
  for (const y of [2000, 2010, 2020]) if (!cur || Math.abs(cur.year - y) > 2) s.push(`<text x="${sx(y) + NOV_X}" y="${SY + 92}" font-size="46" text-anchor="middle">${y}</text>`);
  if (cur) s.push(`<text x="${Math.min(stripX.get(cur.cruise_key)!, SX1 - 30)}" y="${SY + 92}" font-size="50" font-weight="700" text-anchor="middle" style="fill:#ffcd00">${cur.year}</text>`);
  return s.join("");
}

interface Words { kicker: string; year: string; range?: boolean; pill?: boolean; caption: string; caption2?: string }
const titleCase = (s: string) => s.replace(/\b(\w)(\w*)/g, (_, a, b) => a + b.toLowerCase());
function wordsAt(t: number): Words {
  const stations = (c: Cruise) => `${c.n_stations} stations`;
  if (t < B2) { const c = baseline[beat1(t).k]; return { kicker: "November", year: String(c.year), caption: "Every fall, a ship measures the ocean off California", caption2: `${titleCase(c.ship)} · ${stations(c)}` }; }
  if (t < B3) return { kicker: "November", year: "1993–2013", range: true, caption: "All of them together: the normal", caption2: `Normal = the 1993–2013 average for November (${baseline.length} cruises)` };
  if (t < B4) return { kicker: "November", year: "1993–2013", range: true, caption: "The normal, mapped between the stations", caption2: "Normal = the 1993–2013 average for November" };
  if (t < B5) return { kicker: "November", year: String(first.year), caption: "The next year: one cruise, its stations, its map", caption2: stations(first) };
  if (t < B6) return { kicker: "November", year: String(first.year), caption: "The same cruise, as its difference from normal", caption2: "Red is warmer than normal, blue is cooler" };
  const c = series[beat6(t)], prelim = c.data_stage !== "final";
  if (t >= B7) return { kicker: "Line 93.3, off San Diego", year: String(c.year), pill: prelim, caption: "" };
  // the last map says what it shows, the surface, in the stations' own numbers (facts.json coast_min / coast_max: the
  // inner Bight's 0–10 m departures; build_data.sql stops the build if the offshore stations reach into that range)
  if (c === last) return { kicker: "November", year: String(c.year), pill: prelim, caption: `At the surface: ${Math.round(facts.coast_min)} to ${Math.round(facts.coast_max)} °C warmer than normal near the coast` };
  return { kicker: "November", year: String(c.year), pill: prelim, caption: "Each November since, against the same normal", caption2: stations(c) };
}
/** the three sentences of beat 7, from facts.json */
const HERO = `${signed(facts.max_anom)} °C`;
const HERO_TEXT = `at ${facts.max_anom_bin}–${facts.max_anom_bin + 10} m depth: the largest departure in CalCOFI's record, ${facts.record_from}–${facts.record_to}`;
const TAG = `${facts.layer_temp} °C water down to ${facts.layer_depth} m`;

let lastWords = "";
function hudAt(t: number, cam: Cam) {
  const w = wordsAt(t), key = JSON.stringify(w);
  if (key !== lastWords) {
    lastWords = key;
    $("kicker").textContent = w.kicker; $("year").textContent = w.year; $("year").classList.toggle("range", !!w.range);
    $("caption").textContent = w.caption; $("caption2").textContent = w.caption2 ?? "";
  }
  $("pill").style.opacity = w.pill ? "1" : "0";
  const anomLegend = t < B5 ? 0 : ease(ramp(t - B5, 0.25, 1.05));
  $("legend-temp").style.opacity = String(1 - anomLegend); $("legend-anom").style.opacity = String(anomLegend);
  $("strip").innerHTML = stripSvg(t);
  const n7 = ease(ramp(t - B7, 0.2, 2.7));   // the column's scrim narrows as the section comes up beside the words
  $("scrim").style.background = `linear-gradient(90deg, rgba(15,26,46,0.94) 0, rgba(15,26,46,${lerp(0.86, 0.92, n7)}) ${lerp(520, 560, n7)}px, rgba(15,26,46,0) ${lerp(900, 700, n7)}px)`;
  // beat 7: the number and what it is; the tag on the warm layer; the ring on the record's own cell
  const u = t - B7, big = ease(ramp(u, 3.0, 3.6)), tagA = ease(ramp(u, 2.5, 3.1));
  $("callout").style.opacity = String(big);
  $("callout-big").textContent = HERO; $("callout-text").textContent = HERO_TEXT;
  const tag = $("tag"), leader = $("leader"); tag.style.opacity = String(tagA);
  if (tagA > 0 || big > 0) {
    const vp = viewport(cam), a = stationAt(28), b = stationAt(facts.max_anom_station);
    const [x, y] = vp.project([(a.lon + b.lon) / 2, (a.lat + b.lat) / 2, -22 * EXAG]);                      // in the warm layer, between the two core stations
    const [rx, ry] = vp.project([b.lon, b.lat, -(facts.max_anom_bin + 5) * EXAG]);                        // the record's cell: its station, the middle of its bin
    tag.textContent = TAG;
    const tw = tag.offsetWidth, th = tag.offsetHeight, tx = Math.min(W - tw - 36, Math.max(760, x - tw * 0.5)), ty = y - 268;
    tag.style.transform = `translate(${tx}px, ${ty}px)`;
    leader.innerHTML =
      `<line x1="${Math.min(tx + tw - 50, Math.max(tx + 50, x))}" y1="${ty + th}" x2="${x}" y2="${y}" stroke="rgba(233,237,243,${0.95 * tagA})" stroke-width="3.5"/><circle cx="${x}" cy="${y}" r="8" fill="rgba(233,237,243,${tagA})"/>` +
      `<circle cx="${rx}" cy="${ry}" r="21" fill="none" stroke="rgba(15,26,46,${0.9 * big})" stroke-width="10"/><circle cx="${rx}" cy="${ry}" r="21" fill="none" stroke="rgba(255,255,255,${big})" stroke-width="5"/>` +
      `<text x="${rx}" y="${ry + 80}" font-size="48" font-weight="700" text-anchor="middle" style="fill:rgba(255,255,255,${big})" paint-order="stroke" stroke="rgba(15,26,46,${0.95 * big})" stroke-width="11" stroke-linejoin="round">${HERO}</text>`;
  } else leader.innerHTML = "";
}

// ── the clock ────────────────────────────────────────────────────────────────────────────────────────────────────
let ready = false;
function setFrame(t: number) {
  const tt = Math.min(DURATION - 1e-6, Math.max(0, t)), cam = camAt(tt);
  deck.setProps({ viewState: { ...cam, maxPitch: 85 }, layers: ready ? layersAt(tt) : [] });
  if (ready) hudAt(tt, cam);
}
const raf = () => new Promise<void>((r) => requestAnimationFrame(() => r()));
async function settle() { for (let i = 0; i < 3; i++) await raf(); }

/** what a capture must be able to trust, checked once the page is ready (capture.mjs prints it and stops on a failure):
 *  the section's seven stations stay inside the frame, clear of the column and the strip, at every frame of the move */
function selfCheck() {
  let x0 = Infinity, x1 = -Infinity, y0 = Infinity, y1 = -Infinity;
  for (let k = Math.round(B7 * FPS); k < DURATION * FPS; k++) {
    const vp = viewport(camAt(k / FPS));
    for (const s of secStations) for (const z of [0, -SECTION_DEPTH * EXAG]) { const [x, y] = vp.project([s.lon, s.lat, z]); x0 = Math.min(x0, x); x1 = Math.max(x1, x); y0 = Math.min(y0, y); y1 = Math.max(y1, y); }
  }
  const box = [x0, y0, x1, y1].map(Math.round), ok = x0 >= 620 && x1 <= W - 20 && y0 >= 60 && y1 <= 800;   // right of the column's words, above the strip
  return { sectionBox: box, sectionInFrame: ok, missingYears: MISSING, hero: HERO, heroText: HERO_TEXT, tag: TAG, lastCaption: wordsAt(B7 - 0.1).caption };
}

async function boot() {
  await Promise.all([document.fonts.load(`600 100px "Teko"`), document.fonts.load(`600 40px "Source Sans 3"`), document.fonts.load(`700 40px "Source Sans 3"`), document.fonts.load(`400 40px "Source Sans 3"`)]);
  await document.fonts.ready;
  const pts = (st: Sta[], f: (s: Sta) => number | null) => st.filter((s) => f(s) != null).map((s) => ({ lon: s.lon, lat: s.lat, z: f(s)! }));
  const a = secStations[0], b = secStations[secStations.length - 1];
  await Promise.all([
    buildSurf("normal", normal.map((n) => ({ lon: n.lon, lat: n.lat, z: n.clim })), "temp", true),
    buildSurf("first-temp", pts(stationsOf(first), (s) => s.temp), "temp", true),
    buildSurf("first-anom", pts(stationsOf(first), (s) => s.anom), "anom", false),
    ...series.map((c) => buildSurf(`anom-${c.cruise_key}`, pts(stationsOf(c), (s) => s.anom), "anom", false)),
    fetch(`${import.meta.env.BASE_URL}land.geojson`).then((r) => r.json()).then((g) => { land = g; }),
    loadMosaic(-131.7, 28.3, -115.7, 36.1, 7).then((m) => {
      bathy = { canvas: flatBathy(m), bounds: mosaicBounds(m) };
      floor = floorMesh(m, { lon0, lat0, exag: EXAG, zFloor: -(SECTION_DEPTH * 1.3 + 40), a: [a.lon, a.lat], b: [b.lon, b.lat], nearKm: 3, blendKm: 16 });
      story.terrain = { tiles: m.tiles, missing: m.missing, W: m.W, H: m.H, vertices: floor.vertices };
    }),
  ]);
  curtainTex = sectionTexture();
  splitAlongLine(surfs.get(`anom-${last.cruise_key}`)!);
  ready = true; $("loading").style.display = "none";
  story.surfaces = [...surfs.entries()].map(([k, s]) => ({ key: k, n: s.n, lines: s.lines.length, labels: s.labels.length }));
  story.check = selfCheck();
}

const story: any = ((window as any).__story = {
  duration: DURATION, fps: FPS, width: W, height: H, beats: { B1, B2, B3, B4, B5, B6, B7 },
  ready: null as Promise<void> | null,
  /** set the clock and resolve once that frame is on screen (capture.mjs steps this) */
  setT: async (t: number) => { setFrame(t); await settle(); },
});
story.ready = boot().then(async () => {
  if (q.has("t")) { await story.setT(Number(q.get("t"))); return; }
  // live: scale the stage to the window and run the clock; space pauses, ← → step a second
  const fitStage = () => { const k = Math.min(innerWidth / W, innerHeight / H); $("stage").style.transform = `scale(${k})`; };
  fitStage(); addEventListener("resize", fitStage);
  let t0 = performance.now(), paused = false, tp = 0;
  addEventListener("keydown", (e) => {
    if (e.key === " ") { paused = !paused; t0 = performance.now() - tp * 1000; }
    if (e.key === "ArrowRight" || e.key === "ArrowLeft") { tp = (tp + (e.key === "ArrowRight" ? 1 : -1) + DURATION) % DURATION; t0 = performance.now() - tp * 1000; setFrame(tp); }
  });
  const loop = () => { if (!paused) { tp = ((performance.now() - t0) / 1000) % DURATION; setFrame(tp); } requestAnimationFrame(loop); };
  loop();
});
story/elnino-2026/page/terrain.ts (161 lines)
// the sea floor, from the SAME published GEBCO 2025 terrain PMTiles the Explorer draws (src/basemap.ts BATHY_URL; the
// custom 1 m encoding e = r·65536 + g·256 + b − 10000), decoded in-page the way src/curtain.tsx loadMosaic() does it.
// That function lives in a React module (it would pull the whole app into this page), so its dozen lines are repeated
// here; the ramp is the app's own (BATHY_RAMP), imported.
//   · flatBathy(): the mosaic as one shaded, depth-coloured image for the bird's-eye beats (a flat bitmap: a 3-D mesh
//     under a perspective camera would shift against the coastline)
//   · floorMesh(): the mesh of the 3-D beat, metres from an origin, vertical exaggeration baked in, clipped to a plinth
//     a little below the section (curtain.tsx's stage: the abyss is not a tower). At the section's own exaggeration an
//     island is a needle, so the mesh is the terrain itself only beside the section's line and a low-passed, fading
//     backdrop away from it
import { PMTiles } from "pmtiles";
import { BATHY_URL, BATHY_RAMP } from "../../../src/basemap";

const TILE = 512, O = 20037508.342789244;
const mx = (lon: number) => (lon * O) / 180;
const my = (lat: number) => Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI) / 360)) * (O / Math.PI);
export const invMerc = (x: number, y: number): [number, number] => [(x * 180) / O, ((2 * Math.atan(Math.exp((y * Math.PI) / O)) - Math.PI / 2) * 180) / Math.PI];

export interface Mosaic { e: Float32Array; W: number; H: number; x0m: number; y1m: number; res: number; tiles: number; missing: number }

export async function loadMosaic(w: number, s: number, e: number, n: number, z = 7): Promise<Mosaic> {
  const pm = new PMTiles(`${BATHY_URL}gebco_2025_calcofi_terrain.pmtiles`);
  const far = new PMTiles(`${BATHY_URL}gebco_2025_calcofi_terrain_far.pmtiles`); // the coarser tier, where the core has no tile
  const span = (2 * O) / 2 ** z, res = span / TILE;
  const tx0 = Math.floor((mx(w) + O) / span), tx1 = Math.floor((mx(e) + O) / span);
  const ty0 = Math.floor((O - my(n)) / span), ty1 = Math.floor((O - my(s)) / span);
  const nx = tx1 - tx0 + 1, ny = ty1 - ty0 + 1, W = nx * TILE, H = ny * TILE;
  const el = new Float32Array(W * H).fill(NaN);
  let missing = 0;
  await Promise.all(Array.from({ length: nx * ny }, async (_, i) => {
    const x = tx0 + (i % nx), y = ty0 + Math.floor(i / nx);
    const t = (await pm.getZxy(z, x, y)) ?? (await far.getZxy(z, x, y).catch(() => undefined));
    if (!t) { missing++; return; }
    const img = await createImageBitmap(new Blob([t.data], { type: "image/png" }));
    const cv = new OffscreenCanvas(TILE, TILE), ctx = cv.getContext("2d", { willReadFrequently: true })!;
    ctx.drawImage(img, 0, 0);
    const d = ctx.getImageData(0, 0, TILE, TILE).data;
    const ox = (x - tx0) * TILE, oy = (y - ty0) * TILE;
    for (let r = 0; r < TILE; r++) for (let c = 0; c < TILE; c++) {
      const j = (r * TILE + c) * 4;
      el[(oy + r) * W + ox + c] = d[j] * 65536 + d[j + 1] * 256 + d[j + 2] - 10000;
    }
  }));
  return { e: el, W, H, x0m: tx0 * span - O, y1m: O - ty0 * span, res, tiles: nx * ny, missing };
}

/** the mosaic's lon/lat bounds [west, south, east, north]; its rows are regular in Web-Mercator y, which is what a
 *  deck BitmapLayer stretches between its bounds */
export function mosaicBounds(m: Mosaic): [number, number, number, number] {
  const [w, n] = invMerc(m.x0m, m.y1m), [e, s] = invMerc(m.x0m + m.W * m.res, m.y1m - m.H * m.res);
  return [w, s, e, n];
}

const hex = (h: string): [number, number, number] => [parseInt(h.slice(1, 3), 16), parseInt(h.slice(3, 5), 16), parseInt(h.slice(5, 7), 16)];
/** the app's dark depth ramp as (depth m ≥ 0) → rgb; the ramp's last stop (0 m, transparent) takes the −50 m colour */
function depthColor(): (d: number) => [number, number, number] {
  const st = BATHY_RAMP.dark, pts: { d: number; c: [number, number, number] }[] = [];
  for (let i = 0; i < st.length; i += 2) { const s = String(st[i + 1]); if (s.startsWith("#")) pts.push({ d: -(st[i] as number), c: hex(s) }); }
  pts.sort((a, b) => a.d - b.d);
  return (d: number) => {
    if (d <= pts[0].d) return pts[0].c;
    for (let i = 1; i < pts.length; i++) if (d <= pts[i].d) {
      const a = pts[i - 1], b = pts[i], f = (d - a.d) / (b.d - a.d);
      return [a.c[0] + (b.c[0] - a.c[0]) * f, a.c[1] + (b.c[1] - a.c[1]) * f, a.c[2] + (b.c[2] - a.c[2]) * f];
    }
    return pts[pts.length - 1].c;
  };
}

/** the bird's-eye sea floor: depth colour × a north-west light. Land (elevation ≥ 0) and missing tiles are transparent,
 *  so the page's own ground shows there and the land layer draws over it. */
export function flatBathy(m: Mosaic): HTMLCanvasElement {
  const cv = document.createElement("canvas"); cv.width = m.W; cv.height = m.H;
  const ctx = cv.getContext("2d")!, img = ctx.createImageData(m.W, m.H), d = img.data, col = depthColor();
  const at = (i: number, j: number) => { const v = m.e[Math.min(m.H - 1, Math.max(0, j)) * m.W + Math.min(m.W - 1, Math.max(0, i))]; return Number.isFinite(v) ? v : 0; };
  for (let j = 0; j < m.H; j++) for (let i = 0; i < m.W; i++) {
    const o = j * m.W + i, e = m.e[o];
    if (!Number.isFinite(e) || e >= 0) continue;
    // slope toward the light (from the north-west, the cartographic habit), in metres per metre, softly exaggerated
    const dzx = (at(i + 1, j) - at(i - 1, j)) / (2 * m.res), dzy = (at(i, j - 1) - at(i, j + 1)) / (2 * m.res);
    const shade = Math.max(0.55, Math.min(1.6, 1 + 9 * (-dzx + dzy)));
    const c = col(-e);
    d[o * 4] = Math.min(255, c[0] * shade); d[o * 4 + 1] = Math.min(255, c[1] * shade); d[o * 4 + 2] = Math.min(255, c[2] * shade); d[o * 4 + 3] = 255;
  }
  ctx.putImageData(img, 0, 0);
  return cv;
}

export interface FloorMesh { positions: Float32Array; texCoords: Float32Array; normals: Float32Array; indices: Uint32Array; texture: HTMLCanvasElement; vertices: number }
export interface FloorOpts {
  /** metres east / north are measured from here */ lon0: number; lat0: number;
  /** vertical exaggeration, and the plinth: no vertex lies deeper than zFloor (m, negative) */ exag: number; zFloor: number;
  /** the section's ends [lon, lat]: the floor is the TRUE sea floor within nearKm of that segment … */ a: [number, number]; b: [number, number];
  nearKm?: number;
  /** … a low-passed one from blendKm outward (islands and banks at this exaggeration are needles otherwise) … */ blendKm?: number;
  /** … and sinks to the plinth and into the page's ground between fade0Km and fade1Km */ fade0Km?: number; fade1Km?: number;
  step?: number; dim?: number; ground?: [number, number, number];
}
const smooth = (x: number, a: number, b: number) => { const t = Math.min(1, Math.max(0, (x - a) / (b - a))); return t * t * (3 - 2 * t); };
/** three passes of a box blur of half-width r over a grid: close to a Gaussian */
function blur(src: Float32Array, w: number, h: number, r: number): Float32Array {
  let a = Float32Array.from(src), b = new Float32Array(w * h);
  for (let pass = 0; pass < 3; pass++) {
    for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) { let s = 0, n = 0; for (let k = Math.max(0, i - r); k <= Math.min(w - 1, i + r); k++) { s += a[j * w + k]; n++; } b[j * w + i] = s / n; }
    for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) { let s = 0, n = 0; for (let k = Math.max(0, j - r); k <= Math.min(h - 1, j + r); k++) { s += b[k * w + i]; n++; } a[j * w + i] = s / n; }
  }
  return a;
}
/** the 3-D sea floor in metres east / north of (lon0, lat0), z = elevation × exag. ONE vertical scale where the section
 *  meets it: within nearKm of the section's line it is the terrain itself; farther out it is low-passed, so an island or
 *  a bank is a rise and not a needle; beyond fade0Km it sinks to the plinth and fades into the ground. Never below zFloor
 *  (the plinth, a little under the section) and never above −2 m (the land polygons sit at 0). */
export function floorMesh(m: Mosaic, o: FloorOpts): FloorMesh {
  const step = o.step ?? 4, nearKm = o.nearKm ?? 7, blendKm = o.blendKm ?? 24, fade0 = o.fade0Km ?? 55, fade1 = o.fade1Km ?? 150, dim = o.dim ?? 0.8, ground = o.ground ?? [15, 26, 46];
  const kx = 111320 * Math.cos((o.lat0 * Math.PI) / 180), ky = 110540;
  const MW = Math.floor(m.W / step), MH = Math.floor(m.H / step);
  const xs = new Float32Array(MW), ys = new Float32Array(MH);
  for (let i = 0; i < MW; i++) xs[i] = (invMerc(m.x0m + i * step * m.res, 0)[0] - o.lon0) * kx;
  for (let j = 0; j < MH; j++) ys[j] = (invMerc(0, m.y1m - j * step * m.res)[1] - o.lat0) * ky;
  const raw = new Float32Array(MW * MH);
  for (let j = 0; j < MH; j++) for (let i = 0; i < MW; i++) { const v = m.e[Math.min(m.H - 1, j * step) * m.W + Math.min(m.W - 1, i * step)]; raw[j * MW + i] = Number.isFinite(v) ? v : -4000; }
  const clamp = (v: number) => Math.max(o.zFloor, Math.min(-2, v));
  // beside the line the terrain keeps its own shape at about 3 km (one light pass: a pinnacle one vertex wide is a needle
  // at this exaggeration); away from it, a 10 km low-pass
  const sharp = blur(raw.map(clamp), MW, MH, 1), soft = blur(sharp, MW, MH, 5), softRaw = blur(raw.map((v) => Math.min(0, v)), MW, MH, 5);
  // distance (km) of every vertex from the section's segment
  const ax = (o.a[0] - o.lon0) * kx, ay = (o.a[1] - o.lat0) * ky, bx = (o.b[0] - o.lon0) * kx, by = (o.b[1] - o.lat0) * ky, L2 = (bx - ax) ** 2 + (by - ay) ** 2;
  const z = new Float32Array(MW * MH), far = new Float32Array(MW * MH);
  for (let j = 0; j < MH; j++) for (let i = 0; i < MW; i++) {
    const k = j * MW + i, t = Math.min(1, Math.max(0, ((xs[i] - ax) * (bx - ax) + (ys[j] - ay) * (by - ay)) / L2));
    const d = Math.hypot(xs[i] - (ax + t * (bx - ax)), ys[j] - (ay + t * (by - ay))) / 1000;
    const near = 1 - smooth(d, nearKm, blendKm); far[k] = smooth(d, fade0, fade1);
    const zz = soft[k] + (sharp[k] - soft[k]) * near;
    z[k] = o.zFloor + (zz - o.zFloor) * (1 - far[k]);
  }
  const pos = new Float32Array(MW * MH * 3), tex = new Float32Array(MW * MH * 2), nor = new Float32Array(MW * MH * 3);
  for (let j = 0; j < MH; j++) for (let i = 0; i < MW; i++) {
    const k = j * MW + i;
    pos[k * 3] = xs[i]; pos[k * 3 + 1] = ys[j]; pos[k * 3 + 2] = z[k] * o.exag;
    tex[k * 2] = Math.min(1, Math.max(0, -softRaw[k] / 6500)); tex[k * 2 + 1] = far[k];   // u: the (low-passed) true depth, also on the plinth · v: the fade
    const i0 = Math.max(0, i - 1), i1 = Math.min(MW - 1, i + 1), j0 = Math.max(0, j - 1), j1 = Math.min(MH - 1, j + 1);
    const dzx = ((z[j * MW + i1] - z[j * MW + i0]) * o.exag) / (xs[i1] - xs[i0]), dzy = ((z[j0 * MW + i] - z[j1 * MW + i]) * o.exag) / (ys[j0] - ys[j1]);
    const nl = Math.hypot(dzx, dzy, 1);
    nor[k * 3] = -dzx / nl; nor[k * 3 + 1] = -dzy / nl; nor[k * 3 + 2] = 1 / nl;
  }
  const idx = new Uint32Array((MW - 1) * (MH - 1) * 6); let q = 0;
  for (let j = 0; j < MH - 1; j++) for (let i = 0; i < MW - 1; i++) {
    const a = j * MW + i, b = a + 1, c = a + MW, dd = c + 1;
    idx[q++] = a; idx[q++] = c; idx[q++] = b; idx[q++] = b; idx[q++] = c; idx[q++] = dd;
  }
  // the texture: u = depth / 6500 through the app's ramp (curtain.tsx rampTexture()), v = 0 as it is → 1 the page's ground
  const col = depthColor(), TW = 256, TH = 32, tx = document.createElement("canvas"); tx.width = TW; tx.height = TH;
  const g = tx.getContext("2d")!, im = g.createImageData(TW, TH);
  for (let r = 0; r < TH; r++) for (let i = 0; i < TW; i++) {
    const c = col((i / (TW - 1)) * 6500), f = r / (TH - 1), p = (r * TW + i) * 4;
    for (let ch = 0; ch < 3; ch++) im.data[p + ch] = c[ch] * dim * (1 - f) + ground[ch] * f;
    im.data[p + 3] = 255;
  }
  g.putImageData(im, 0, 0);
  return { positions: pos, texCoords: tex, normals: nor, indices: idx, texture: tx, vertices: MW * MH };
}
story/elnino-2026/page/style.css (56 lines)
/* the story's stage: one fixed 1920 x 1080 frame (the video's own pixels), scaled to fit a live window.
   Colours and faces are the brand's dark tokens (calcofi.io/brand/v2/theme.css); the literals are only fallbacks.
   Type is sized for a phone: the frame is ~390 px wide there, so 56 px here is ~11 px there. */
html, body { margin: 0; height: 100%; background: #060b14; overflow: hidden; }
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden; transform-origin: 0 0;
  background: var(--bg, #0f1a2e); color: var(--fg, #e9edf3);
  font-family: var(--sans, "Source Sans 3", system-ui, sans-serif); font-size: 40px; line-height: 1.15;
  -webkit-font-smoothing: antialiased;
}
#map { position: absolute; inset: 0; }
#map canvas { display: block; }
/* a scrim under the column, so the words never fight the sea floor */
#scrim { position: absolute; left: 0; top: 0; width: 900px; height: 1080px; pointer-events: none;
  background: linear-gradient(90deg, rgba(15, 26, 46, 0.94) 0, rgba(15, 26, 46, 0.86) 520px, rgba(15, 26, 46, 0) 900px); }
#scrim-strip { position: absolute; left: 0; top: 806px; width: 1920px; height: 274px; pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 26, 46, 0) 0, rgba(15, 26, 46, 0.92) 70px, rgba(15, 26, 46, 0.96) 274px); }

/* the left column: what, when, and the one sentence of the beat */
#col { position: absolute; left: 64px; top: 34px; width: 640px; }
#kicker { font-weight: 700; font-size: 38px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted, #9fb0c8); height: 44px; }
#year { font-family: var(--display, "Teko", sans-serif); font-weight: 600; font-size: 250px; line-height: 0.86; margin: 6px 0 0 -6px; letter-spacing: -0.01em; white-space: nowrap; height: 210px; }
#year.range { font-size: 150px; line-height: 1.42; }
#pill {
  display: inline-block; margin-top: 2px; padding: 4px 18px 6px; border-radius: 8px; font-weight: 700; font-size: 34px;
  letter-spacing: 0.06em; text-transform: uppercase; color: #182b49; background: var(--cc-yellow, #ffcd00); opacity: 0;
}
#caption  { margin-top: 18px; font-weight: 600; font-size: 54px; line-height: 1.1; text-wrap: balance; }
#caption2 { margin-top: 14px; font-weight: 400; font-size: 42px; line-height: 1.14; color: var(--muted, #9fb0c8); text-wrap: balance; }

/* the legends: one fixed scale each, for the whole film */
#legends { position: absolute; left: 64px; top: 662px; width: 600px; height: 160px; }
.legend { position: absolute; left: 0; top: 0; width: 600px; opacity: 0; }
.legend-title { font-weight: 600; font-size: 40px; margin-bottom: 8px; }
.legend-bar { height: 36px; border-radius: 4px; box-shadow: 0 0 0 1.5px rgba(233, 237, 243, 0.4); }
.legend-ticks { position: relative; height: 54px; font-size: 42px; font-weight: 600; color: var(--fg, #e9edf3); }
.legend-ticks span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.legend-ticks span.unit { transform: none; color: var(--muted, #9fb0c8); font-weight: 400; }

/* beat 7: the number, and what it is */
#callout { position: absolute; left: 64px; top: 352px; width: 640px; opacity: 0; }
#callout-big { font-family: var(--display, "Teko", sans-serif); font-weight: 600; font-size: 176px; line-height: 0.9; color: #ffb4a2; white-space: nowrap; }
#callout-text { margin-top: -6px; font-weight: 600; font-size: 41px; line-height: 1.12; text-wrap: balance; }
#leader { position: absolute; left: 0; top: 0; pointer-events: none; }
#tag {
  position: absolute; left: 0; top: 0; opacity: 0; font-weight: 700; font-size: 48px; line-height: 1.08; white-space: nowrap;
  padding: 8px 18px 10px; border-radius: 10px; background: rgba(15, 26, 46, 0.82); box-shadow: 0 0 0 2px rgba(233, 237, 243, 0.55);
}

/* the time strip: which cruise, out of all cruises */
#strip { position: absolute; left: 0; top: 836px; }
#strip text { font-family: var(--sans, "Source Sans 3", sans-serif); fill: var(--muted, #9fb0c8); }
#credit { position: absolute; right: 40px; top: 30px; text-align: right; font-size: 32px; line-height: 1.2; color: var(--muted, #9fb0c8); }
#credit b { color: var(--fg, #e9edf3); font-weight: 700; font-size: 40px; }

#loading { position: absolute; left: 64px; top: 500px; font-size: 40px; color: var(--muted, #9fb0c8); }

Session

code
cat(glue("rendered {format(Sys.time(), '%Y-%m-%d %H:%M %Z')} from release {VER}; calcofi4r {packageVersion('calcofi4r')}, duckdb {packageVersion('duckdb')}, R {getRversion()}"), "\n")
rendered 2026-11-13 09:20 CET from release v2026.11.12; calcofi4r 1.31.1, duckdb 2.0.0, R 4.6.1 
code
dbDisconnect(con, shutdown = T)

References

Argo. 2000. Argo float data and metadata from Global Data Assembly Centre (Argo GDAC). Dataset; SEANOE. https://doi.org/10.17882/42182.
Bograd, Steven J, David A Checkley, and Warren S Wooster. 2003. “CalCOFI: a half century of physical, chemical, and biological research in the California Current System.” Deep Sea Research Part II: Topical Studies in Oceanography 50 (14-16): 2349–53. https://doi.org/10.1016/s0967-0645(03)00122-x.
Boyer Montégut, Clément de, Gurvan Madec, Albert S. Fischer, Alban Lazar, and Daniele Iudicone. 2004. “Mixed layer depth over the global ocean: An examination of profile data and a profile-based climatology.” Journal of Geophysical Research: Oceans 109 (C12). https://doi.org/10.1029/2004jc002378.
Capotondi, Antonietta, Regina R. Rodrigues, Alex Sen Gupta, et al. 2024. “A global overview of marine heatwaves in a changing climate.” Communications Earth & Environment 5 (1): 701. https://doi.org/10.1038/s43247-024-01806-9.
Carter, Melissa L., Reinhard E. Flick, Eric Terrill, et al. 2022. Shore Stations Program Data Archive: Current and historical coastal ocean temperature and salinity measurements from California stations. Dataset; UC San Diego Library Digital Collections. https://doi.org/10.6075/J0S75GHD.
Chin, Toshio Michael, Jorge Vazquez-Cuervo, and Edward M. Armstrong. 2017. “A multi-scale high-resolution analysis of global sea surface temperature.” Remote Sensing of Environment 200: 154–69. https://doi.org/10.1016/j.rse.2017.07.029.
Coastal Data Information Program. 1975. Coastal Data Information Program, SIO/UCSD. Dataset; Coastal Data Information Program, Integrative Oceanography Division, operated by the Scripps Institution of Oceanography. https://doi.org/10.18437/C7WC72.
Di Lorenzo, Emanuele, Arthur J. Miller, Niklas Schneider, and James C. McWilliams. 2005. “The Warming of the California Current System: Dynamics and Ecosystem Implications.” Journal of Physical Oceanography 35 (3): 336–62. https://doi.org/10.1175/jpo-2690.1.
Durazo, R, and T. R Baumgartner. 2002. “Evolution of oceanographic conditions off Baja California: 1997–1999.” Progress in Oceanography 54 (1-4): 7–31. https://doi.org/10.1016/s0079-6611(02)00041-1.
Durazo, Reginaldo, Rubén Castro, Luis E Miranda, Francisco Delgadillo-Hinojosa, and Adán Mejía-Trejo. 2017. “Anomalous hydrographic conditions off the northwestern coast of the Baja California Peninsula during 2013–2016.” Ciencias Marinas 43 (2): 81–92. https://doi.org/10.7773/cm.v43i2.2754.
Fumo, James T., Melissa L. Carter, Reinhard E. Flick, Linda L. Rasmussen, Daniel L. Rudnick, and Sam F. Iacobellis. 2020. “Contextualizing Marine Heatwaves in the Southern California Bight Under Anthropogenic Climate Change.” Journal of Geophysical Research: Oceans 125 (5): e2019JC015674. https://doi.org/10.1029/2019jc015674.
Gentemann, Chelle L., Melanie R. Fewings, and Marisol García-Reyes. 2017. “Satellite sea surface temperatures along the West Coast of the United States during the 2014–2016 northeast Pacific marine heat wave.” Geophysical Research Letters 44 (1): 312–19. https://doi.org/10.1002/2016gl071039.
Hayward, Thomas L., Tim R. Baumgartner, David M. Checkley, et al. 1999. “The State of the California Current in 1998–1999: Transition to Cool-Water Conditions.” California Cooperative Oceanic Fisheries Investigations Reports 40: 29–62. https://calcofi.org/downloads/publications/calcofireports/v40/Vol_40_Status_CC_Hayward_etal.pdf.
Hobday, Alistair J., Lisa V. Alexander, Sarah E. Perkins, et al. 2016. “A hierarchical approach to defining marine heatwaves.” Progress in Oceanography 141: 227–38. https://doi.org/10.1016/j.pocean.2015.12.014.
Hobday, Alistair, Eric Oliver, Alex Sen Gupta, et al. 2018. “Categorizing and Naming Marine Heatwaves.” Oceanography 31 (2): 162–73. https://doi.org/10.5670/oceanog.2018.205.
Hu, Shijian, Shihan Li, Ying Zhang, et al. 2021. “Observed strong subsurface marine heatwaves in the tropical western Pacific Ocean.” Environmental Research Letters 16 (10): 104024. https://doi.org/10.1088/1748-9326/ac26f2.
Huang, Boyin, Chunying Liu, Viva Banzon, et al. 2021. “Improvements of the Daily Optimum Interpolation Sea Surface Temperature (DOISST) Version 2.1.” Journal of Climate 34 (8): 2923–39. https://doi.org/10.1175/jcli-d-20-0166.1.
Instrument Development Group, Scripps Institution of Oceanography. 2026. Observing El Niño with Gliders. SprayData, 2026-11-13. https://spraydata.ucsd.edu/products/el-nino/.
Jacox, Michael G., Elliott L. Hazen, Katherine D. Zaba, et al. 2016. “Impacts of the 2015–2016 El Niño on the California Current System: Early assessment and comparison to past events.” Geophysical Research Letters 43 (13): 7072–80. https://doi.org/10.1002/2016gl069716.
Jacox, Michael G., Daniel L. Rudnick, and Christopher A. Edwards. 2017. “Dominant physical mechanisms driving ecosystem response to ENSO in the California Current System.” US CLIVAR Variations 15 (1): 22–26. https://swfsc-publications.fisheries.noaa.gov/publications/CR/2017/2017Jacox.pdf.
Köhn, Eike E., Meike Vogt, Matthias Münnich, and Nicolas Gruber. 2024. “On the Vertical Structure and Propagation of Marine Heatwaves in the Eastern Pacific.” Journal of Geophysical Research: Oceans 129 (1): e2023JC020063. https://doi.org/10.1029/2023jc020063.
L’Heureux, Michelle L., Michael K. Tippett, Matthew C. Wheeler, et al. 2024. “A Relative Sea Surface Temperature Index for Classifying ENSO Events in a Changing Climate.” Journal of Climate 37 (4): 1197–211. https://doi.org/10.1175/jcli-d-23-0406.1.
Leising, Andrew W., Isaac D. Schroeder, Steven J. Bograd, et al. 2015. “State of the California Current 2014–15: Impacts of the Warm-Water ‘Blob’.” California Cooperative Oceanic Fisheries Investigations Reports 56: 31–68. https://calcofi.org/downloads/publications/calcofireports/v56/Vol56-SOTCC.web.31-69.pdf.
Levitus, S. 1982. Climatological Atlas of the World Ocean. NOAA Professional Paper No. 13. U.S. Government Printing Office.
Lynn, Ronald J., Tim Baumgartner, Joaquin Garcia, et al. 1998. “The State of the California Current, 1997–1998: Transition to El Niño Conditions.” California Cooperative Oceanic Fisheries Investigations Reports 39: 25–49. https://calcofi.org/downloads/publications/calcofireports/v39/Vol_39_Status_CC_Lynn_etal.pdf.
McClatchie, Sam. 2014. Regional Fisheries Oceanography of the California Current System. Springer Netherlands. https://doi.org/10.1007/978-94-007-7223-6.
McClatchie, Sam, Ralf Goericke, Andrew Leising, et al. 2016. “State of the California Current 2015–16: Comparisons with the 1997–98 El Niño.” California Cooperative Oceanic Fisheries Investigations Reports 57: 5–61. https://calcofi.org/downloads/publications/calcofireports/v57/Vol57-SOTCC_pages.5-61.pdf.
McLain, Douglas R., Russell E. Brainard, and Jerrold G. Norton. 1985. “Anomalous warm events in eastern boundary current systems.” California Cooperative Oceanic Fisheries Investigations Reports 26: 51–64. https://calcofi.org/downloads/publications/calcofireports/v26/Vol_26_McLain_etal.pdf.
Monterey Bay Aquarium Research Institute. 2026. MBARI researchers observe the arrival of El Niño in Monterey Bay. MBARI news, 2026-10-29. https://www.mbari.org/news/mbari-researchers-observe-the-arrival-of-el-nino-in-monterey-bay/.
NOAA Climate Prediction Center. 2026. El Niño/Southern Oscillation (ENSO) Diagnostic Discussion, 12 November 2026. Climate Prediction Center/NCEP/NWS, 2026-11-12. https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/enso_disc_nov2026/ensodisc.shtml.
NOAA Integrated Ecosystem Assessment. 2026. The California Current Marine Heatwave Tracker - Blobtracker (last updated 30 October 2026). NOAA Fisheries, Southwest and Northwest Fisheries Science Centers, 2026-10-30. https://www.integratedecosystemassessment.noaa.gov/regions/california-current/california-current-marine-heatwave-tracker-blobtracker.
Oldenborgh, Geert Jan van, Harry Hendon, Timothy Stockdale, et al. 2021. “Defining El Niño indices in a warming climate.” Environmental Research Letters 16 (4): 044003. https://doi.org/10.1088/1748-9326/abe9ed.
Rasmussen, Linda L., Melissa L. Carter, Reinhard E. Flick, et al. 2020. “A Century of Southern California Coastal Ocean Temperature Measurements.” Journal of Geophysical Research: Oceans 125 (5): e2019JC015673. https://doi.org/10.1029/2019jc015673.
Reed, Daniel, Libe Washburn, Andrew Rassweiler, Robert Miller, Tom Bell, and Shannon Harrer. 2016. “Extreme warming challenges sentinel status of kelp forests as indicators of climate change.” Nature Communications 7 (1): 13757. https://doi.org/10.1038/ncomms13757.
Reid, Joseph L., Jr. 1960. “Oceanography of the northeastern Pacific Ocean during the last ten years.” California Cooperative Oceanic Fisheries Investigations Reports 7: 77–90. https://calcofi.org/downloads/publications/calcofireports/v07/Vol_07_Reid.pdf.
Ren, Alice S., and Daniel L. Rudnick. 2021. “Temperature and salinity extremes from 2014-2019 in the California Current System and its source waters.” Communications Earth & Environment 2 (1): 62. https://doi.org/10.1038/s43247-021-00131-9.
Reynolds, Richard W., Thomas M. Smith, Chunying Liu, Dudley B. Chelton, Kenneth S. Casey, and Michael G. Schlax. 2007. “Daily High-Resolution-Blended Analyses for Sea Surface Temperature.” Journal of Climate 20 (22): 5473–96. https://doi.org/10.1175/2007jcli1824.1.
Rudnick, Daniel, Katherine D. Zaba, Robert E. Todd, and Russ E. Davis. 2016. A climatology using data from the California Underwater Glider Network. Instrument Development Group, Scripps Institution of Oceanography. https://doi.org/10.21238/S8SPRAY7292.
Shore Stations Program, Scripps Institution of Oceanography. 2026. Scripps Pier SST in 2026 (plot of preliminary daily data; latest data point 12 November 2026). Shore Stations Program, 2026-11-12. https://shorestations.ucsd.edu/plots/SST_This_Year.png.
Simpson, James J. 1983. “Large-scale thermal anomalies in the California Current during the 1982-1983 El Niño.” Geophysical Research Letters 10 (10): 937–40. https://doi.org/10.1029/gl010i010p00937.
Simpson, James J. 1984. “El Nino-induced onshore transport in the California Current during 1982-1983.” Geophysical Research Letters 11 (3): 233–36. https://doi.org/10.1029/gl011i003p00233.
Smale, Dan A., Thomas Wernberg, Eric C. J. Oliver, et al. 2019. “Marine heatwaves threaten global biodiversity and the provision of ecosystem services.” Nature Climate Change 9 (4): 306–12. https://doi.org/10.1038/s41558-019-0412-1.
Thyng, Kristen, Chad Greene, Robert Hetland, Heather Zimmerle, and Steven DiMarco. 2016. “True Colors of Oceanography: Guidelines for Effective and Accurate Colormap Selection.” Oceanography 29 (3): 9–13. https://doi.org/10.5670/oceanog.2016.66.
Todd, Robert E., Daniel L. Rudnick, Russ E. Davis, and Mark D. Ohman. 2011. “Underwater gliders reveal rapid arrival of El Niño effects off California’s coast.” Geophysical Research Letters 38 (3). https://doi.org/10.1029/2010gl046376.
Wong, Annie P. S., Susan E. Wijffels, Stephen C. Riser, et al. 2020. “Argo Data 1999–2019: Two Million Temperature-Salinity Profiles and Subsurface Velocity Observations From a Global Array of Profiling Floats.” Frontiers in Marine Science 7: 700. https://doi.org/10.3389/fmars.2020.00700.