Skip to content

Commit

Permalink
Use units in conversion to NamedTuple
Browse files Browse the repository at this point in the history
  • Loading branch information
oschulz committed Jun 19, 2019
1 parent 22cdade commit 7d428c8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.1.0"
ArraysOfArrays = "65a8f2f4-9b39-5baf-92e2-a9cc46fdf018"
BufferedStreams = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
julia = "1"
Expand Down
1 change: 1 addition & 0 deletions src/H3DDetectorSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using Sockets

using ArraysOfArrays
using BufferedStreams
using Unitful

include("polaris_data.jl")
include("datastream.jl")
Expand Down
12 changes: 6 additions & 6 deletions src/polaris_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ PolarisEvents() = PolarisEvents(

Base.NamedTuple(events::PolarisEvents) = (
evt_no = events.evt_no,
evt_t = events.evt_t,
evt_t = deepmap(x -> x * u"ns", events.evt_t),
evt_nhits = events.evt_nhits,
evt_issync = events.evt_issync,
hit_edep = events.hit_edep,
hit_t = events.hit_t,
hit_edep = deepmap(x -> x * u"eV", events.hit_edep),
hit_t = deepmap(x -> x * u"ns", events.hit_t),
hit_detno = events.hit_detno,
hit_x = events.hit_x,
hit_y = events.hit_y,
hit_z = events.hit_z,
hit_x = deepmap(x -> x * u"μm", events.hit_x),
hit_y = deepmap(x -> x * u"μm", events.hit_y),
hit_z = deepmap(x -> x * u"μm", events.hit_z),
)


Expand Down

0 comments on commit 7d428c8

Please sign in to comment.