Skip to contents

[Deprecated]

This function is deprecated because the CalCOFI API is being phased out in favor of direct DuckDB database access. Query bottle measurement data with cc_read_measurements() and cc_read_casts(), then use pts_to_rast_idw() for spatial interpolation.

Usage

get_raster(
  variable = "ctdcast_bottle.t_deg_c",
  cruise_id = "1949-03-01-C-31CR",
  depth_m_min = NULL,
  depth_m_max = NULL,
  out_tif
)

Arguments

variable

Variable to fetch from the CalCOFI API. One of table_field values from get_variables(). Default is "ctdcast_bottle.t_deg_c".

cruise_id

Cruise identifier. One of cruise_id values from get_cruises(). Default is the first cruise "1949-03-01-C-31CR".

depth_m_min

Minimum depth range in meters, e.g. 0. Default is NULL, as in not filtered.

depth_m_max

Maximum depth range in meters, e.g. 5351. Default is NULL, as in not filtered.

out_tif

Output path to write raster (*.tif)

Value

path to output raster in GeoTIFF format (*.tif)

Examples

if (FALSE) { # \dontrun{
# deprecated - use DuckDB queries + pts_to_rast_idw() instead:
con <- cc_get_db()
d <- DBI::dbGetQuery(con, "
  SELECT s.longitude, s.latitude, o.measurement_value
  FROM obs_env o
  JOIN sample s USING (sample_key)
  WHERE o.dataset_key = 'calcofi_bottle' AND o.measurement_type = 'temperature'
    AND o.depth_min_m <= 10")
} # }