API
Modules
Types and constants
Functions and macros
Base.getindexBase.getindexLegendDataTypes.chname2intLegendDataTypes.decode_dataLegendDataTypes.fast_flattenLegendDataTypes.filter_raw_data_by_energyLegendDataTypes.flatten_by_keyLegendDataTypes.get_all_channelsLegendDataTypes.get_daqenergyLegendDataTypes.get_raw_ch_dataLegendDataTypes.getunitsLegendDataTypes.int2chnameLegendDataTypes.map_chunkedLegendDataTypes.read_from_propertiesLegendDataTypes.readdataLegendDataTypes.setunits!LegendDataTypes.similar_tableLegendDataTypes.to_propertiesLegendDataTypes.writedata
Documentation
LegendDataTypes.RadwareSigcompress — Type
RadwareSigcompress <: AbstractArrayCodecLegendDataTypes.TableLike — Type
TableLike = AbstractVector{<:NamedTuple}The type must also support the Tables.jl interface.
Examples are TypedTables.Table and StructArrays.StructArray
Base.getindex — Method
getindex(input::AbstractLegendInput, key::AbstractString)
getindex(input::AbstractLegendInput, key::AbstractString, idxs::AbstractVector)Get object at key from input.
Base.getindex — Method
setindex!(output::AbstractLegendOutput, key::AbstractString)
getindex(output::AbstractLegendOutput, key::AbstractString, idxs::AbstractVector)Get object at key from input.
LegendDataTypes.chname2int — Method
chname2int(channel_string::AbstractString)::IntegerConvert a channel name string, as used in LEGEND data files to an integer channel number.
LegendDataTypes.decode_data — Function
decode_data(data)Decode any encoded arrays present in (possibly nested) data.
LegendDataTypes.fast_flatten — Function
fast_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 — Method
filter_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 — Method
flatten_by_key(data::AbstractVector{<:IdDict{<:Any, <:AbstractVector}})::IdDictFlattens a vector of IdDicts into a single IdDict, by concatenating the entries for each key separately.
LegendDataTypes.get_all_channels — Method
get_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 — Method
get_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 — Method
get_raw_ch_data(ds::AbstractDict{<:AbstractString,<:Any}, ch::Integer)::TableLikeGet 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 — Function
getunits(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 — Method
int2chname(channel_number::Integer)::AbstractStringConvert an integer channel number to a channel name string as used in LEGEND data files.
LegendDataTypes.map_chunked — Method
map_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 — Function
read_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 — Function
readdata(input, name::AbstractString)
readdata(input, name::AbstractString, SomeDataType::Type)Read the value stored under name from input.
LEGEND I/O packages add methods for the I/O-object types they handle.
LegendDataTypes.setunits! — Function
setunits!(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 — Function
LegendDataTypes.similar_table(orig_tbl::AbstractVector{<:NamedTuple{names}}, cols::NamedTuple{names})Return a table similar to orig_tbl from columns cols.
LegendDataTypes.to_properties — Function
write_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 — Function
writedata(output, name::AbstractString, x)Write a value x under name to output.
LEGEND I/O packages add methods for the I/O-object types they handle.