Commit 50885bd9 authored by Iker Hurtado's avatar Iker Hurtado
Browse files

One more 'data DOS tranformations' implementation (Issue 111 - Staging based on prod-032)

parent 830b0462
Pipeline #37416 passed with stages
in 10 seconds
This diff is collapsed.
......@@ -46,10 +46,16 @@ class DOSPlotter extends InteractivePlotterBase{
}
setPoints(points, codeName){
setPoints(points, /*codeName*/ calcData ){
let dosValueDivisor = E_FACTOR;
//if (codeName === 'VASP') dosValueDivisor = 1e-10*(E_FACTOR*E_FACTOR);
let dosValueFactor = E_FACTOR;
//console.log('setPoints codeName : ', calcData.code_name, calcData.cell_volume);
if (calcData.code_name === 'exciting')
dosValueFactor = 1/E_FACTOR;
else if (calcData.code_name === 'VASP')
dosValueFactor = 1/(E_FACTOR * calcData.cell_volume);
// else general case
this.pointsSpin1 = [];
this.pointsSpin2 = [];
......@@ -64,18 +70,19 @@ class DOSPlotter extends InteractivePlotterBase{
for (var i = 0; i < pointsY.length; i++) {
let energy = pointsY[i]/E_FACTOR;
let dos_value_spin1 = pSpin1[i]*dosValueDivisor;
let dos_value_spin1 = pSpin1[i]*dosValueFactor;
// Arrays to calculate the range to be represented
pointsXInPlotRange.push(dos_value_spin1);
//if (pSpin2 !== null) pointsXInPlotRange.push(pSpin2[i]);
pointsYInPlotRange.push(energy);
//console.log('POINTS : ',dos_value_spin1, energy);
this.pointsSpin1.push({x: dos_value_spin1, y: energy});
if (pSpin2 !== null){
let dos_value_spin2 = pSpin2[i]*dosValueDivisor;
let dos_value_spin2 = pSpin2[i]*dosValueFactor;
this.pointsSpin2.push({x: dos_value_spin2, y: energy});
pointsXInPlotRange.push(dos_value_spin2);
}
}
let maxDosVal = Math.max.apply(null, pointsXInPlotRange);
......
......@@ -138,13 +138,16 @@ function isInAnyNotDisabledGroup(calcId){
groups.forEach( (groupData, groupId) => {
let representative = getCalc(getCalcReprIntId(groupId));
//let codeNameTrimed= representative.code_name.trim();
let codeNameTrimed= representative.code_name.trim();
//console.log('isInAnyGroup', calcId, groupData.calcs);
/***** Exception: disable grouping for some codes
if (codeNameTrimed !== 'VASP' && codeNameTrimed !== 'FHI-aims'
&& groupData.calcs.has(calcId)) thereIs = true; */
if (groupData.calcs.has(calcId)) thereIs = true;
if (codeNameTrimed === 'exciting' && groupData.calcs.has(calcId))
thereIs = true;
/** GRouping enabled for all codes */
//if (groupData.calcs.has(calcId)) thereIs = true;
});
return thereIs;
}
......
......@@ -317,7 +317,7 @@ class ElectronicStructDetails extends DetailsViewBase{
//***util.addBandGapData(calcData, bsData);
//console.log('CODE NAME:', calc.code_name);
this.bsDosPlotter.setUpAndData(bsData, dosData, calc.code_name );
this.bsDosPlotter.setUpAndData(bsData, dosData, calc );
if (calc.has_band_structure){
......
......@@ -39,6 +39,10 @@ function buildCalcTree(calcs, calcsInGroups){
/***** Exception: disable grouping for some codes
if (codeNameTrimed !== 'VASP' && codeNameTrimed !== 'FHI-aims') */
// Grouping enabled only for exciting
if (codeNameTrimed === 'exciting'){
console.log("applying grouping " +codeNameTrimed);
if (calcTree.has(functionalType)){
let functionalMap= calcTree.get(functionalType);
......@@ -53,6 +57,7 @@ function buildCalcTree(calcs, calcsInGroups){
newFunctionalMap.set(codeNameTrimed,[groupId]);
calcTree.set(functionalType,newFunctionalMap);
}
}
});
// Simple calcs are added to the tree
......
......@@ -461,7 +461,7 @@ class Overview {
if (e.target.status === 200){
let dosData= JSON.parse(e.target.response).dos;
this.dosPlotter.setPoints(dosData);//paintPointsLine(dosData);
this.dosPlotter.setPoints(dosData, calcWithDOS);//paintPointsLine(dosData);
this.dosCalcIdBox.innerHTML = 'From calculation <b>'+calcWithDOS.id+
'</b><br><span style="font-size: 0.8em">('+calcWithDOS.functional_type+' - '+calcWithDOS.code_name+')</span>';
if (dosData.dos_values.length === 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment