API
Modules
Types and constants
Functions and macros
Base.getindex
Base.getindex
LegendDataTypes.chname2int
LegendDataTypes.decode_data
LegendDataTypes.fast_flatten
LegendDataTypes.filter_raw_data_by_energy
LegendDataTypes.flatten_by_key
LegendDataTypes.get_all_channels
LegendDataTypes.get_daqenergy
LegendDataTypes.get_raw_ch_data
LegendDataTypes.getunits
LegendDataTypes.int2chname
LegendDataTypes.map_chunked
LegendDataTypes.read_from_properties
LegendDataTypes.readdata
LegendDataTypes.setunits!
LegendDataTypes.similar_table
LegendDataTypes.to_properties
LegendDataTypes.writedata
Documentation
LegendDataTypes.RadwareSigcompress
— TypeRadwareSigcompress <: AbstractArrayCodec
LegendDataTypes.TableLike
— TypeTableLike = AbstractVector{<:NamedTuple}
The type must also support the Tables.jl interface.
Examples are TypedTables.Table
and StructArrays.StructArray
Base.getindex
— Methodgetindex(input::AbstractLegendInput, key::AbstractString)
getindex(input::AbstractLegendInput, key::AbstractString, idxs::AbstractVector)
Get object at key
from input.
Base.getindex
— Methodsetindex!(output::AbstractLegendOutput, key::AbstractString)
getindex(output::AbstractLegendOutput, key::AbstractString, idxs::AbstractVector)
Get object at key
from input.
LegendDataTypes.chname2int
— Methodchname2int(channel_string::AbstractString)::Integer
Convert a channel name string, as used in LEGEND data files to an integer channel number.
LegendDataTypes.decode_data
— Functiondecode_data(data)
Decode any encoded arrays present in (possibly nested) data.
LegendDataTypes.fast_flatten
— Functionfast_flatten(vector_of_arrays)
Flattens a vector of arrays into a single array, by concatenating the inner arrays along the last dimension.
LegendDataTypes.filter_raw_data_by_energy
— Methodfilter_raw_data_by_energy(
raw_data::TableLike,
calib_func::Function,
energy_windows::AbstractDict{Symbol,<:AbstractInterval{<:Number}}
)::IDDict{Symbol,<:Any}
Filter the table raw data
, selecing only events in the energy intervals in values(energy_windows)
.
The selection is based on DAQ energy reconstruction and the energy calibration function calib_func
.
Returns a dicts of raw data tables with the same keys as energy_windows
.
LegendDataTypes.flatten_by_key
— Methodflatten_by_key(data::AbstractVector{<:IdDict{<:Any, <:AbstractVector}})::IdDict
Flattens a vector of IdDicts into a single IdDict, by concatenating the entries for each key separately.
LegendDataTypes.get_all_channels
— Methodget_all_channels(ds::AbstractDict{<:AbstractString,<:Any})::AbstractVector{<:Integer}
Get the channel numbers for all channels in datastore
.
Channels are identified as keys starting with "ch...", according to LEGEND convention. datastore
will typically be on-disk, e.g. a LegendHDF5IO.LegendHDFLHDataStore
.
Channel named are mapped to integer channel numbers via chname2int
.
LegendDataTypes.get_daqenergy
— Methodget_daqenergy(datastore::AbstractDict{<:AbstractString,<:Any}, ch::Integer)::AbstractVector{<:Integer}
Get the daq energy reconstruction contained in the raw data of channel ch
in datastore
.
datastore
will typically be on-disk, e.g. a LegendHDF5IO.LegendHDFLHDataStore
. Channel numbers are mapped to channel names via int2chname
.
LegendDataTypes.get_raw_ch_data
— Methodget_raw_ch_data(ds::AbstractDict{<:AbstractString,<:Any}, ch::Integer)::TableLike
Get the raw data table for channel ch
in datastore
.
datastore
will typically be on-disk, e.g. a LegendHDF5IO.LegendHDFLHDataStore
. Channel numbers are mapped to channel names via int2chname
.
LegendDataTypes.getunits
— Functiongetunits(x)
Get the units of x, falls back to Unitful.unit(x)
if no specialized method is defined for the type of x
.
LEGEND I/O packages shoud add methods for the I/O-object types they handle.
LegendDataTypes.int2chname
— Methodint2chname(channel_number::Integer)::AbstractString
Convert an integer channel number to a channel name string as used in LEGEND data files.
LegendDataTypes.map_chunked
— Methodmap_chunked(f, table, chunk_size::Integer)
Maps a function f
over a table in chunks of size chunk_size
.
Calls getindex
with contiguous index ranges, and so is also efficient for disk-based arrays and similar arrays with slow serial indexing but fast block-wise indexing.
LegendDataTypes.read_from_properties
— Functionread_from_properties(read_property::Function, src::Any, ::Type{T}) where {T<:AbstractArrayCodec}
Create a array codec of type T
from properties of src
, using the src
-specific function read_property(src, name::Symbol, default_value)
to read each property required.
Returns an value of type T
.
LegendDataTypes.readdata
— Functionreaddata(input, SomeDataType::Type)
Read a value of type SomeDataType
from input
.
LegendDataTypes.setunits!
— Functionsetunits!(x)
Set the units of x.
LEGEND I/O packages will need to add methods for the I/O-object types they handle.
LegendDataTypes.similar_table
— FunctionLegendDataTypes.similar_table(orig_tbl::AbstractVector{<:NamedTuple{names}}, cols::NamedTuple{names})
Return a table similar to orig_tbl
from columns cols
.
LegendDataTypes.to_properties
— Functionwrite_to_properties!(write_property!::Function, dest::Any, codec::AbstractArrayCodec)
Write all information required to re-create codec
to dest
using thes dest
-specific function write_property!(dest, name::Symbol, x)
.
Typically returns nothing
.
LegendDataTypes.writedata
— Functionreaddata(input, x::SomeDataType)
Write a value x
to output
.