Writing ALPHAdobs records is usually done with the ALPHAdobs_write method:

ALPHAio.ALPHAdobs_writeFunction
    function ALPHAdobs_write(fb, obs...; extra=nothing)

Write the observables obs in the file fb, together with a parameter record. If obs are uwreal, the record parameter is a scalar one. If obs is Aray{uwreal} the parameter record is an array record. If obs are a Dict{String, uwreal} or Dict{String, Array{uwreal}} the parameter record is of type Dict. Note that all observables have to be of the same type and size.

Additional information in the parameter record can be added by passing an arbitrary Dict{String, Any} that have to be parsable by TOML. All dictionary entries that do not have a specific TOML header are written under [extra]. See the TOML.jl documentation for more information.

using ADerrors # hide
a = uwreal(1.0 .+ randn(1000), "Random ensemble")  
b = uwreal([1.3, 0.6], "Simple var with error")   
c = uwreal([3.2, 0.4], "Another var with error")  
e = uwreal(2.0 .+ randn(1000), "Another ensemble")

# Write as observables
ALPHAdobs_write(fb, a, b, c, e)

# Write as a vector of observables
ALPHAdobs_write(fb, [a, b, c, e])

# Write as an array of observables
d = Dict{String, Any}("Exact" => [1.0, 1.3, 3.2, 2.0])
ALPHAdobs_write(fb, [a b
                    c, e], d)

# Write as a dictionary
d = Dict{String, Any}("Exact" => [1.0, 1.3, 3.2, 2.0],
                      "Source" => "Package documentation")
data = Dict{String, uwreal}("random noise" => a,
                            "Variable with error 1" => b,
                            "Variable with error 2" => c,
                            "more noise" => e)
ALPHAdobs_write(fb, data, d)

# Write as a dictionary with target vectors
d = Dict{String, Any}("Exact" => [1.0, 1.3, 3.2, 2.0],
                      "Source" => "Package documentation")
data = Dict{String, uwreal}("random noise" => [a,e], 
                            "Variables with error" => [b,c])
ALPHAdobs_write(fb, data, d)
source

These other methods provide finer control.

ALPHAio.ALPHAdobs_vector_parametersFunction
    function ALPHAdobs_vector_parameters(fb, nobs, nlen; extra=nothing)

Creates a new ALPHA dobs parameter record for nobs vector quantities of length nlen.

source
ALPHAio.ALPHAdobs_array_parametersFunction
    function ALPHAdobs_array_parameters(fb, nobs, size; extra=nothing)

Creates a new ALPHA dobs parameter record for nobs array quantities of size size.

source
ALPHAio.ALPHAdobs_addFunction
functiona ALPHAdobs_add(fb, vob::Union{uwreal,Array{uwreal}})

Given a vector/scalar vob of ADerrors uwreal, this routine write the observable in the fb handler.

source
ALPHAio.ALPHAdobs_closeFunction
function ALPHAdobs_close(fb, cmmt="# Computed with ADerrors.jl")

Close the handler fb with (optional) comment cmmt.

source