legend-exp / LegendDataManagement.jl

LegendMetadata access in Julia
Other
1 stars 5 forks source link

Add plot recipes for parameter PropDicts #49

Closed fhagemann closed 1 month ago

fhagemann commented 2 months ago

The plot recipe takes three arguments:

There are also keyword arguments:

Examples:

using RecipesBase, Plots, LegendDataManagement
l200 = LegendData(:l200)
filekey = FileKey("l200-p03-r000-cal-20230311T235840Z")
#pars = l200.par.cal.p_energy(filekey);
pars = l200.par.ppars.ecal(filekey)
chinfo = channelinfo(l200, filekey; system = :geds, only_processable = true)
properties = [:e_cusp_ctc, :fwhm, :qbb];
plot(chinfo, pars, properties, verbose = true, color = 1, markershape = :o, calculate_mean = true)

image

using PropDicts
new_pars = PropDict(Dict(Symbol.(chinfo.detector) .=> chinfo.mass))
plot(chinfo, new_pars, color = 1, markershape = :x, verbose = true)

image

fhagemann commented 1 month ago

The last force-push was just a rebase using the changes in #50

fhagemann commented 1 month ago

The tests are still failing (but unrelated to this PR) because the LegendTestData was not updated to the new format of saving enrichment in the metadata, which (instead of just having a value, now have the fields val and unc for value and uncertainty), see https://github.com/legend-exp/legend-detectors/commit/f87cf1c471439f0d7407670949a9f7da78adc009

The tests fail as LegendDataManagement was already updated to the new format (see https://github.com/legend-exp/LegendDataManagement.jl/commit/49da84425a3b5b93045670cf7757fd00b978b08c), but not the test data.

I opened a PR to legend-testdata (see https://github.com/legend-exp/legend-testdata/pull/16) to update the detector config files in the test data to this new format, but it might take some steps until they make it to the tests.

theHenks commented 1 month ago

Test issue is due to wrong metadata in LegendTestData. This leads to failing tests.