Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Fixing bokeh plots layout (#217)
Browse files Browse the repository at this point in the history
* fixing bokeh plots layout

* removing unused code
  • Loading branch information
felipelm authored Aug 31, 2018
1 parent 0f7caf3 commit 8b9cba1
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 102 deletions.
8 changes: 4 additions & 4 deletions backend/framework/qlf/dashboard/bokeh/qacountbins/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ def load_qa(self):
# Prepare tables
comments='Number of fibers with a nonzero number of bins above highest threshold'
metric_txt=mtable('countbins', mergedqa, comments )
metric_tb=Div(text=metric_txt, width=500)
metric_tb=Div(text=metric_txt, width=350)
alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=500)
alert_tb = Div(text=alert_txt, width=350)

layout = column(widgetbox(info_col, css_classes=["header"]),
column(widgetbox(metric_tb),widgetbox(alert_tb), css_classes=["table-ranges"]),
layout = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb),widgetbox(alert_tb),
p,
p2,
css_classes=["display-grid-countbins"])
Expand Down
8 changes: 4 additions & 4 deletions backend/framework/qlf/dashboard/bokeh/qacountpix/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ def load_qa(self):
metric_txt=metric_table(metricname, comments, keyname, curexp=curexp, refexp=refexp )
metric_txt=mtable('countpix', mergedqa, comments )

metric_tb=Div(text=metric_txt, width=500)
metric_tb=Div(text=metric_txt, width=300)

alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=500)
alert_tb = Div(text=alert_txt, width=300)


layout = column(widgetbox(info_col, css_classes=["header"]),
column(widgetbox(metric_tb), widgetbox(alert_tb), css_classes=["table-ranges"]),
layout = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb), widgetbox(alert_tb),
p,
css_classes=["display-grid"])

Expand Down
8 changes: 4 additions & 4 deletions backend/framework/qlf/dashboard/bokeh/qagetbias/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ def load_qa(self):
refexp=mergedqa['TASKS']['CHECK_CCDs']['PARAMS']['BIAS_AMP_REF']
metric_txt=metric_table(metricname, comments, keyname, curexp=curexp, refexp=refexp )
metric_txt=mtable('getbias', mergedqa, comments )
metric_tb=Div(text=metric_txt, width=500)
metric_tb=Div(text=metric_txt, width=350)

alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=500)
alert_tb = Div(text=alert_txt, width=350)

ptxt = column(widgetbox(info_col, css_classes=["header"]),
column(widgetbox(metric_tb),widgetbox(alert_tb), css_classes=["table-ranges"]),
ptxt = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb),widgetbox(alert_tb),
p,
css_classes=["display-grid"]) # ,p_hist)

Expand Down
10 changes: 5 additions & 5 deletions backend/framework/qlf/dashboard/bokeh/qagetrms/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ def load_qa(self):
# Prepare tables
comments='value of RMS for each amplifier read directly from the header of the pre processed image'
refexp=mergedqa['TASKS']['CHECK_CCDs']['PARAMS']['BIAS_AMP_REF']
metric_txt=mtable('getrms', mergedqa, comments )
metric_tb=Div(text=metric_txt, width=500)
metric_txt=mtable('getbias', mergedqa, comments )
metric_tb=Div(text=metric_txt, width=350)

alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=500)
alert_tb = Div(text=alert_txt, width=350)

layout = column(widgetbox(info_col, css_classes=["header"]),
column(widgetbox(metric_tb),widgetbox(alert_tb), css_classes=["table-ranges"]),
layout = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb),widgetbox(alert_tb),
p,
p2,
css_classes=["display-grid"])
Expand Down
8 changes: 4 additions & 4 deletions backend/framework/qlf/dashboard/bokeh/qainteg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def load_qa(self):
# Prepare tables
comments='List of the average fiber mag for each of N target types in this camera'
metric_txt=mtable('integ', mergedqa, comments, objtype=objlist) # objtype=['ELG','STAR'] )
metric_tb=Div(text=metric_txt, width=450)
metric_tb=Div(text=metric_txt, width=350)
alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=450)
alert_tb = Div(text=alert_txt, width=350)


layout = column(widgetbox(info_col, css_classes=["header"]),
column(widgetbox(metric_tb),widgetbox(alert_tb), css_classes=["table-ranges"]),
layout = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb),widgetbox(alert_tb),
fiber_hist,
css_classes=["display-grid"])

Expand Down
10 changes: 5 additions & 5 deletions backend/framework/qlf/dashboard/bokeh/qaskycont/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ def load_qa(self):
# Prepare tables
comments='Sky continuum in all configured continuum areas averaged over all sky fibers'
metric_txt=mtable('skycont', mergedqa, comments )
metric_tb=Div(text=metric_txt, width=450)
metric_tb=Div(text=metric_txt, width=350)
alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=450)
alert_tb = Div(text=alert_txt, width=350)


layout = column(widgetbox(info_col, css_classes=["header"]),
column(widgetbox(metric_tb),widgetbox(alert_tb), css_classes=["table-ranges"]),
layout = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb), widgetbox(alert_tb),
p2,
css_classes=["display-grid-skycont"])
css_classes=["display-grid"])

# End of Bokeh Block
return file_html(layout, CDN, "SKYCONT")
10 changes: 5 additions & 5 deletions backend/framework/qlf/dashboard/bokeh/qaskypeak/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@ def load_qa(self):
# Prepare tables
comments='Sky continuum in all configured continuum areas averaged over all sky fibers'
metric_txt=mtable('skypeak', mergedqa, comments )
metric_tb=Div(text=metric_txt, width=450)
metric_tb=Div(text=metric_txt, width=350)
alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=450)
alert_tb = Div(text=alert_txt, width=350)


#row1 = column(p, p_hist)
layout = column(widgetbox(info_col, css_classes=["header"]),
column(widgetbox(metric_tb),widgetbox(alert_tb), css_classes=["table-ranges"]),
layout = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb),widgetbox(alert_tb),
p,
p_hist,
css_classes=["display-grid-skypeak"])
css_classes=["display-grid"])

return file_html(layout, CDN, "SKYPEAK")
8 changes: 4 additions & 4 deletions backend/framework/qlf/dashboard/bokeh/qaskyresid/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,14 @@ def load_qa(self):
# Prepare tables
comments='Median of residuals over all sky fibers'
metric_txt=mtable('skyresid', mergedqa, comments )
metric_tb=Div(text=metric_txt, width=450)
metric_tb=Div(text=metric_txt, width=350)
alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=450)
alert_tb = Div(text=alert_txt, width=350)


try:
layout = column([widgetbox(info_col, css_classes=["header"]),
widgetbox(metric_tb, alert_tb, css_classes=["table-ranges"])]
layout = column([widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb), widgetbox(alert_tb)]
+ [p2]
+ p_s,css_classes=['display-grid-skyresid'])
except Exception as err:
Expand Down
19 changes: 9 additions & 10 deletions backend/framework/qlf/dashboard/bokeh/qasnr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def fit_func(xdata, coeff):

p_m = Figure(title= '',
x_axis_label='Fiber ', y_axis_label = 'Median S/N',
plot_width = 500, plot_height = 240,
plot_width = 400, plot_height = 240,
tools=[median_hover, "pan,box_zoom,reset,crosshair" ],
toolbar_location='above')

Expand All @@ -521,7 +521,7 @@ def fit_func(xdata, coeff):


pltxy_h = 350
pltxy_w = 500
pltxy_w = 450
elg_plot.plot_height = pltxy_h
elg_plot.plot_width = pltxy_w
lrg_plot.plot_height = pltxy_h
Expand All @@ -547,14 +547,13 @@ def fit_func(xdata, coeff):
# Prepare tables
comments='List of average SNR for the N target type'#, N is number of target types'
metric_txt=mtable('snr', mergedqa, comments, objtype=objlist)
metric_tb=Div(text=metric_txt, width=500)
metric_tb=Div(text=metric_txt, width=350)
alert_txt = alert_table(nrg,wrg)
alert_tb = Div(text=alert_txt, width=500)
alert_tb = Div(text=alert_txt, width=350)


layout = column(row(widgetbox(info_col)),
row(widgetbox(metric_tb, alert_tb)),
row( column(Spacer(width=p_m.plot_width, height=140), p_m), p, cbar),
gridplot([plot_snr[0:2], plot_snr[2:4]])
)
layout = column(widgetbox(info_col, css_classes=["header"]), Div(),
widgetbox(metric_tb), widgetbox(alert_tb),
elg_plot, star_plot,
p_m, p,
css_classes=["display-grid"])
return file_html(layout, CDN, "MEDIAN SNR")
2 changes: 1 addition & 1 deletion backend/framework/qlf/dashboard/bokeh/qlf_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def mtable(qa, data, comments, objtype=['XXELG','XXSTAR']):
""".format( key_tb[i], cur_tb[i], ref_tb[i])

print(cur_tb, ref_tb)
return style + title + header + tblines + end
return style + header + tblines + end



Expand Down
57 changes: 1 addition & 56 deletions backend/framework/qlf/dashboard/templates/dashboard/qa.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}

.display-grid {
align-items: center;
display: grid !important;
grid-gap: 1rem;
grid-template-columns: auto;
Expand All @@ -48,20 +49,6 @@
"main";
}

.display-grid-skypeak {
display: grid !important;
grid-gap: 1rem;
grid-template-columns: auto;
width: auto !important;
height: auto !important;
justify-content: center;
justify-items: center;
grid-template-areas:
"header"
"table-ranges"
"main";
}

.display-grid-countbins {
display: grid !important;
grid-gap: 1rem;
Expand Down Expand Up @@ -90,20 +77,6 @@
"main";
}

.display-grid-skycont {
display: grid !important;
grid-gap: 1rem;
grid-template-columns: auto;
width: auto !important;
height: auto !important;
justify-content: center;
justify-items: center;
grid-template-areas:
"header"
"table-ranges"
"main";
}

@media screen and (min-width: 1500px) {
.display-grid-xwsigma {
display: grid !important;
Expand All @@ -117,20 +90,6 @@
}

@media screen and (min-width: 1100px) {
.display-grid-skypeak {
display: grid !important;
grid-gap: 4em;
width: auto !important;
grid-template-columns: auto auto;
height: auto !important;
justify-content: center;
justify-items: center;
align-items: baseline;
grid-template-areas:
"header table-ranges"
"main main";
}

.display-grid-countbins {
display: grid !important;
grid-gap: 4em;
Expand All @@ -145,20 +104,6 @@
"main main";
}

.display-grid-skycont {
display: grid !important;
grid-gap: 4em;
width: auto !important;
grid-template-columns: auto auto;
height: auto !important;
justify-content: center;
justify-items: center;
align-items: center;
grid-template-areas:
"header table-ranges"
"main main";
}

.display-grid-skyresid {
display: grid !important;
grid-gap: 4em;
Expand Down

0 comments on commit 8b9cba1

Please sign in to comment.