API
ReefModEngine.DataCube Method
DataCube(data::AbstractArray; kwargs...)::YAXArray
Constructor for YAXArray. When used with axes_names
, the axes labels will be UnitRanges from 1 up to that axis length.
Arguments
data
: Array of data to be used when building the YAXArrayaxes_names
:
ReefModEngine.append_scenarios! Method
append_scenarios!(rs::ResultStore, reps::Int)::Nothing
Add rows to scenario dataframe in result store.
ReefModEngine.area_needed Method
area_needed(n_corals::Int64, density::Union{Float64,Vector{Float64}})::Union{Vector{Float64},Float64}
Determine area (in km²) needed to deploy the given the number of corals at the specified density.
ReefModEngine.concat_results! Method
concat_results!(rs::ResultStore, start_year::Int64, end_year::Int64, reps::Int64)::Nothing
Append results for all runs/replicates.
Arguments
rs
: Result store to save data tostart_year
: Collect data from this yearend_year
: Collect data to this yearreps
: Total number of expected replicates
ReefModEngine.create_dataset Method
create_dataset(start_year::Int, end_year::Int, n_reefs::Int, reps::Int)::Dataset
Preallocate and create dataset for result variables. Only constructed when the first results are collected.
ReefModEngine.deployment_area Method
deployment_area(n_corals::Int64, max_n_corals::Int64, density::Union{Float64, Vector{Float64}}, target_areas::Vector{Float64})::Union{Tuple{Float64,Float64},Tuple{Float64,Vector{Float64}}}
Determine deployment area for the expected number of corals to be deployed.
Arguments
n_corals
: Number of corals,max_n_corals
: Expected maximum deployment effort (total number of corals in intervention set)density
: Stocking density per m². In RME versions higher than v1.0.28 density needs to be a vector with each element representing the density per functional grouptarget_areas
: Available area at target location(s)
Returns
Tuple
Percent area of deployment
modified stocking density [currently no modifications are made]
ReefModEngine.deployment_area Method
deployment_area(max_n_corals::Int64, target_areas::Vector{Float64})::Union{Tuple{Float64,Float64}, Tuple{Float64,Vector{Float64}}}
Determine deployment area for given number of corals and target area, calculating the appropriate deployment density to maintain the specified grid size.
ReefModEngine.init_rme Method
init_rme(rme_path::String)::Nothing
Initialize ReefMod Engine for use.
ReefModEngine.match_id Method
match_id(id::String)::Int64
match_ids(ids::Vector{String})::Vector{Int64}
Find matching index position for the given ID(s) according to ReefMod Engine's reef list.
Note
ReefMod Engine's reef list is in all upper case. The provided IDs are converted to upper case to ensure a match.
Examples
julia> reef_ids()
# 3806-element Vector{String}:
# "10-330"
# "10-331"
# ⋮
# "23-048"
# "23-049"
julia> match_id("10-330")
# 1
julia> match_id("23-049")
# 3806
julia> match_ids(["23-048", "10-331"])
# 3805
# 2
ReefModEngine.preallocate_concat! Method
preallocate_concat(rs, start_year, end_year, reps::Int64)::Nothing
Allocate additional memory before adding an additional result set. Result sets must have the same time frame.
ReefModEngine.reef_areas Method
reef_areas(id_list)
Retrieve reef areas in km² for specified locations.
ReefModEngine.reef_ids Method
reef_ids()::Vector{String}
Get list of reef ids in the order expected by ReefMod Engine.
ReefModEngine.reset_rme Method
reset_rme()
Reset ReefModEngine, clearing any and all interventions and reef sets.
ReefModEngine.rme_version_info Method
rme_version_info()::@NamedTuple{major::Int64, minor::Int64, patch::Int64}
Get RME version
ReefModEngine.save_result_store Method
save_result_store(dir_name::String, result_store::ResultStore)::Nothing
Save results to a netcdf file and a dataframe containing the scenario runs. Saved to the given directory. The directory is created if it does not exit.
ReefModEngine.set_enrichment_deployment! Method
set_enrichment_deployment!(name::String, reefset::String, n_larvae::Int64, max_effort::Int64, first_year::Int64, last_year::Int64, year_step::Int64, area_km2::Vector{Float64}, density::Float64)::Nothing
Set deployment for multiple years at a given frequency.
ReefModEngine.set_enrichment_deployment! Method
set_enrichment_deployment!(name::String, reefset::String, n_larvae::Int64, year::Int64, area_km2::Vector{Float64}, density::Float64)::Nothing
As set_seeding_deployment()
but for larvae enrichment (also known as assisted migration). Set deployment for a single target year.
ReefModEngine.set_option Method
set_option(opt::String, val::Float64)
set_option(opt::String, val::Int)
set_option(opt::String, val::String)
Set RME option.
See RME documentation for full list of available options.
ReefModEngine.set_outplant_deployment! Method
set_outplant_deployment!(name::String, reefset::String, n_corals::Int64, max_effort::Int64, first_year::Int64, last_year::Int64, year_step::Int64, area_km2::Vector{Float64}, density::Union{Vector{Float64}, Float})::Nothing
Set outplanting deployments across a range of years.
Arguments
name
: Name to assign intervention eventreefset
: Name of pre-defined list of reefs to intervene onn_corals
: Number of corals to outplant for a given yearmax_effort
: Total number of corals to outplantfirst_year
: First year to start interventionslast_year
: Final year of interventionsyear_step
: Frequency of intervention (1 = every year, 2 = every second year, etc)area_km2
: Intervention area [km²]density
: Stocking density of intervention [corals / m²]
ReefModEngine.set_outplant_deployment! Method
set_outplant_deployment!(name::String, reefset::String, max_effort::Int64, first_year::Int64, last_year::Int64, year_step::Int64, area_km2::Vector{Float64})::Nothing
Set outplanting deployments across a range of years, automatically determining the coral deployment density to maintain the set grid size.
ReefModEngine.set_outplant_deployment! Method
set_outplant_deployment!(name::String, reefset::String, n_corals::Int64, year::Int64, area_km2::Vector{Float64}, density::Union{Float64, Vector{Float64}})::Nothing
Set outplanting deployments for a single year.
Arguments
name
: Name to assign intervention eventreefset
: Name of pre-defined list of reefs to intervene onn_corals
: Number of corals to outplantyear
: Year to intervenearea_km2
: Area to intervene [km²]density
: Stocking density of intervention [corals / m²]
ReefModEngine.set_outplant_deployment! Method
set_outplant_deployment!(name::String, reefset::String, n_corals::Int64, year::Int64, area_km2::Vector{Float64})::Nothing
Set outplanting deployments for a single year, automatically determining the coral deployment density to maintain the set grid size.
Arguments
name
: Name to assign intervention eventreefset
: Name of pre-defined list of reefs to intervene onn_corals
: Number of corals to outplantyear
: Year to intervenearea_km2
: Area to intervene [km²]
ReefModEngine.@getRME Macro
Only for use when RME functions return non-error numeric results.
Examples
count_per_m2::Float64 = @getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble