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_fieldvalues fromget_variables(). Default is"ctdcast_bottle.t_deg_c".- cruise_id
Cruise identifier. One of
cruise_idvalues fromget_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)
Examples
if (FALSE) { # \dontrun{
# deprecated - use DuckDB queries + pts_to_rast_idw() instead:
con <- cc_get_db()
d <- DBI::dbGetQuery(con, "
SELECT c.lon_dec, c.lat_dec, bm.measurement_value
FROM bottle_measurement bm
JOIN bottle b ON bm.bottle_id = b.bottle_id
JOIN casts c ON b.cast_id = c.cast_id
WHERE bm.measurement_type = 'temperature'")
} # }