Display only filenames from a cami file
This commit is contained in:
parent
9412de17da
commit
4d71abf698
@ -1,5 +1,6 @@
|
|||||||
import base64
|
import base64
|
||||||
import io
|
import io
|
||||||
|
import os
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from bokeh.layouts import column, gridplot, row
|
from bokeh.layouts import column, gridplot, row
|
||||||
@ -26,6 +27,7 @@ from bokeh.models import (
|
|||||||
Rect,
|
Rect,
|
||||||
ResetTool,
|
ResetTool,
|
||||||
Select,
|
Select,
|
||||||
|
Spacer,
|
||||||
Spinner,
|
Spinner,
|
||||||
TextAreaInput,
|
TextAreaInput,
|
||||||
Title,
|
Title,
|
||||||
@ -44,13 +46,11 @@ def create():
|
|||||||
det_data = {}
|
det_data = {}
|
||||||
roi_selection = {}
|
roi_selection = {}
|
||||||
|
|
||||||
upload_div = Div(text="Open .cami file:")
|
|
||||||
|
|
||||||
def upload_button_callback(_attr, _old, new):
|
def upload_button_callback(_attr, _old, new):
|
||||||
with io.StringIO(base64.b64decode(new).decode()) as file:
|
with io.StringIO(base64.b64decode(new).decode()) as file:
|
||||||
h5meta_list = pyzebra.parse_h5meta(file)
|
h5meta_list = pyzebra.parse_h5meta(file)
|
||||||
file_list = h5meta_list["filelist"]
|
file_list = h5meta_list["filelist"]
|
||||||
filelist.options = file_list
|
filelist.options = [(entry, os.path.basename(entry)) for entry in file_list]
|
||||||
filelist.value = file_list[0]
|
filelist.value = file_list[0]
|
||||||
|
|
||||||
upload_button = FileInput(accept=".cami")
|
upload_button = FileInput(accept=".cami")
|
||||||
@ -451,12 +451,15 @@ def create():
|
|||||||
gridplot(
|
gridplot(
|
||||||
[[overview_plot_x, overview_plot_y]], toolbar_options=dict(logo=None), merge_tools=True,
|
[[overview_plot_x, overview_plot_y]], toolbar_options=dict(logo=None), merge_tools=True,
|
||||||
),
|
),
|
||||||
frame_button_group,
|
row(frame_button_group),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
upload_div = Div(text="Upload .cami file:")
|
||||||
tab_layout = row(
|
tab_layout = row(
|
||||||
column(
|
column(
|
||||||
upload_div, upload_button, filelist, layout_image, row(colormap_layout, hkl_layout),
|
row(column(Spacer(height=5), upload_div), upload_button, filelist),
|
||||||
|
layout_image,
|
||||||
|
row(colormap_layout, hkl_layout),
|
||||||
),
|
),
|
||||||
column(roi_avg_plot, layout_overview, row(selection_button, selection_list),),
|
column(roi_avg_plot, layout_overview, row(selection_button, selection_list),),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user