API Documentation

CarboKitten.run_modelFunction
run_model(::Type{Model{M}}, input::AbstractInput, filename::AbstractString) where M

Run a model and write output to HDF5. Here M should be a model, i.e. a module with initial_state, step! and write_header defined. Example:

run_model(Model{ALCAP}, ALCAP.Example.INPUT, "example.h5")
source
CarboKitten.BoxType
Box{BoundaryType}(grid_size, phys_scale)

Stores the spatial properties of the simulation grid, where grid_size is a tuple of two integers and phys_scale is a Quantity of dimension Length.

source
CarboKitten.box_axesFunction
box_axes(box::Box)

Return the x and y components of the box grid in meters. The grid starts at 0.0u"m" and runs to (box.grid_size .- 1) .* box.phys_scale.

source
CarboKitten.TimePropertiesType
TimeProperties(t0, Δt, steps, write_interval)

Stores properties of the time integration. Here, t0 and Δt should be a Quantity, steps is the number of integration steps, and write_interval the number of steps between writing output.

source

Components

CarboKitten.Components.ActiveLayer.disintegrationMethod
disintegration(input) -> f!

Prepares the disintegration step. Returns a function f!(state::State). The returned function modifies the state, popping sediment from the sediment_buffer and returns an array of Amount.

source

Utility

CarboKitten.Utility.enumerate_seqMethod
enumerate_seq(s)

Enumerates an iterator of sequences, such that the following equivalence holds:

enumerate(flatten(s)) == flatten(enumerate_seq(s))
source
CarboKitten.Skeleton.skeletonMethod
skeleton(bitmap::AbstractMatrix{Bool})

Computes the skeleton of a bitmap, i.e. reduces features with some thickness to a set of line segments. This function is designed with stratigraphic application in mind: we scan each row in the bitmap for connected regions, then link neighbouring regions when they overlap. The result is a graph that represents hiatus in the sediment accumulation.

Returns a tuple of vertices and edges, where vertices is a vector of 2-tuples and edges is a nx2 matrix of indices into the vertices.

source

Export

CarboKitten.Export.age_depth_modelMethod
age_depth_model(sediment_accumulation_curve::Vector)
age_depth_model(sediment_accumulation_curve::DataFrame)

Compute the ADM from the SAC. Implemented as:

reverse ∘ accumulate(min) ∘ reverse

The DataFrame version selects SAC columns, transformed into ADM.

source
CarboKitten.Export.extract_sacMethod
extract_sac(header::Header, data::Data, grid_locations::Vector{NTuple{2,Int}})

Extract Sediment Accumumlation Curve (SAC) from the data. The SAC is directly copied from data.sediment_elevation. Returns a DataFrame with time and sac<n> columns where <n> is in the range 1:length(grid_locations).

source
CarboKitten.Export.extract_scMethod
extract_sc(header::Header, data::Data, grid_locations::Vector{NTuple{2,Int}})

Extract Stratigraphic Column (SC) from the data. Returns a DataFrame with time and sc<n> columns where <n> is in the range 1:length(grid_locations).

source
CarboKitten.Export.stratigraphic_columnMethod
stratigraphic_column(header::Header, data::Data, loc::NTuple{2,Int}, facies::Int)

Compute the Stratigraphic Column for a given grid position loc and facies index. Returns an Array{Quantity, 2} where the Quantity is in units of meters.

source
CarboKitten.Export.write_unitful_csvMethod
write_unitful_csv(io::IO, df::DataFrame)

Write a CSV from a DataFrame with Unitful units. The units will be represented in the CSV header, and stripped from the individual values.

source
Unitful.ustripMethod
ustrip(df::DataFrame)

Strip units from a DataFrame. Returns a new DataFrame.

source

Submodules

CarboKitten.Denudation.Abstract.denudationMethod
denudation(box, param, state)

FIXME Computes the denudation for a single time-step, given denudation parameters param and a simulation state state. param should have a DenudationType type and state should contain the height property and sealevel.

source
CarboKitten.Denudation.Abstract.denudationMethod
denudation(box::Box, param::DenudationType, water_depth, slope, facies)

Computes the amount of denudation. This function is called on a pixel by pixel basis, so all arguments can be assumed to be scalar. The param argument should be of a subtype of DenudationType containing all the input parameters for this specific denudation model.

source