Skip to content

Commit

Permalink
enh: show ancillary parameters in info tab
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 10, 2020
1 parent 30cd0a2 commit d80b13a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pyjibe/fd/tab_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pkg_resources

from afmformats import meta
from nanite import model
from PyQt5 import uic, QtWidgets


Expand All @@ -16,6 +17,7 @@ def update_info(self, fdist):
text = []
keys = list(fdist.metadata.keys())

# Dataset
text.append("<b>Dataset</b>")
data_keys = ["path", "enum"]
for kk in data_keys:
Expand All @@ -24,6 +26,7 @@ def update_info(self, fdist):
if kk in meta.DEF_DATA and kk not in data_keys:
text.append(get_string_rep(kk, fdist.metadata))

# Experiment
if set(keys) & set(meta.DEF_EXPERIMENT.keys()):
text.append("")
text.append("<b>Experiment:</b>")
Expand All @@ -33,6 +36,7 @@ def update_info(self, fdist):
text_meta.append(get_string_rep(kk, fdist.metadata))
text += sorted(text_meta)

# QMap
if set(keys) & set(meta.DEF_QMAP.keys()):
text.append("")
text.append("<b>QMap:</b>")
Expand All @@ -42,6 +46,7 @@ def update_info(self, fdist):
text_meta.append(get_string_rep(kk, fdist.metadata))
text += sorted(text_meta)

# Analysis
if set(keys) & set(meta.DEF_ANALYSIS.keys()):
text.append("")
text.append("<b>Analysis:</b>")
Expand All @@ -51,6 +56,21 @@ def update_info(self, fdist):
text_meta.append(get_string_rep(kk, fdist.metadata))
text += sorted(text_meta)

# Ancillaries
anc_dict = fdist.get_ancillary_parameters()
if anc_dict:
text.append("")
text.append("<b>Ancillaries:</b>")
text_meta = []
md = model.models_available[fdist.fit_properties["model_key"]]
for kk in anc_dict:
idk = md.parameter_anc_keys.index(kk)
text_meta.append("{}: {:.5g} {}".format(
md.parameter_anc_names[idk],
anc_dict[kk],
md.parameter_anc_units[idk]))
text += sorted(text_meta)

textstring = "<br>".join(text)

self.info_text.setText(textstring)
Expand Down

0 comments on commit d80b13a

Please sign in to comment.