From 7273c3f392b6d550e98b118045ae5fc345bc9eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Tue, 29 Sep 2020 11:31:48 +0200 Subject: [PATCH] Add filters for molecule size (defined by the number of non-H atoms) --- content/dataset.html | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/content/dataset.html b/content/dataset.html index c6f084b3..175cb8f6 100644 --- a/content/dataset.html +++ b/content/dataset.html @@ -149,6 +149,18 @@ draft: false molecule:d.molecule } }))) + const nHnums=window.geoms.map((g)=>{ + return g.molecule.atoms.count((a)=>a.label!=="H") + }) + var nHmin = ss.min(nHnums) + $("#nHmin").attr("min",nHmin).val(nHmin) + var nHmax = ss.max(nHnums) + $("#nHmax").attr("max",nHmax).val(nHmax) + const mols = uniq(window.geoms.map(g=>g.parseMetadata().molecule)) + const shownHunknow=window.dats.some((d)=>!mols.includes(d.molecule)) + if (shownHunknow) { + $("#cb_nHUnknow").parent().show() + } } async function reloadCustomFiles() { window.dats = window.defaultDats; @@ -413,11 +425,17 @@ draft: false T1: { min: parseFloat($("#T1min").val()), max: parseFloat($("#T1max").val()) + }, + nHnum: { + min: parseInt($("#nHmin").val(),10), + max: parseInt($("#nHmax").val(),10), + allowUnknow:$("#cb_nHUnknow").is(':checked') } } window.doiCache.clear() processingIndicator.isActive = true window.filtData = window.dats + //Filter with select getAllSelect().each(function () { const prop = $(this).attr("name") const values = getAllVals(this) @@ -429,6 +447,21 @@ draft: false delete (val) }) }) + // Filter with molSize + const allowednHSize=window.filterParams.nHnum + window.filtData=window.filtData.filter((d)=>{ + const geom=window.geoms.find((g)=>{ + const met=g.parseMetadata() + return met.molecule === d.molecule && JSON.stringify(met.method) === JSON.stringify(d.geometry) + }) + if (geom) { + const size = geom.molecule.atoms.count(a=>a.label!=="H") + return (allowednHSize.min <= size && size <= allowednHSize.max) + } + else { + return allowednHSize.allowUnknow + } + }) window.T1ref = new Map() var exSets = new uniq(window.filtData.map((d) => d.set)) var mols = new Set(window.filtData.map((d) => d.molecule)) @@ -727,6 +760,18 @@ draft: false
+
+ Molecule Size +

Select the molecule size (by the number of non H atoms)

+ + \(\leq \text{non-H atoms} \leq\) + + +
+
\(\mathrm{\%T_1}\)

Select the range of single-excitation percentage \(\mathrm{\%T_1}\) of the transitions