diff --git a/Project.toml b/Project.toml index d32e41c..61eddef 100644 --- a/Project.toml +++ b/Project.toml @@ -55,7 +55,7 @@ Distributions = "0.23, 0.24, 0.25" ElasticArrays = "1" IntervalSets = "0.5, 0.6, 0.7" JSON = "0.21" -LegendDataManagement = "0.2.1, 0.3, 0.4" +LegendDataManagement = "0.2.8, 0.3, 0.4" LegendDataTypes = "0.1" LegendHDF5IO = "0.1" LegendTextIO = "0.1" diff --git a/src/detector.jl b/src/detector.jl index ae1c91e..6fc5916 100644 --- a/src/detector.jl +++ b/src/detector.jl @@ -7,7 +7,7 @@ end # user generates detector metadata in code function simulate_fields(detector_metadata::AbstractString, environment_settings::PropDict, simulation_settings::PropDict; overwrite::Bool = false) - simulate_fields(propdict(detector_metadata), environment_settings, simulation_settings; overwrite) + simulate_fields(readlprops(detector_metadata), environment_settings, simulation_settings; overwrite) end # user launches directly inputting separate dicts @@ -23,7 +23,7 @@ end # user launches with all settings in json function simulate_fields(detector_metadata::Union{AbstractString, PropDict}, all_settings::AbstractString; overwrite::Bool = false) - simulate_fields(detector_metadata, propdict(all_settings); overwrite) + simulate_fields(detector_metadata, readlprops(all_settings); overwrite) end diff --git a/src/impurity.jl b/src/impurity.jl index a4d67a3..d604f92 100644 --- a/src/impurity.jl +++ b/src/impurity.jl @@ -105,7 +105,7 @@ function impurity_density_model(meta::PropDict, crystal_metadata_path::AbstractS @error "Crystal $(crystal_name) does not exist in path $crystal_metadata_path" end - crystal_dict = propdict(crystal_path) + crystal_dict = readlprops(crystal_path) # get fit parameters in crystal metadata coordinates i.e. e/cm^3 VS mm fit_param = impurity_density_model(crystal_dict) diff --git a/src/legend_detector_to_ssd.jl b/src/legend_detector_to_ssd.jl index 183ca7f..5bb4589 100644 --- a/src/legend_detector_to_ssd.jl +++ b/src/legend_detector_to_ssd.jl @@ -4,7 +4,7 @@ to_SSD_units(::Type{T}, x, unit) where {T} = T(SolidStateDetectors.to_internal_u # if just want geometry function LEGEND_SolidStateDetector(metapath::AbstractString) - LEGEND_SolidStateDetector(propdict(metapath)) + LEGEND_SolidStateDetector(readlprops(metapath)) end function LEGEND_SolidStateDetector(meta::PropDict) diff --git a/src/pet_to_raw.jl b/src/pet_to_raw.jl index 6146516..736b534 100644 --- a/src/pet_to_raw.jl +++ b/src/pet_to_raw.jl @@ -38,7 +38,7 @@ end # user launches directly inputting separate dicts function simulate_raw(detector_metadata::AbstractString, pet_filename::AbstractString, environment_settings::Union{Dict,PropDict}, simulation_settings::Union{Dict,PropDict}, setup_settings::Union{Dict,PropDict}, noise_settings::Union{Dict,PropDict}=Dict("type"=>"none"); n_waveforms::Int = 0) - pet_to_raw(propdict(detector_metadata), pet_filename, + pet_to_raw(readlprops(detector_metadata), pet_filename, PropDict(environment_settings), PropDict(simulation_settings), PropDict(setup_settings), PropDict(noise_settings); n_waveforms) end @@ -51,5 +51,5 @@ end # user launches with all settings in json function simulate_raw(detector_metadata::AbstractString, pet_filename::AbstractString, all_settings::AbstractString; n_waveforms::Int = 0) - simulate_raw(detector_metadata, pet_filename, propdict(all_settings); n_waveforms) + simulate_raw(detector_metadata, pet_filename, readlprops(all_settings); n_waveforms) end diff --git a/src/stp_to_pss.jl b/src/stp_to_pss.jl index 23e11a2..8b71980 100644 --- a/src/stp_to_pss.jl +++ b/src/stp_to_pss.jl @@ -49,7 +49,7 @@ end function simulate_pulses(detector_metadata::AbstractString, pet_filename::AbstractString, environment_settings::Union{Dict,PropDict}, simulation_settings::Union{Dict,PropDict}, noise_settings::Union{Dict,PropDict} = Dict("type" => "none"); n_waveforms::Int = 0) ## step 1: stepping information - det_meta = propdict(detector_metadata) + det_meta = readlprops(detector_metadata) stp_table = pet_to_stp(det_meta, pet_filename) # truncate if asked by user @@ -74,7 +74,7 @@ end # user launches with all settings in json function simulate_pulses(detector_metadata::AbstractString, pet_filename::AbstractString, all_settings::AbstractString; n_waveforms::Int = 0) - simulate_pulses(detector_metadata, pet_filename, propdict(all_settings); n_waveforms) + simulate_pulses(detector_metadata, pet_filename, readlprops(all_settings); n_waveforms) end diff --git a/src/temp_utils.jl b/src/temp_utils.jl index ac00cd3..9dded0d 100644 --- a/src/temp_utils.jl +++ b/src/temp_utils.jl @@ -11,23 +11,6 @@ E.g. filename("/some/path/to/file_name.ext") -> "file_name" filename(path) = splitext(basename(path))[1] -# this should be in PropDicts? -""" - propdict(json_file) - -AbstractString -> PropDict - -Construct a PropDict based on given . -Alias for `readprops` from PropDicts.jl - -""" -function propdict(json_file::AbstractString) - readprops(json_file) -end - - - - """ remove_negative(value)