Skip to content

Commit

Permalink
(#2816) Remove duplicate xCO2 atm column from exports
Browse files Browse the repository at this point in the history
Also fixed the remaining column header
  • Loading branch information
squaregoldfish committed May 31, 2024
1 parent fd99037 commit 842f5c9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testPropertySet() throws Exception {
}

@ParameterizedTest
@CsvSource({ "true,5", "false,3" })
@CsvSource({ "true,4", "false,2" })
public void getCalculationParametersWithCalcColumnsTest(
boolean includeCalculationColumns, int expectedSize) throws Exception {
List<CalculationParameter> params = DataReducerFactory
Expand All @@ -97,7 +97,7 @@ public void getCalculationParametersMultiVarTest() throws Exception {
Map<Variable, List<CalculationParameter>> params = DataReducerFactory
.getCalculationParameters(vars);

assertEquals(5, params.get(var1).size());
assertEquals(4, params.get(var1).size());
assertEquals(6, params.get(var2).size());
}

Expand Down Expand Up @@ -150,7 +150,7 @@ public void getCalculationParameterPositiveIDTest() throws Exception {
CalculationParameter param = DataReducerFactory
.getVariableParameter(makeVariable(), 2);

assertEquals("xCO₂ In Atmosphere", param.getLongName());
assertEquals("pCO₂ In Atmosphere", param.getLongName());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ private void runTest(String calType,
getDataSource().getConnection());

assertEquals(0.00909D, record.getCalculationValue("pH₂O"), 0.0001);
assertEquals(399.274D, record.getCalculationValue("xCO₂"), 0.0001);
assertEquals(399.71652D, record.getCalculationValue("pCO₂"), 0.0001);
assertEquals(398.0793D, record.getCalculationValue("fCO₂"), 0.0001);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ private void doSplitCalculation(DataReductionRecord record,

// Will be the same for both 12C and 13C
record.put("pH₂O", x12CO2Calculator.pH2O);
record.put("xCO₂", x12CO2 + x13CO2);
record.put("pCO₂", x12CO2Calculator.pCO2 + x13CO2Calculator.pCO2);
record.put("fCO₂", x12CO2Calculator.fCO2 + x13CO2Calculator.fCO2);
}
Expand All @@ -88,7 +87,6 @@ private void doTotalCalculation(DataReductionRecord record,
seaLevelPressure, co2);

record.put("pH₂O", calculator.pH2O);
record.put("xCO₂", co2);
record.put("pCO₂", calculator.pCO2);
record.put("fCO₂", calculator.fCO2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public void doCalculation(Instrument instrument, Measurement measurement,

record.put("Sea Level Pressure", seaLevelPressure);
record.put("pH₂O", calculator.pH2O);
record.put("xCO₂", co2InGas);
record.put("pCO₂", calculator.pCO2);
record.put("fCO₂", calculator.fCO2);
} catch (Exception e) {
Expand All @@ -81,12 +80,9 @@ public List<CalculationParameter> getCalculationParameters() {
"pH₂O", "Atmosphere Water Vapour Pressure", "CPVPZZ01", "hPa", false));

calculationParameters.add(new CalculationParameter(makeParameterId(2),
"xCO₂", "xCO₂ In Atmosphere", "XCO2DRAT", "μmol mol⁻¹", true));

calculationParameters.add(new CalculationParameter(makeParameterId(3),
"pCO₂", "pCO₂ In Atmosphere", "ACO2XXXX", "μatm", true));

calculationParameters.add(new CalculationParameter(makeParameterId(4),
calculationParameters.add(new CalculationParameter(makeParameterId(3),
"fCO₂", "fCO₂ In Atmosphere", "FCO2WTAT", "μatm", true));
}

Expand Down
2 changes: 2 additions & 0 deletions configuration/export_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"AWMXRCORR": "Atmosphere True Moisture [umol mol-1]",
"CAPAZZ01": "Atmospheric Pressure At Sea Level [hPa]",
"XCO2DRAT": "xCO2 in atmosphere [umol mol-1]",
"XCO2DCMA": "xCO2 in atmosphere [umol mol-1]",
"LPRES0EQ_equil": "LICOR Pressure (Equilibrator) [hPa]",
"LPRES0EQ_atm": "LICOR Pressure (Atmosphere) [hPa]",
"CTMPZZ01": "Atmospheric Temperature [degC]"
Expand Down Expand Up @@ -110,6 +111,7 @@
"AWMXRCORR": "Atmosphere True Moisture [umol mol-1]",
"CAPAZZ01": "Atmospheric Pressure At Sea Level [hPa]",
"XCO2DRAT": "xCO2 in atmosphere [umol mol-1]",
"XCO2DCMA": "xCO2 in atmosphere [umol mol-1]",
"LPRES0EQ_equil": "LICOR Pressure (Equilibrator) [hPa]",
"LPRES0EQ_atm": "LICOR Pressure (Atmosphere) [hPa]",
"CTMPZZ01": "Atmospheric Temperature [degC]"
Expand Down

0 comments on commit 842f5c9

Please sign in to comment.