Add files via upload
This commit is contained in:
@ -15,12 +15,13 @@ dash.register_page(__name__, path="/ascan", title='A-Scan filters', name='A-Scan
|
||||
# on définit le dossier et les fichiers à lire
|
||||
dossier = "Dataset/Shear_Wave_Rot00_CSV_Data"
|
||||
fichiers_selectionnes = [
|
||||
"Shear_x001-x101_y{:03d}_Rot00.csv".format(i) for i in range(10, 11)
|
||||
"Shear_x001-x101_y{:03d}_Rot00.csv".format(i) for i in range(10,13)
|
||||
]
|
||||
|
||||
# on lit les fichiers et on les met dans un tableau
|
||||
pre_volume = np.array(lire_fichier_csv(dossier, fichiers_selectionnes))
|
||||
volume = pre_volume[:, :, :]
|
||||
data_traits=volume
|
||||
dim_x, dim_y, dim_z = volume.shape
|
||||
|
||||
X, Y, Z = np.mgrid[0:dim_x, 0:dim_y, 0:dim_z]
|
||||
@ -65,7 +66,7 @@ layout = html.Div(
|
||||
{"label": "filtre à réponse impulsionnelle infinie", "value": "6"},
|
||||
{"label": "filtre à réponse impulsionnelle finie", "value": "7"},
|
||||
],
|
||||
value=3,
|
||||
value=2,
|
||||
style={"margin-bottom": "15px"},
|
||||
),
|
||||
]
|
||||
@ -85,10 +86,12 @@ layout = html.Div(
|
||||
value=2,
|
||||
style={"margin-bottom": "15px"},
|
||||
),
|
||||
|
||||
]
|
||||
),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("applique les filtres selections sur tous les data"),
|
||||
dbc.Button(
|
||||
id="button-validate-filter",
|
||||
children="Valider",
|
||||
@ -104,24 +107,39 @@ layout = html.Div(
|
||||
config=configAScan,
|
||||
style={"marginBottom": "15px"},
|
||||
), # 'fig' is your 2D plotly figure
|
||||
dbc.Label("x"),
|
||||
dcc.Slider(
|
||||
id="layer-slider-ascan-solo",
|
||||
id="layer-slider-ascan-solo-x",
|
||||
min=1,
|
||||
max=dim_z,
|
||||
value=1,
|
||||
step=1,
|
||||
marks={
|
||||
str(i): str(i) for i in range(1, dim_z+1,1)
|
||||
},
|
||||
),
|
||||
dbc.Label("y"),
|
||||
dcc.Slider(
|
||||
id="layer-slider-ascan-solo-y",
|
||||
min=1,
|
||||
max=dim_x,
|
||||
value=1,
|
||||
step=1,
|
||||
marks={
|
||||
str(i): str(i) for i in range(1, dim_x + 1, max(1, int(dim_x / 20)))
|
||||
str(i): str(i) for i in range(1, dim_x+1,1)
|
||||
},
|
||||
),
|
||||
dbc.Row(
|
||||
[
|
||||
dbc.Label(" paramètre du 1er filtre ", html_for="Fs "),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("Fs ", html_for="Fs "),
|
||||
dbc.Label("Fs ", html_for="Fs "),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-fs",
|
||||
type="number",
|
||||
placeholder="Fs",
|
||||
value=200,
|
||||
value=1,
|
||||
step=0.1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
@ -130,12 +148,12 @@ layout = html.Div(
|
||||
),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("cut off", html_for="cut off"),
|
||||
dbc.Label("cut off ", html_for="cut off"),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-cutoff",
|
||||
type="number",
|
||||
placeholder="cut_off",
|
||||
value=3,
|
||||
value=1,
|
||||
step=0.1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
@ -144,12 +162,12 @@ layout = html.Div(
|
||||
),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("order", html_for="order"),
|
||||
dbc.Label("order ", html_for="order"),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-order",
|
||||
type="number",
|
||||
placeholder="order",
|
||||
value=2,
|
||||
value=1,
|
||||
step=1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
@ -158,19 +176,80 @@ layout = html.Div(
|
||||
),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("window size", html_for="window size"),
|
||||
dbc.Label("window size ", html_for="window size"),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-windowsize",
|
||||
type="number",
|
||||
placeholder="window_size",
|
||||
value=21,
|
||||
value=1,
|
||||
step=1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
],
|
||||
width=3,
|
||||
),]),
|
||||
dbc.Row(
|
||||
[
|
||||
dbc.Label("paramètre de 2eme filtre ", html_for="Fs "),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("Fs ", html_for="Fs "),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-fs-2",
|
||||
type="number",
|
||||
placeholder="Fs",
|
||||
value=1,
|
||||
step=0.1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
],
|
||||
width=3,
|
||||
),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("cut off ", html_for="cut off"),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-cutoff-2",
|
||||
type="number",
|
||||
placeholder="cut_off",
|
||||
value=1,
|
||||
step=0.1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
],
|
||||
width=3,
|
||||
),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("order ", html_for="order"),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-order-2",
|
||||
type="number",
|
||||
placeholder="order",
|
||||
value=1,
|
||||
step=1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
],
|
||||
width=3,
|
||||
),
|
||||
dbc.Col(
|
||||
[
|
||||
dbc.Label("window size ", html_for="window size"),
|
||||
dbc.Input(
|
||||
id="input-ascan-solo-windowsize-2",
|
||||
type="number",
|
||||
placeholder="window_size",
|
||||
value=1,
|
||||
step=1,
|
||||
style={"marginTop": "15px"},
|
||||
),
|
||||
],
|
||||
width=3,
|
||||
),
|
||||
]),
|
||||
],
|
||||
|
||||
style={"padding": "20px"},
|
||||
)
|
||||
|
||||
@ -182,33 +261,37 @@ layout = html.Div(
|
||||
Input("select-ascan-filter1", "value"),
|
||||
Input("select-ascan-filter2", "value"),
|
||||
Input("select-ascan-filter3", "value"),
|
||||
Input("layer-slider-ascan-solo", "value"),
|
||||
Input("layer-slider-ascan-solo-x", "value"),
|
||||
Input("layer-slider-ascan-solo-y", "value"),
|
||||
Input("button-validate-filter", "n_clicks"),
|
||||
Input("input-ascan-solo-fs", "value"),
|
||||
Input("input-ascan-solo-cutoff", "value"),
|
||||
Input("input-ascan-solo-order", "value"),
|
||||
Input("input-ascan-solo-windowsize", "value"),
|
||||
Input("input-ascan-solo-fs-2", "value"),
|
||||
Input("input-ascan-solo-cutoff-2", "value"),
|
||||
Input("input-ascan-solo-order-2", "value"),
|
||||
Input("input-ascan-solo-windowsize-2", "value"),
|
||||
],
|
||||
)
|
||||
|
||||
def update_heatmap_ascan(value1,value2,value3,value,n_clicks,fs,cutoff,order,windowsize):
|
||||
def update_heatmap_ascan(selec_transforme_hilbert,select_filtre_1,select_filtre_2,select_ascan_x,select_ascan_y,n_clicks,fs_filtre_1,cutoff_filtre_1,order_filtre_1,windowsize_filtre_1,fs_filtre_2,cutoff_filtre_2,order_filtre_2,windowsize_filtre_2):
|
||||
# TODO: implement the filter
|
||||
|
||||
print("debut du traitement")
|
||||
data_avec_traitement=volume[0,:,1]
|
||||
data_sans_traitement=volume[0,:,1]
|
||||
data_avec_traitement=switch_case(data_avec_traitement,value1)
|
||||
data_sans_traitement=switch_case(data_sans_traitement,value1)
|
||||
data_avec_traitement=volume[int(select_ascan_y)-1,:,int(select_ascan_x)-1]
|
||||
data_sans_traitement=volume[int(select_ascan_y)-1,:,int(select_ascan_x)-1]
|
||||
data_avec_traitement=switch_case(data_avec_traitement,int(selec_transforme_hilbert))
|
||||
data_sans_traitement=switch_case(data_sans_traitement,int(selec_transforme_hilbert))
|
||||
data_avec_traitement=switch_case(data_avec_traitement,int(select_filtre_1),float(fs_filtre_1),float(cutoff_filtre_1),int(order_filtre_1),int(windowsize_filtre_1))
|
||||
|
||||
print(fs,cutoff,order,windowsize,value2,value3)
|
||||
|
||||
data_avec_traitement=switch_case(data_avec_traitement,value2,fs,cutoff,order,windowsize)
|
||||
data_avec_traitement=switch_case(data_avec_traitement,value3,fs,cutoff,order,windowsize)
|
||||
#data_avec_traitement=switch_case(data_avec_traitement,3,200,3,2,21)
|
||||
#data_avec_traitement=switch_case(data_avec_traitement,2,200,3,2,21)
|
||||
data_avec_traitement=switch_case(data_avec_traitement,int(select_filtre_2),float(fs_filtre_2),float(cutoff_filtre_2),int(order_filtre_2),int(windowsize_filtre_2))
|
||||
print("fin du traitement")
|
||||
if(n_clicks!=None):
|
||||
data_traits=switch_case(data_traits,int(selec_transforme_hilbert))
|
||||
data_traits=switch_case(data_traits,int(select_filtre_1),float(fs_filtre_1),float(cutoff_filtre_1),int(order_filtre_1),int(windowsize_filtre_1))
|
||||
data_traits=switch_case(data_traits,int(select_filtre_2),float(fs_filtre_2),float(cutoff_filtre_2),int(order_filtre_2),int(windowsize_filtre_2))
|
||||
fig = px.line( title="A-scan")
|
||||
new_trace = go.Scatter(y=data_avec_traitement, mode='lines', name=' Ascan traits ')
|
||||
new_trace = go.Scatter(y=data_avec_traitement, mode='lines', name=' Ascan trait ')
|
||||
fig.add_trace(new_trace)
|
||||
new_trace = go.Scatter(y=data_sans_traitement, mode='lines', name=' Ascan (hilbert) ')
|
||||
fig.add_trace(new_trace)
|
||||
|
Reference in New Issue
Block a user