@@ -208,6 +208,9 @@ All observables are stored in a single `BDIO` record of type `BDIO_BIN_GENERIC`.
- delta (`Vector{Float64}`): The fluctuations for each ensemble.
- name (NULL terminated `String`): A description of the observable.
-`ID` tags: A list of `neid` tuples `(Int32, String)` that maps each numeric `ID` to an ensemble tag. All strings are NULL terminated.
- Replica names: A list of `neid` tuples `(Int32, Vector{String})`
that maps each numeric `ID` to a vector of replica names. All
strings are NULL terminated.
!!! alert
Obviously this weird format is what it is for some legacy reasons, but it is strongly encouraged that new implementations respect this standard with all its weirdness.
@@ -237,6 +237,51 @@ function drho(a::uwreal, mcid::Int64)
end
end
"""
mchist(a::uwreal, mcid)
Returns the fluctuations of the `uwreal` variable `a` on ensemble `mcid`. It is assumed that `uwerr` has been run on the variable and that `mcid` contributes to the observable `a`. Otherwise an error message is printed.
```@example
using ADerrors # hide
# Generate some correlated data
eta = randn(1000)
x = Vector{Float64}(undef, 1000)
x[1] = 0.0
for i in 2:1000
x[i] = x[i-1] + eta[i]
if abs(x[i]) > 1.0
x[i] = x[i-1]
end
end
a = uwreal(x.^2, "Somesimpleensemble")
uwerr(a)
v = mchist(a, "Somesimpleensemble")
for i in 1:length(v)
println(i, "", v[i])
end
```
"""
function mchist(a::uwreal,mcid::Int64,ws::wspace)
idx=find_mcid(a,mcid)
if(idx==nothing)
error("No error available... maybe run uwerr")
else
nd=ws.fluc[ws.map_ids[a.ids[idx]]].nd
dt=zeros(Float64,nd)
forjin1:length(a.prop)
if(a.prop[j]&&(ws.map_nob[j]==a.ids[idx]))
dt.=dt.+a.der[j].*ws.fluc[j].delta
end
end
returndt
end
end
mchist(a::uwreal,mcid::Int64)=mchist(a,mcid,wsg)
function read_bdio(fb,ws::wspace,mapids::Dict{Int64,Int64})
dfoo=zeros(Float64,1)
...
...
@@ -309,6 +354,28 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
Write out a detailed information on the error of `a`.
## Arguments
Optionally one can pass as a keyword argument (`io`) the `IO` stream to write to.
If a the ergument `ensemble` is present, this routine writes information of the fluctuations of the observable in this ensemble. Optionally one can pass as a keyword argument (`io`) the `IO` stream to write to.
## Example
```@example
using ADerrors # hide
a = uwreal(rand(2000), "EnsembleA12")
a = uwreal(rand(2000), "EnsembleA12", ["A12REP0", "A12REP1", "A12REP2"], [1000, 500, 500])
b = uwreal([1.2, 0.023], "EnsembleXYZ")
c = uwreal([5.2, 0.03], "EnsembleRRR")
d = a + b - c
uwerr(d)
details(d)
for en in ensembles(d)
details(d, en)
end
```
"""
function details(a::uwreal,ws::wspace,io::IO=stdout)