diff --git a/event_display/interactive_event_display/app.py b/event_display/interactive_event_display/app.py index 00c6fb27..b87c2e77 100644 --- a/event_display/interactive_event_display/app.py +++ b/event_display/interactive_event_display/app.py @@ -50,6 +50,7 @@ dcc.Store(id="data-length", data=0), dcc.Store(id="minerva-data-length", data=0), dcc.Store(id="event-time", data=0), + dcc.Store(id="unix-time", data=0), dcc.Store(id="sim-version", data=0), # Header html.Div( @@ -107,6 +108,7 @@ [ html.Div(id="evid-div", style={"textAlign": "center", "display": "inline-block", "margin-right": "10px"}), html.Div(children="", id="event-time-div", style={"display": "inline-block", "margin-right": "10px"}), + html.Div(children="", id="unix-time-div", style={"display": "inline-block", "margin-right": "10px"}), html.Div(children="", id="event-nhits-div", style={"display": "inline-block"}), ] ), @@ -345,7 +347,16 @@ def update_div(evid, max_value): ) def update_time(_, time): """Update the time display""" - return f"Event time: {time}" + return f"Event time (UTC): {time}" + +@app.callback( + Output("unix-time-div", "children"), + Input("3d-graph", "figure"), + State("unix-time", "data"), +) +def update_unix_time(_, unix_time): + """Update the time display""" + return f"unix time: {unix_time}" @app.callback( Output("event-nhits-div", "children"), @@ -362,6 +373,7 @@ def update_nhits(_, nhits): Output("3d-graph", "figure"), Output("sim-version", "data"), Output("event-time", "data"), + Output("unix-time", "data"), Output("event-nhits", "data"), Input("filename", "data"), Input("minerva-filename", "data"), @@ -380,6 +392,7 @@ def update_graph(filename, minerva_filename, evid): event_datetime = datetime.utcfromtimestamp( data["charge/events", evid]["unix_ts"][0] ).strftime("%Y-%m-%d %H:%M:%S") + event_unix_time = data["charge/events", evid]["unix_ts"][0] n_hits = data["charge/events",evid]["nhit"][0] else: raise PreventUpdate @@ -387,6 +400,7 @@ def update_graph(filename, minerva_filename, evid): graph, sim_version, event_datetime, + event_unix_time, n_hits ) # TODO: move to utils diff --git a/event_display/interactive_event_display/display_utils.py b/event_display/interactive_event_display/display_utils.py index c9bf5513..82d57e94 100644 --- a/event_display/interactive_event_display/display_utils.py +++ b/event_display/interactive_event_display/display_utils.py @@ -362,7 +362,7 @@ def create_3d_figure(minerva_data, data, filename, evid): marker={ "size": 1.75, "symbol": 'x', - "color": '#19D3F3', + "color": '17becf', #'#19D3F3', }, mode="markers", name="saturated hits", @@ -381,7 +381,7 @@ def create_3d_figure(minerva_data, data, filename, evid): marker={ "size": 1.75, "symbol": 'x', - "color": '#d62728', + "color": '#2ca02c', #'#d62728', }, mode="markers", name="negative charge hits", @@ -1210,10 +1210,11 @@ def plot_2d_charge(data, evid): y=y, legendgroup= "saturated_2d", name="saturated hits", + showlegend=True, marker={ "size": 4., "symbol": 'x', - "color": '#19D3F3', + "color": '#17becf', #'#19D3F3', }, mode="markers", ) @@ -1222,11 +1223,11 @@ def plot_2d_charge(data, evid): x=z, y=x, legendgroup= "saturated_2d", - showlegend=False, + showlegend=True, marker={ "size": 4., "symbol": 'x', - "color": '#19D3F3', + "color": '#17becf', #'#19D3F3', }, mode="markers", ) @@ -1235,11 +1236,11 @@ def plot_2d_charge(data, evid): x=z, y=y, legendgroup= "saturated_2d", - showlegend=False, + showlegend=True, marker={ "size": 4., "symbol": 'x', - "color": '#19D3F3', + "color": '#17becf', #'#19D3F3', }, mode="markers", ) @@ -1259,10 +1260,11 @@ def plot_2d_charge(data, evid): y=y, legendgroup= "negative_2d", name="negative hits", + showlegend=True, marker={ "size": 4., "symbol": 'x', - "color": '#d62728', + "color": '#2ca02c', #'#d62728', }, mode="markers", ) @@ -1271,11 +1273,11 @@ def plot_2d_charge(data, evid): x=z, y=x, legendgroup= "negative_2d", - showlegend=False, + showlegend=True, marker={ "size": 4., "symbol": 'x', - "color": '#d62728', + "color": '#2ca02c',# '#d62728', }, mode="markers", ) @@ -1284,11 +1286,11 @@ def plot_2d_charge(data, evid): x=z, y=y, legendgroup= "negative_2d", - showlegend=False, + showlegend=True, marker={ "size": 4., "symbol": 'x', - "color": '#d62728', + "color": '#2ca02c', #'#d62728', }, mode="markers", )