Skip to content

Commit 4d8dc4d

Browse files
committed
Correction of PAH ratios
1 parent bfb37ef commit 4d8dc4d

3 files changed

Lines changed: 46 additions & 36 deletions

File tree

SedimentDataExplorer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
<body>
3232
<div id="everything" style="display: none;">
33-
<h1>Sediment Data Explorer - v0.20250204</h1>
33+
<h1>Sediment Data Explorer - v0.20250301</h1>
3434
MMO Templates -
3535
<input type="file" id="fileInput" multiple onchange="importData()"> <!-- Allow multiple file selection -->
3636
<input type="text" id="urlInput" placeholder="Enter comma-separated URLs" onchange="importData()">

sdeCharts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,8 +1135,8 @@ if (dsiplayALs) {
11351135
}
11361136
});
11371137
maxConc = findMaxConcentration(meas);
1138-
//console.log('maxConc ',maxConc);
1139-
//console.log(meas);
1138+
//console.log('maxConc ',maxConc);
1139+
//console.log(meas);
11401140
if (maxConc > alMax) {
11411141
alMax = maxConc;
11421142
}
@@ -1146,7 +1146,7 @@ if (dsiplayALs) {
11461146
if (al2) {
11471147
chartLabel(instanceNo,alX,0.9*alMax,actionLevelColors[1],'Action Level 2 ');
11481148
chartLine(instanceNo,'Legend - Action Level 2',alX*1.4,alX*2.5,0.9*alMax,0.9*alMax,actionLevelColors[1],actionLevelDashes[1]);
1149-
console.log(sheetName,'here');
1149+
//console.log(sheetName,'here');
11501150
}
11511151
}
11521152
}

sdeDataUtilities.js

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ function pcbPostProcess(newMeas,dateSampled) {
527527
}
528528

529529
function pahPostProcess(newMeas,dateSampled) {
530+
console.log('fered');
530531
sheetName = 'PAH data';
531532
const chemicals = sampleMeasurements[dateSampled][sheetName].chemicals;
532533
if ('Acenapthene' in chemicals) {
@@ -573,14 +574,17 @@ function pahPostProcess(newMeas,dateSampled) {
573574
sampleMeasurements[dateSampled][sheetName].ratios = {};
574575
sampleMeasurements[dateSampled][sheetName].ringSums = {};
575576
sampleMeasurements[dateSampled][sheetName].simpleRatios = {};
577+
//console.log('stuff there');
576578
const allSamples = Object.keys(sampleInfo[dateSampled].position);
577579
allSamples.sort();
578580
allSamples.forEach(s => {
581+
//console.log('stuff here');
579582
const ace = chemicals['Acenapthene'].samples[s];//3
580583
const aceph = chemicals['Acenapthylene'].samples[s];//3
581584
const anth = chemicals['Anthracene'].samples[s];//3//Ant
582585
const baa = chemicals['Benz[a]anthracene'].samples[s];//4
583586
const bap = chemicals['Benzo[a]pyrene'].samples[s];//5
587+
const bep = chemicals['Benzo[e]pyrene'].samples[s];
584588
const bbf = chemicals['Benzo[b]fluoranthene'].samples[s];//4
585589
const bghip = chemicals['Benzo[g,h,i]perylene'].samples[s];//6//Bgp
586590
const bkf = chemicals['Benzo[k]fluoranthene'].samples[s];//4
@@ -592,49 +596,55 @@ function pahPostProcess(newMeas,dateSampled) {
592596
const phen = chemicals['Phenanthrene'].samples[s];//3
593597
const naph = chemicals['Napthalene'].samples[s];//2
594598
const pyr = chemicals['Pyrene'].samples[s];//4
595-
m = {};
599+
let m1 = {};
596600
//Diagnostic ratios
597601
//IP/(IP+B(ghi)P)
598-
m['IP/(IP+B(ghi)P)'] = ip / (ip + bghip);
602+
m1['IP/(IP+B(ghi)P)'] = ip / (ip + bghip);
599603
//BaA/(BaA+Chr)
600-
m['BaA/(BaA+Chr)'] = baa / (baa + chr);
604+
m1['BaA/(BaA+Chr)'] = baa / (baa + chr);
601605
//BaP/(BaP+Chr)
602-
m['BaP/(BaP+Chr)'] = bap / (bap + chr);
606+
m1['BaP/(BaP+Chr)'] = bap / (bap + chr);
603607
//Phen/(Phen+Anth)
604-
m['Phen/(Phen+Anth)'] = phen / (phen + anth);
608+
m1['Phen/(Phen+Anth)'] = phen / (phen + anth);
605609
//BaA/(BaA+BaP)
606-
m['BaA/(BaA+BaP)'] = baa / (baa + bap);
610+
m1['BaA/(BaA+BaP)'] = baa / (baa + bap);
607611
//BbF/(BbF+BkF)
608-
m['BbF/(BbF+BkF)'] = bbf / (bbf + bkf);
609-
sampleMeasurements[dateSampled][sheetName].ratios[s] = m;
610-
m = {};
612+
m1['BbF/(BbF+BkF)'] = bbf / (bbf + bkf);
613+
sampleMeasurements[dateSampled][sheetName].ratios[s] = m1;
614+
let m2 = {};
611615
// Dash Sums: L'PAHs - Phen + Anth + Flu + Pyr; H'PAHs - BaA + Chr + BbF + BkF + BaP + IP + DBA + BgP
612-
m['LdPAHs'] = phen + anth + flu + pyr;
613-
m['HdPAHs'] = baa + chr + bbf + bkf + bap + ip + dba + bghip;
614-
m['Total d PAHs'] = m['LdPAHs'] + m['HdPAHs'];
616+
m2['LdPAHs'] = phen + anth + flu + pyr;
617+
m2['HdPAHs'] = baa + chr + bbf + bkf + bap + ip + dba + bghip;
618+
m2['Total d PAHs'] = m2['LdPAHs'] + m2['HdPAHs'];
615619
// EPS Sums: LPAHs - Naph, Aceph, Ace, Fl, Phen and Ant; HPAHs - Flu, Pyr, BaA, Chr, BbF, BkF, BaP, DBA, BgP and Inp
616-
m['LPAHs'] = naph + aceph + ace + fl + phen + anth;
617-
m['HPAHs'] = flu + pyr + baa + chr + bbf + bkf + bap + dba + bghip + ip;
618-
m['Total EPA PAHs'] = m['LPAHs'] + m['HPAHs'];
620+
m2['LPAHs'] = naph + aceph + ace + fl + phen + anth;
621+
m2['HPAHs'] = flu + pyr + baa + chr + bbf + bkf + bap + dba + bghip + ip;
622+
m2['Total EPA PAHs'] = m2['LPAHs'] + m2['HPAHs'];
619623
// Ring Sums
620-
m['Sum of 2 rings'] = naph;//2
621-
m['Sum of 3 rings'] = ace + aceph + anth + fl + phen;//3
622-
m['Sum of 4 rings'] = baa + bbf + bkf + chr + flu + pyr;//4
623-
m['Sum of 5 rings'] = bap + dba + ip;//5
624-
m['Sum of 6 rings'] = bghip;//6
625-
m['Total all rings'] = m['Sum of 2 rings'] + m['Sum of 3 rings'] + m['Sum of 4 rings'] + m['Sum of 5 rings'] + m['Sum of 6 rings'];
626-
sampleMeasurements[dateSampled][sheetName].ringSums[s] = m;
627-
m = {};
628-
m['Phen/Anth'] = phen / anth;
629-
m['Flu/Pyr'] = flu / pyr;
630-
m['Baa/Chr'] = baa / chr;
631-
if (chemicals['Benzo[e]pyrene'] === undefined || chemicals['Benzo[e]pyrene'] === null) {
632-
const bep = chemicals['Benzo[e]pyrene'].sample[s];
633-
m['Bep/Bap'] = bep / bap;
634-
} else {
624+
m2['Sum of 2 rings'] = naph;//2
625+
m2['Sum of 3 rings'] = ace + aceph + anth + fl + phen;//3
626+
m2['Sum of 4 rings'] = baa + bbf + bkf + chr + flu + pyr;//4
627+
m2['Sum of 5 rings'] = bap + dba + ip;//5
628+
m2['Sum of 6 rings'] = bghip;//6
629+
m2['Total all rings'] = m2['Sum of 2 rings'] + m2['Sum of 3 rings'] + m2['Sum of 4 rings'] + m2['Sum of 5 rings'] + m2['Sum of 6 rings'];
630+
sampleMeasurements[dateSampled][sheetName].ringSums[s] = m2;
631+
let m3 = {};
632+
m3['Phen/Anth'] = phen / anth;
633+
m3['Flu/Pyr'] = flu / pyr;
634+
m3['Baa/Chr'] = baa / chr;
635+
m3['Bep/Bap'] = bep / bap;
636+
/* m['Phen/Anth'] = 10;
637+
m['Flu/Pyr'] = 10;
638+
m['Baa/Chr'] = 10;
639+
m['Bep/Bap'] = 10; // if (chemicals['Benzo[e]pyrene'] === undefined || chemicals['Benzo[e]pyrene'] === null) {
640+
// const bep = chemicals['Benzo[e]pyrene'].samples[s];
641+
console.log(bap);
642+
console.log(bep);
643+
// m['Bep/Bap'] = bep / bap;
644+
/* } else {
635645
m['Bep/Bap'] = 0;
636-
}
637-
sampleMeasurements[dateSampled][sheetName].simpleRatios[s] = m;
646+
}*/
647+
sampleMeasurements[dateSampled][sheetName].simpleRatios[s] = m3;
638648
});
639649
}
640650
}

0 commit comments

Comments
 (0)