diff --git a/test/factories/coral_cover.jl b/test/factories/coral_cover.jl index e6ae004b6..4445578b2 100644 --- a/test/factories/coral_cover.jl +++ b/test/factories/coral_cover.jl @@ -1,7 +1,25 @@ using ADRIA: YAXArray, DataCube, ZeroDataCube """Raw model coral cover results, proportional to k-area.""" -function coral_cover( +function coral_cover(; + n_timesteps::Int64=10, + n_group_sizes::Int64=35, + n_locations::Int64=5, + n_scenarios::Int64=32 +)::YAXArray{Float64,4} + coral_cover = Factories.full_coral_cover(; + n_timesteps, n_group_sizes, n_locations, n_scenarios + ) + + location_weights::Array{Float64,4} = repeat( + rand(n_timesteps, n_locations, n_scenarios), 1, 1, 1, n_group_sizes + ) + + return coral_cover .* permutedims(location_weights, [1, 4, 2, 3]) +end + +"""Cover for each location at each timestep and scenario sums up to 1.""" +function full_coral_cover( ; n_timesteps::Int64=10, n_group_sizes::Int64=35, @@ -27,24 +45,6 @@ function coral_cover( return DataCube(cover_data, (:timesteps, :species, :locations, :scenarios)) end -"""Cover for each location at each timestep and scenario sums up to 1.""" -function full_coral_cover(; - n_timesteps::Int64=10, - n_group_sizes::Int64=35, - n_locations::Int64=5, - n_scenarios::Int64=32 -)::YAXArray{Float64,4} - coral_cover = Factories.coral_cover(; - n_timesteps, n_group_sizes, n_locations, n_scenarios - ) - - location_weights::Array{Float64,4} = repeat( - rand(n_timesteps, n_locations, n_scenarios), 1, 1, 1, n_group_sizes - ) - - return coral_cover .* permutedims(location_weights, [1, 4, 2, 3]) -end - """Cover for all timesteps, locations and scenarios is zero""" function zero_coral_cover( ;