Skip to content

Commit

Permalink
Corrected small inconsistency between data pulled from different sources
Browse files Browse the repository at this point in the history
  • Loading branch information
steps39 committed Aug 8, 2024
1 parent 6d7cfe0 commit 34260b8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 167 deletions.
6 changes: 3 additions & 3 deletions SedimentDataExplorer.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ <h2>Select Samples</h2>
<button onclick="flipSampleSelections(true)">Select All</button>
<button onclick="flipSampleSelections(false)">Select None</button>
<button onclick="selectHighlighted()">Select Highlighted</button>
<button onclick="closeSampleSelection()">Confirm Selection</button>
<br>
<label for="centreLat">Centre latitude:</label>
<input type="number" id="centreLat" placeholder="Leave blank for location">
Expand All @@ -81,7 +82,6 @@ <h2>Select Samples</h2>
<input type="text" id="containsText">
<button onclick="applySampleFilter()">Apply</button>
<div id="sampleCheckboxes"></div>
<button onclick="closeSampleSelection()">Confirm Selection</button>
</div>

<div id="chemicalModal" style="display: none;">
Expand Down Expand Up @@ -124,8 +124,8 @@ <h2>Select Chemicals</h2>
<label for="positionplace">Plot by position</label>
<input type="checkbox" id="gorhamtest" checked>
<label for="gorhamtest">PAH - Gorham Test Protocol</label>
<input type="checkbox" id="totalHC" checked>
<label for="totalHC">PAH - Total hydrocarbons & Total PAHs/THC</label>
<input type="checkbox" id="totalhc" checked>
<label for="totalhc">PAH - Total hydrocarbons & Total PAHs/THC</label>
<input type="checkbox" id="pahratios" checked>
<label for="pahratios">PAH - Ratios</label>
<input type="checkbox" id="ringfractions" checked>
Expand Down
4 changes: 3 additions & 1 deletion SedimentDataExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
sheetName = dataSheetNames[i];
sheetsToDisplay[sheetName] = true;
}
subChartNames = ['samplegroup','chemicalgroup','positionplace','gorhamtest','totalHC','pahratios','ringfractions','eparatios','simpleratios','congenertest']
subChartNames = ['samplegroup','chemicalgroup','positionplace','gorhamtest','totalhc','pahratios','ringfractions','eparatios','simpleratios','congenertest']
subsToDisplay = {};
for (i = 0; i < subChartNames.length; i++) {
subName = subChartNames[i];
Expand Down Expand Up @@ -492,6 +492,8 @@ console.log('End of processExcelLocations');
}
// Check all the boxes set in url
for (let i = 0; i < sels.length; i++) {
//console.log(i);
//console.log(sels[i]);
const checkbox = document.getElementById(sels[i]);
checkbox.checked = true;
}
Expand Down
3 changes: 2 additions & 1 deletion sdeCharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ function dataForCharting(sheetName) {
}
});
unitTitle = blankSheets[ct]['Unit of measurement'];
console.log(sheetName,measChart);
return {unitTitle, measChart}
}

Expand Down Expand Up @@ -622,7 +623,7 @@ function dataForScatterCharting(sheetName) {
x: 15,
y: 10
}];*/
//console.log('data ',scatterData);
//console.log('data ',sheetName,scatterData);
return {unitTitle, scatterData, chemicalData}
}

Expand Down
7 changes: 5 additions & 2 deletions sdeDataUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ function pahPostProcess(newMeas) {
if ('Acenapthene' in chemicals) {
//If totalHC not read then set to zero
if (!('totalHC' in sampleMeasurements[dateSampled][sheetName])) {
sampleMeasurements[dateSampled][sheetName].totalHC = {};
thc = {};
// sampleMeasurements[dateSampled][sheetName].totalHC = [];
for(sample in sampleMeasurements[dateSampled][sheetName].chemicals['Acenapthene'].samples) {
totalHC[sample] = 0.0;
thc[sample] = 0.0;
// totalHC[sample] = 0.0;
}
sampleMeasurements[dateSampled][sheetName].totalHC = thc;
}

// mmeas = newMeas[sheetName];
Expand Down
162 changes: 2 additions & 160 deletions sdeDredgeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ddLookup.chemical = {'pcb101' : "2,2',4,5,5'-Pentachlorobiphenyl" , 'pcb105' : "
'chrysene' : "Chrysene" , 'dibenzah' : "Dibenz[a,h]anthracene" , 'flurant' : "Fluoranthene" , 'fluorene' : "Fluorene" , 'indypr' : "Indeno[123-c,d]pyrene" ,
'napth' : "Napthalene" , 'perylene' : "Perylene" , 'phenant' : "Phenanthrene" , 'pyrene' : "Pyrene" , 'thc' : "totalHC" ,
'ahch' : "alpha-hexachlorocyclohexane (AHCH)" , 'bhch' : "beta-hexachlorocyclohexane (BHCH)" , 'ghch' : "gamma-hexachlorocyclohexane (GHCH)" ,
'dieldrin' : "Dieldrin" , 'hcb' : "Hexachlorobenzene (HCB)" , 'dde' : "1,1-Dichloro-2,2-bis (p-chlorophenyl)ethylene (PPDDE)" ,
'ddt' : "Dichlorodiphenyltrichloroethane (PPDDT)" , 'tde' : "1,1-dichloro-2,2-bis (p-chlorophenyl)ethane (PPTDE)" ,
'dieldrin' : "Dieldrin" , 'hcb' : "Hexachlorobenzene (HCB)" , 'dde' : "1,1-Dichloro-2,2-bis(p-chlorophenyl) ethylene (PPDDE)" ,
'ddt' : "Dichlorodiphenyltrichloroethane (PPDDT)" , 'tde' : "1,1-dichloro-2,2-bis(p-chlorophenyl)ethane (PPTDE)" ,
'bde100' : "2,2′,4,4′,6-penta-bromodiphenylether (BDE100)" , 'bde138' : "Hexabromodiphenylether (BDE138)" ,
'bde153' : "2,2′,4,4′,5,5′-hexa-bromodiphenylether (BDE153)" , 'bde154' : "2,2′,4,4′,5,6′-hexa-bromodiphenylether (BDE154)" ,
'bde17' : "2,2´,4-tri-bromodiphenylether (BDE17)" , 'bde183' : "2,2′,3,4,4′,5′,6-heptabromodiphenylether (BDE183)" ,
Expand All @@ -40,165 +40,10 @@ ddLookup.chemical = {'pcb101' : "2,2',4,5,5'-Pentachlorobiphenyl" , 'pcb105' : "
'bde66' : "BDE data" , 'bde85' : "BDE data" , 'bde99' : "BDE data" , 'dbt' : "Organotins data" , 'tbt' : "Organotins data" , 'as' : "Trace metal data" ,
'cd' : "Trace metal data" , 'cr' : "Trace metal data" , 'cu' : "Trace metal data" , 'hg' : "Trace metal data" , 'ni' : "Trace metal data" ,
'pb' : "Trace metal data" , 'zn' : "Trace metal data"};
/*ddLookup.chemical['pcb101']="2,2',4,5,5'-Pentachlorobiphenyl";
ddLookup.chemical['pcb105']="2,3,3',4,4'-Pentachlorobiphenyl";
ddLookup.chemical['pcb110']="2,3,3',4',6-Pentachlorobiphenyl";
ddLookup.chemical['pcb118']="2,3',4,4',5-Pentachlorobiphenyl";
ddLookup.chemical['pcb128']="2,2',3,3',4,4'-Hexachlorobiphenyl";
ddLookup.chemical['pcb138']="2,2',3,4,4',5'-Hexachlorobiphenyl";
ddLookup.chemical['pcb141']="2,2',3,4,5,5'-Hexachlorobiphenyl";
ddLookup.chemical['pcb149']="2,2',3,4',5',6-Hexachlorobiphenyl";
ddLookup.chemical['pcb151']="2,2',3,5,5',6-Hexachlorobiphenyl";
ddLookup.chemical['pcb153']="2,2',4,4',5,5'-Hexachlorobiphenyl";
ddLookup.chemical['pcb156']="2,3,3',4,4',5-Hexachlorobiphenyl";
ddLookup.chemical['pcb158']="2,3,3',4,4',6-Hexachlorobiphenyl";
ddLookup.chemical['pcb170']="2,2',3,3',4,4',5-Heptachlorobiphenyl";
ddLookup.chemical['pcb18']="2,2',5- Trichlorobiphenyl";
ddLookup.chemical['pcb180']="2,2',3,4,4',5,5'-Heptachlorobiphenyl";
ddLookup.chemical['pcb183']="2,2',3,4,4',5',6-Heptachlorobiphenyl";
ddLookup.chemical['pcb187']="2,2',3,4',5,5',6-Heptachlorobiphenyl";
ddLookup.chemical['pcb194']="2,2',3,3',4,4',5,5'-Octachlorobiphenyl";
ddLookup.chemical['pcb28']="2,4,4'-Trichlorobiphenyl";
ddLookup.chemical['pcb31']="2,4',5-Trichlorobiphenyl";
ddLookup.chemical['pcb44']="2,2',3,5'-Tetrachlorobiphenyl";
ddLookup.chemical['pcb47']="2,2',4,4'-Tetrachlorobiphenyl";
ddLookup.chemical['pcb49']="2,2',4,5'-Tetrachlorobiphenyl";
ddLookup.chemical['pcb52']="2,2',5,5'-Tetrachlorobiphenyl";
ddLookup.chemical['pcb66']="2,3',4,4'-Tetrachlorobiphenyl";
ddLookup.chemical['acenapth']="Acenapthene";
ddLookup.chemical['acenapthylene']="Acenapthylene";
ddLookup.chemical['anthracn']="Anthracene";
ddLookup.chemical['baa']="Benz[a]anthracene";
ddLookup.chemical['bap']="Benzo[a]pyrene";
ddLookup.chemical['bbf']="Benzo[b]fluoranthene";
ddLookup.chemical['benzghip']="Benzo[g,h,i]perylene";
ddLookup.chemical['bep']="Benzo[e]pyrene";
ddLookup.chemical['bkf']="Benzo[k]fluoranthene";
ddLookup.chemical['c1n']="C1-Napthalenes";
ddLookup.chemical['c1phen']="C1-Phenanthrenes";
ddLookup.chemical['c2n']="C2-Napthalenes";
ddLookup.chemical['c3n']="C3-Napthalenes";
ddLookup.chemical['chrysene']="Chrysene";
ddLookup.chemical['dibenzah']="Dibenz[a,h]anthracene";
ddLookup.chemical['flurant']="Fluoranthene";
ddLookup.chemical['fluorene']="Fluorene";
ddLookup.chemical['indypr']="Indeno[123-c,d]pyrene";
ddLookup.chemical['napth']="Napthalene";
ddLookup.chemical['perylene']="Perylene";
ddLookup.chemical['phenant']="Phenanthrene";
ddLookup.chemical['pyrene']="Pyrene";
ddLookup.chemical['thc']="totalHC";
ddLookup.chemical['ahch']="alpha-hexachlorocyclohexane (AHCH)";
ddLookup.chemical['bhch']="beta-hexachlorocyclohexane (BHCH)";
ddLookup.chemical['ghch']="gamma-hexachlorocyclohexane (GHCH)";
ddLookup.chemical['dieldrin']="Dieldrin";
ddLookup.chemical['hcb']="Hexachlorobenzene (HCB)";
ddLookup.chemical['dde']="1,1-Dichloro-2,2-bis (p-chlorophenyl)ethylene (PPDDE)";
ddLookup.chemical['ddt']="Dichlorodiphenyltrichloroethane (PPDDT)";
ddLookup.chemical['tde']="1,1-dichloro-2,2-bis (p-chlorophenyl)ethane (PPTDE)";
ddLookup.chemical['bde100']="2,2′,4,4′,6-penta-bromodiphenylether (BDE100)";
ddLookup.chemical['bde138']="Hexabromodiphenylether (BDE138)";
ddLookup.chemical['bde153']="2,2′,4,4′,5,5′-hexa-bromodiphenylether (BDE153)";
ddLookup.chemical['bde154']="2,2′,4,4′,5,6′-hexa-bromodiphenylether (BDE154)";
ddLookup.chemical['bde17']="2,2´,4-tri-bromodiphenylether (BDE17)";
ddLookup.chemical['bde183']="2,2′,3,4,4′,5′,6-heptabromodiphenylether (BDE183)";
ddLookup.chemical['bde28']="2,4,4'-tribromodiphenylether (BDE28)";
ddLookup.chemical['bde47']="2,2′,4,4′-Tetrabromodiphenylether (BDE47)";
ddLookup.chemical['bde66']="2,3',4,4'-Tetrabromodiphenylether (BDE66)";
ddLookup.chemical['bde85']="2,2',3,4,4'-Pentabromodiphenylether (BDE85)";
ddLookup.chemical['bde99']="2,2',4,4',5-pentabromodiphenylether (BDE99)";
ddLookup.chemical['dbt']="Dibutyltine (DBT)";
ddLookup.chemical['tbt']="Tributyltin (TBT)";
ddLookup.chemical['as']="Arsenic (As)";
ddLookup.chemical['cd']="Cadmium (Cd)";
ddLookup.chemical['cr']="Chromium (Cr)";
ddLookup.chemical['cu']="Copper (Cu)";
ddLookup.chemical['hg']="Mercury (Hg)";
ddLookup.chemical['ni']="Nickel (Ni)";
ddLookup.chemical['pb']="Lead (Pb)";
ddLookup.chemical['zn']="Zinc (Zn)";*/

//ddLookup.chemical['BDE#209']="2,2',3,3',4,4',5,5',6,6'-decabrominateddiphenylether (BDE209)";
//[A-Z]{3}\_[0-9]{4}\_[0-9]{5}

/*ddLookup.sheet['pcb101']="PCB data";
ddLookup.sheet['pcb105']="PCB data";
ddLookup.sheet['pcb110']="PCB data";
ddLookup.sheet['pcb118']="PCB data";
ddLookup.sheet['pcb128']="PCB data";
ddLookup.sheet['pcb138']="PCB data";
ddLookup.sheet['pcb141']="PCB data";
ddLookup.sheet['pcb149']="PCB data";
ddLookup.sheet['pcb151']="PCB data";
ddLookup.sheet['pcb153']="PCB data";
ddLookup.sheet['pcb156']="PCB data";
ddLookup.sheet['pcb158']="PCB data";
ddLookup.sheet['pcb170']="PCB data";
ddLookup.sheet['pcb18']="PCB data";
ddLookup.sheet['pcb180']="PCB data";
ddLookup.sheet['pcb183']="PCB data";
ddLookup.sheet['pcb187']="PCB data";
ddLookup.sheet['pcb194']="PCB data";
ddLookup.sheet['pcb28']="PCB data";
ddLookup.sheet['pcb31']="PCB data";
ddLookup.sheet['pcb44']="PCB data";
ddLookup.sheet['pcb47']="PCB data";
ddLookup.sheet['pcb49']="PCB data";
ddLookup.sheet['pcb52']="PCB data";
ddLookup.sheet['pcb66']="PCB data";
ddLookup.sheet['acenapth']="PAH data";
ddLookup.sheet['acenapthylene']="PAH data";
ddLookup.sheet['anthracn']="PAH data";
ddLookup.sheet['baa']="PAH data";
ddLookup.sheet['bap']="PAH data";
ddLookup.sheet['bbf']="PAH data";
ddLookup.sheet['benzghip']="PAH data";
ddLookup.sheet['bep']="PAH data";
ddLookup.sheet['bkf']="PAH data";
ddLookup.sheet['c1n']="PAH data";
ddLookup.sheet['c1phen']="PAH data";
ddLookup.sheet['c2n']="PAH data";
ddLookup.sheet['c3n']="PAH data";
ddLookup.sheet['chrysene']="PAH data";
ddLookup.sheet['dibenzah']="PAH data";
ddLookup.sheet['flurant']="PAH data";
ddLookup.sheet['fluorene']="PAH data";
ddLookup.sheet['indypr']="PAH data";
ddLookup.sheet['napth']="PAH data";
ddLookup.sheet['perylene']="PAH data";
ddLookup.sheet['phenant']="PAH data";
ddLookup.sheet['pyrene']="PAH data";
ddLookup.sheet['thc']="PAH data";
ddLookup.sheet['ahch']="Organochlorine data";
ddLookup.sheet['bhch']="Organochlorine data";
ddLookup.sheet['ghch']="Organochlorine data";
ddLookup.sheet['dieldrin']="Organochlorine data";
ddLookup.sheet['hcb']="Organochlorine data";
ddLookup.sheet['dde']="Organochlorine data";
ddLookup.sheet['ddt']="Organochlorine data";
ddLookup.sheet['tde']="Organochlorine data";
ddLookup.sheet['bde100']="BDE data";
ddLookup.sheet['bde138']="BDE data";
ddLookup.sheet['bde153']="BDE data";
ddLookup.sheet['bde154']="BDE data";
ddLookup.sheet['bde17']="BDE data";
ddLookup.sheet['bde183']="BDE data";
//ddLookup.sheet['BDE#209']="BDE data";
ddLookup.sheet['bde28']="BDE data";
ddLookup.sheet['bde47']="BDE data";
ddLookup.sheet['bde66']="BDE data";
ddLookup.sheet['bde85']="BDE data";
ddLookup.sheet['bde99']="BDE data";
ddLookup.sheet['dbt']="Organotins data";
ddLookup.sheet['tbt']="Organotins data";
ddLookup.sheet['as']="Trace metal data";
ddLookup.sheet['cd']="Trace metal data";
ddLookup.sheet['cr']="Trace metal data";
ddLookup.sheet['cu']="Trace metal data";
ddLookup.sheet['hg']="Trace metal data";
ddLookup.sheet['ni']="Trace metal data";
ddLookup.sheet['pb']="Trace metal data";
ddLookup.sheet['zn']="Trace metal data";*/

ddCorrection = {'Trace metal data' : 1,'PAH data' : 1,'PCB data' : 0.001,'BDE data' : 0.001,'Organotins data' : 0.001,'Organochlorine data' : 0.001};

Expand Down Expand Up @@ -286,9 +131,6 @@ console.log(url);

// Disable user interaction
disableUserInteraction(url);




// Push each fetch promise into the array
fetchPromises.push(
Expand Down

0 comments on commit 34260b8

Please sign in to comment.