From 6609a57debdb3c25787af564dbb236e77b5091b1 Mon Sep 17 00:00:00 2001 From: bowring Date: Mon, 22 Feb 2016 18:02:09 -0500 Subject: [PATCH 01/10] added more verbose progress to Shrimp file ingestion --- .../handlers/shrimp/ShrimpFileHandler.java | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java b/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java index 0755c878..a53ac0d0 100644 --- a/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java +++ b/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java @@ -18,7 +18,6 @@ package org.earthtime.Tripoli.rawDataFiles.handlers.shrimp; import java.io.File; -import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Locale; @@ -27,7 +26,6 @@ import javax.swing.JOptionPane; import javax.swing.SwingWorker; import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import org.cirdles.shrimp.PrawnFile; import org.earthtime.Tripoli.dataModels.DataModelInterface; @@ -163,7 +161,9 @@ protected SortedSet loadRawDataFile(// JAXBContext jaxbContext = JAXBContext.newInstance(PrawnFile.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); - prawnFile = (PrawnFile) jaxbUnmarshaller.unmarshal(url);// url); + // show some progress + loadDataTask.firePropertyChange("progress", 0, 10); + prawnFile = (PrawnFile) jaxbUnmarshaller.unmarshal(url); // send name to project loadDataTask.firePropertyChange("projectName", "", prawnFile.getMount()); @@ -174,29 +174,41 @@ protected SortedSet loadRawDataFile(// if (loadDataTask.isCancelled()) { break; } - loadDataTask.firePropertyChange("progress", 0, ((100 * f) / prawnFile.getRuns())); + loadDataTask.firePropertyChange("progress", 0, 10 + ((95 * f) / prawnFile.getRuns())); + // assume we are golden + // a 'run' is an analysis or fraction + for (int f = ignoreFirstFractions; f < prawnFile.getRuns(); f++) { - PrawnFile.Run runFraction = prawnFile.getRun().get(f); + if (loadDataTask.isCancelled()) { + break; + } + loadDataTask.firePropertyChange("progress", 0, ((100 * f) / prawnFile.getRuns())); - TripoliFraction tripoliFraction = processRunFraction(runFraction); + PrawnFile.Run runFraction = prawnFile.getRun().get(f); - // determine if standard reference material - myTripoliFractions.add(tripoliFraction); + TripoliFraction tripoliFraction = processRunFraction(runFraction); - } // end of files loop + // determine if standard reference material + myTripoliFractions.add(tripoliFraction); - if (myTripoliFractions.isEmpty()) { - myTripoliFractions = null; - } - } catch (JAXBException | MalformedURLException jAXBException) { + } // end of files loop + + if (myTripoliFractions.isEmpty()) { + myTripoliFractions = null; + } + }catch (JAXBException | MalformedURLException jAXBException) { JOptionPane.showMessageDialog( null, new String[]{"Selected Prawn file does not conform to schema."}, "ET Redux Warning", JOptionPane.WARNING_MESSAGE); } - return myTripoliFractions; - } + return myTripoliFractions; + } + + + + private TripoliFraction processRunFraction(PrawnFile.Run runFraction) { String fractionID = runFraction.getPar().get(0).getValue(); @@ -267,10 +279,10 @@ private TripoliFraction processRunFraction(PrawnFile.Run runFraction) { massSpec.processFractionRawRatiosII(// backgroundAcquisitions, peakAcquisitions, true, tripoliFraction); - + // supply calculated variances - ((ShrimpSetupUPb)massSpec).initializeVariances(peakAcquisitionsVariances); - + ((ShrimpSetupUPb) massSpec).initializeVariances(peakAcquisitionsVariances); + tripoliFraction.shadeDataActiveMapLeft(0); System.out.println("\n**** SHRIMP FractionID " + fractionID + " refMat? " + tripoliFraction.isStandard() + " <<<<<<<<<<<<<<<<<<\n"); From cbf838568038b20ef0be01b80bbd87b206f88be3 Mon Sep 17 00:00:00 2001 From: bowring Date: Mon, 22 Feb 2016 22:22:53 -0500 Subject: [PATCH 02/10] refactor shrimp file handler --- .../handlers/shrimp/ShrimpFileHandler.java | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java b/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java index a53ac0d0..dca607d3 100644 --- a/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java +++ b/src/main/java/org/earthtime/Tripoli/rawDataFiles/handlers/shrimp/ShrimpFileHandler.java @@ -18,6 +18,7 @@ package org.earthtime.Tripoli.rawDataFiles.handlers.shrimp; import java.io.File; +import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Locale; @@ -26,6 +27,7 @@ import javax.swing.JOptionPane; import javax.swing.SwingWorker; import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import org.cirdles.shrimp.PrawnFile; import org.earthtime.Tripoli.dataModels.DataModelInterface; @@ -152,11 +154,12 @@ protected SortedSet loadRawDataFile(// SwingWorker loadDataTask, boolean usingFullPropagation, int leftShadeCount, int ignoreFirstFractions) { SortedSet myTripoliFractions = new TreeSet<>(); - PrawnFile prawnFile = null; + PrawnFile prawnFile; +// try { + // remote copy of example file + java.net.URL url; try { - // remote copy of example file - java.net.URL url = null; url = new URL("https://raw.githubusercontent.com/bowring/XSD/master/SHRIMP/EXAMPLE_100142_G6147_10111109.43_10.33.37%20AM.xml"); JAXBContext jaxbContext = JAXBContext.newInstance(PrawnFile.class); @@ -174,41 +177,30 @@ protected SortedSet loadRawDataFile(// if (loadDataTask.isCancelled()) { break; } - loadDataTask.firePropertyChange("progress", 0, 10 + ((95 * f) / prawnFile.getRuns())); - // assume we are golden - // a 'run' is an analysis or fraction - for (int f = ignoreFirstFractions; f < prawnFile.getRuns(); f++) { + loadDataTask.firePropertyChange("progress", 10, ((90 * f) / prawnFile.getRuns())); - if (loadDataTask.isCancelled()) { - break; - } - loadDataTask.firePropertyChange("progress", 0, ((100 * f) / prawnFile.getRuns())); + PrawnFile.Run runFraction = prawnFile.getRun().get(f); - PrawnFile.Run runFraction = prawnFile.getRun().get(f); + TripoliFraction tripoliFraction = processRunFraction(runFraction); - TripoliFraction tripoliFraction = processRunFraction(runFraction); + // determine if standard reference material + myTripoliFractions.add(tripoliFraction); - // determine if standard reference material - myTripoliFractions.add(tripoliFraction); + } // end of files loop - } // end of files loop + if (myTripoliFractions.isEmpty()) { + myTripoliFractions = null; + } - if (myTripoliFractions.isEmpty()) { - myTripoliFractions = null; - } - }catch (JAXBException | MalformedURLException jAXBException) { + } catch (JAXBException | MalformedURLException jAXBException) { JOptionPane.showMessageDialog( null, new String[]{"Selected Prawn file does not conform to schema."}, "ET Redux Warning", JOptionPane.WARNING_MESSAGE); } - return myTripoliFractions; - } - - - - + return myTripoliFractions; + } private TripoliFraction processRunFraction(PrawnFile.Run runFraction) { String fractionID = runFraction.getPar().get(0).getValue(); From b6665fea295855e00eda4ffe601296f155f12f15 Mon Sep 17 00:00:00 2001 From: bowring Date: Wed, 24 Feb 2016 06:56:31 -0500 Subject: [PATCH 03/10] made sliders more responsive to user changes in view for sessionWorkflowManagers --- .../TripoliSessionRawDataView.java | 21 ++++++++++++------- ...ssionAnalysisWorkflowManagerInterface.java | 2 ++ ...SessionAnalysisWorkflowManagerLAICPMS.java | 8 ++++++- .../SessionAnalysisWorkflowManagerSHRIMP.java | 8 ++++++- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java b/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java index f02ad36e..eb456e19 100644 --- a/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java +++ b/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java @@ -62,6 +62,7 @@ import org.earthtime.Tripoli.sessions.TripoliSessionFractionationCalculatorInterface; import org.earthtime.Tripoli.sessions.TripoliSessionInterface; import org.earthtime.UPb_Redux.ReduxConstants; +import org.earthtime.UPb_Redux.dialogs.sessionManagers.SessionAnalysisWorkflowManagerInterface; import org.earthtime.UPb_Redux.fractions.FractionsFilterInterface; import org.earthtime.dataDictionaries.DataPresentationModeEnum; import org.earthtime.dataDictionaries.FractionLayoutViewStylesEnum; @@ -128,6 +129,7 @@ public class TripoliSessionRawDataView extends AbstractRawDataView implements Tr private final JLayeredPane tripoliSessionDataHeader_pane; private final JLayeredPane tripoliSessionDataControls_pane; private AbstractRawDataView dataPresentationModeChooserPanel; + private SessionAnalysisWorkflowManagerInterface sessionAnalysisWorkflowManager; /** * @@ -142,19 +144,18 @@ public class TripoliSessionRawDataView extends AbstractRawDataView implements Tr * @param tripoliSessionDataHeader_pane * @param tripoliSessionDataControls_pane * @param scrollBounds + * @param sessionAnalysisWorkflowManager the value of sessionAnalysisWorkflowManager */ public TripoliSessionRawDataView(// - ETReduxFrame myUPbReduxFrame, - TripoliSessionInterface tripoliSession,// - Constructor dataModelViewConstructor,// - Method rawDataSourceMethod,// + ETReduxFrame myUPbReduxFrame, TripoliSessionInterface tripoliSession, // + Constructor dataModelViewConstructor, Method rawDataSourceMethod, // FractionLayoutViewStylesEnum fractionLayoutViewStyle, // - JSlider yAxisZoomSlider, // - JSlider xAxisZoomSlider, // - JLayeredPane tripoliSessionRawDataViewYAxis,// + JSlider yAxisZoomSlider, JSlider xAxisZoomSlider, // + JLayeredPane tripoliSessionRawDataViewYAxis, // JLayeredPane tripoliSessionDataHeader_pane, // JLayeredPane tripoliSessionDataControls_pane,// - Rectangle scrollBounds) { + Rectangle scrollBounds, // + SessionAnalysisWorkflowManagerInterface sessionAnalysisWorkflowManager) { super(scrollBounds); uPbReduxFrame = myUPbReduxFrame; @@ -186,6 +187,8 @@ public TripoliSessionRawDataView(// this.zoomSlidersIndependent = true; this.sessionFractionationCalculator = null; + + this.sessionAnalysisWorkflowManager = sessionAnalysisWorkflowManager; setBackground(new Color(204, 204, 204)); @@ -371,6 +374,7 @@ public void stateChanged(ChangeEvent e) { theOtherSlider.setValue(value); } ((AbstractRawDataView) sampleSessionDataView).refreshPanel(); + sessionAnalysisWorkflowManager.revalidateScrollPane(); } } } @@ -411,6 +415,7 @@ public void stateChanged(ChangeEvent e) { theOtherSlider.setValue(value); } ((AbstractRawDataView) sampleSessionDataView).refreshPanel(); + sessionAnalysisWorkflowManager.revalidateScrollPane(); } } } diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerInterface.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerInterface.java index 31cb8780..e5325c28 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerInterface.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerInterface.java @@ -44,4 +44,6 @@ public interface SessionAnalysisWorkflowManagerInterface { * */ public void setupTripoliSessionRawDataView(); + + public void revalidateScrollPane(); } diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java index dfae59d6..5ef78d17 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java @@ -183,6 +183,7 @@ public void setupTripoliSessionRawDataView() { // create data viewing pane tripoliSessionRawDataView = new TripoliSessionRawDataView( // + // uPbReduxFrame,// tripoliSession,// dataModelViewConstructorFactory(RawIntensitiesDataView.class.getName()),// @@ -193,7 +194,7 @@ public void setupTripoliSessionRawDataView() { tripoliSessionRawDataViewYAxis, // tripoliSessionDataHeader_pane,// tripoliSessionDataControls_pane, // - tripoliSessionDataView_scrollPane.getBounds()); + tripoliSessionDataView_scrollPane.getBounds(), this); // set sampleFractionationCalculator ((TripoliSessionRawDataView) tripoliSessionRawDataView).setSessionFractionationCalculator(tripoliSession); @@ -1748,4 +1749,9 @@ public void setTripoliSession(TripoliSessionInterface tripoliSession) { this.tripoliSession = tripoliSession; } + @Override + public void revalidateScrollPane() { + tripoliSessionDataView_scrollPane.revalidate(); + } + } diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerSHRIMP.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerSHRIMP.java index cb81020a..1c67342a 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerSHRIMP.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerSHRIMP.java @@ -184,6 +184,7 @@ public void setupTripoliSessionRawDataView() { // create data viewing pane tripoliSessionRawDataView = new TripoliSessionRawDataView( // + // uPbReduxFrame,// tripoliSession,// dataModelViewConstructorFactory(RawIntensitiesDataView.class.getName()),// @@ -194,7 +195,7 @@ public void setupTripoliSessionRawDataView() { tripoliSessionRawDataViewYAxis, // tripoliSessionDataHeader_pane,// tripoliSessionDataControls_pane, // - tripoliSessionDataView_scrollPane.getBounds()); + tripoliSessionDataView_scrollPane.getBounds(), this); // set sampleFractionationCalculator ((TripoliSessionRawDataView) tripoliSessionRawDataView).setSessionFractionationCalculator(tripoliSession); @@ -1752,4 +1753,9 @@ public void setTripoliSession(TripoliSessionInterface tripoliSession) { this.tripoliSession = tripoliSession; } + @Override + public void revalidateScrollPane() { + tripoliSessionDataView_scrollPane.revalidate(); + } + } From 24490c15af884dc00af72f831e35ad943239cfae Mon Sep 17 00:00:00 2001 From: bowring Date: Thu, 25 Feb 2016 07:04:06 -0500 Subject: [PATCH 04/10] refactoring --- .../dataViews/overlayViews/TripoliSessionRawDataView.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java b/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java index eb456e19..7a17f883 100644 --- a/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java +++ b/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java @@ -147,7 +147,8 @@ public class TripoliSessionRawDataView extends AbstractRawDataView implements Tr * @param sessionAnalysisWorkflowManager the value of sessionAnalysisWorkflowManager */ public TripoliSessionRawDataView(// - ETReduxFrame myUPbReduxFrame, TripoliSessionInterface tripoliSession, // + ETReduxFrame myUPbReduxFrame, // + TripoliSessionInterface tripoliSession, // Constructor dataModelViewConstructor, Method rawDataSourceMethod, // FractionLayoutViewStylesEnum fractionLayoutViewStyle, // JSlider yAxisZoomSlider, JSlider xAxisZoomSlider, // @@ -158,7 +159,7 @@ public TripoliSessionRawDataView(// SessionAnalysisWorkflowManagerInterface sessionAnalysisWorkflowManager) { super(scrollBounds); - uPbReduxFrame = myUPbReduxFrame; + this.uPbReduxFrame = myUPbReduxFrame; this.tripoliSession = tripoliSession; this.fractionSelectionType = FractionSelectionTypeEnum.STANDARD; this.fractionIncludedType = IncludedTypeEnum.ALL; From 0693b766c2016c32b8dc4e46e00693bd8b5ea2cb Mon Sep 17 00:00:00 2001 From: bowring Date: Thu, 25 Feb 2016 07:04:31 -0500 Subject: [PATCH 05/10] progress on DIBBs math --- .../fractionReduction/UThFractionReducer.java | 243 +++++++++++++++--- .../fractionReduction/FractionReducer.java | 14 + 2 files changed, 220 insertions(+), 37 deletions(-) diff --git a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java index a010740a..ae10fe09 100644 --- a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java +++ b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java @@ -20,6 +20,7 @@ import Jama.Matrix; import java.math.BigDecimal; import org.earthtime.UPb_Redux.ReduxConstants; +import org.earthtime.UPb_Redux.valueModels.ValueModel; import org.earthtime.UTh_Redux.fractions.UThLegacyFractionI; import org.earthtime.dataDictionaries.UThAnalysisMeasures; import org.earthtime.dataDictionaries.UThFractionationCorrectedIsotopicRatios; @@ -111,7 +112,12 @@ The function blkdiag() takes the inputs and places them along the diagonal of a */ public class UThFractionReducer extends FractionReducer { - private static UThFractionReducer instance; + private static UThFractionReducer instance = new UThFractionReducer(); + private static Matrix exponentialA; + private static Matrix exponentialQUTh; + private static Matrix exponentialQinvUTh; + private static Matrix numberAtomsTimeT; + private static double r230_238InitialT; private UThFractionReducer() { } @@ -121,9 +127,6 @@ private UThFractionReducer() { * @return */ public static UThFractionReducer getInstance() { - if (instance == null) { - instance = new UThFractionReducer(); - } return instance; } @@ -137,18 +140,19 @@ public static void reduceFraction(UThLegacyFractionI fraction) { private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { + // matlab code meas + ValueModel r234U_238Ufc = fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r234U_238Ufc.getName()); + ValueModel r230Th_238Ufc = fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r230Th_238Ufc.getName()); + ValueModel r232Th_238Ufc = fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r232Th_238Ufc.getName()); + + // matlab code meas.C + Matrix covariance_fc = new Matrix(3, 3); + covariance_fc.set(0, 0, r234U_238Ufc.getOneSigmaAbs().pow(2).doubleValue()); + covariance_fc.set(1, 1, r230Th_238Ufc.getOneSigmaAbs().pow(2).doubleValue()); + covariance_fc.set(2, 2, r232Th_238Ufc.getOneSigmaAbs().pow(2).doubleValue()); + // todo: make a model for handling - // The variable detritus is a matrix (2D array) with six rows and two columns, indexed starting at 1. - // detritus(1,1) is the detrital initial 232Th/238U activity ratio - // detritus(1,2) is its 2-sigma absolute uncertainty - // detritus(2,1) is the detrital initial 230Th/238U activity ratio - // detritus(2,2) is its 2-sigma absolute uncertainty - // detritus(3,1) is the detrital initial 234U/238U activity ratio - // detritus(3,2) is its 2-sigma absolute uncertainty - // detritus(4,1) is the correlation coefficient between the 232Th/238U - 230Th/238U activity ratio uncertainties - // detritus(5,1) is the correlation coefficient between the 232Th/238U - 234U/238U activity ratio uncertainties - // detritus(6,1) is the correlation coefficient between the 230Th/238U - 234U/238U activity ratio uncertainties - // detritus(6,2) is the number of years between 1950 and the date of the analysis. + // TOD Decide why not use one sigma in model as usual ??? // The detritus variable is not at present included in Andrea's worksheet. // We'll have to add it, though, when we make UTh_Redux capable of handling more data. // Here are some typical values: @@ -164,36 +168,201 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { detritus.set(5, 0, 0.5); //detritus(6,1) = 0.5; detritus.set(5, 1, 65.0); //detritus(6,2) = 65; - // di = detrital initial isotoipic ratio - double r232Th_238Udi = detritus.get(0, 0) * lambda238.getValue().doubleValue() / lambda232.getValue().doubleValue(); - double r230Th_238Udi = detritus.get(1, 0) * lambda238.getValue().doubleValue() / lambda230.getValue().doubleValue(); - double r234U_238Udi = detritus.get(2, 0) * lambda238.getValue().doubleValue() / lambda234.getValue().doubleValue(); + // di = detrital initial isotopic ratio + double r232Th_238Udi = detritus.get(0, 0) * lambda238D / lambda232D; + double r230Th_238Udi = detritus.get(1, 0) * lambda238D / lambda230D; + double r234U_238Udi = detritus.get(2, 0) * lambda238D / lambda234D; + // assuming detritus stores 1-sigma abs double r232Th_238Udi_sigma = detritus.get(0, 1) / detritus.get(0, 0) * r232Th_238Udi; double r230Th_238Udi_sigma = detritus.get(1, 1) / detritus.get(1, 0) * r230Th_238Udi; double r234U_238Udi_sigma = detritus.get(2, 1) / detritus.get(2, 0) * r234U_238Udi; - Matrix Cov_di = new Matrix(3, 3); - Cov_di.set(0, 0, r234U_238Udi_sigma * r234U_238Udi_sigma); - Cov_di.set(1, 1, r230Th_238Udi_sigma * r230Th_238Udi_sigma); - Cov_di.set(2, 2, r232Th_238Udi_sigma * r232Th_238Udi_sigma); - - Cov_di.set(0, 1, detritus.get(5, 0) * r234U_238Udi_sigma * r230Th_238Udi_sigma); - Cov_di.set(0, 2, detritus.get(4, 0) * r234U_238Udi_sigma * r232Th_238Udi_sigma); - Cov_di.set(1, 2, detritus.get(3, 0) * r230Th_238Udi_sigma); - Cov_di.set(1, 0, Cov_di.get(0, 1)); - Cov_di.set(2, 0, Cov_di.get(0, 2)); - Cov_di.set(2, 1, Cov_di.get(1, 2)); + Matrix covariance_di = new Matrix(3, 3); + covariance_di.set(0, 0, r234U_238Udi_sigma * r234U_238Udi_sigma); + covariance_di.set(1, 1, r230Th_238Udi_sigma * r230Th_238Udi_sigma); + covariance_di.set(2, 2, r232Th_238Udi_sigma * r232Th_238Udi_sigma); + + covariance_di.set(0, 1, detritus.get(5, 0) * r234U_238Udi_sigma * r230Th_238Udi_sigma); + covariance_di.set(0, 2, detritus.get(4, 0) * r234U_238Udi_sigma * r232Th_238Udi_sigma); + covariance_di.set(1, 2, detritus.get(3, 0) * r230Th_238Udi_sigma * r232Th_238Udi_sigma); + covariance_di.set(1, 0, covariance_di.get(0, 1)); + covariance_di.set(2, 0, covariance_di.get(0, 2)); + covariance_di.set(2, 1, covariance_di.get(1, 2)); double yearsSince1950_di = detritus.get(5, 1); - Matrix measuredCovariance = new Matrix(3, 3); - measuredCovariance.set(0, 0, // - fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r234U_238Ufc.getName()).getOneSigmaAbs().pow(2).doubleValue()); - measuredCovariance.set(1, 1, // - fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r230Th_238Ufc.getName()).getOneSigmaAbs().pow(2).doubleValue()); - measuredCovariance.set(2, 2, // - fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r232Th_238Ufc.getName()).getOneSigmaAbs().pow(2).doubleValue()); + Matrix covariance_in = new Matrix(6, 6); + covariance_in.setMatrix(0, 2, 0, 2, covariance_fc); + covariance_in.setMatrix(3, 5, 3, 5, covariance_di); + + exponentialA = new Matrix(new double[][]{// + {-lambda238D, 0., 0.},// + {lambda238D, -lambda234D, 0.},// + {0., lambda234D, -lambda230D}}); + + exponentialQUTh = new Matrix(new double[][]{// + {((lambda230D - lambda238D) * (lambda234D - lambda238D)) / (lambda234D * lambda238D), 0., 0.},// + {(lambda230D - lambda238D) / lambda234D, (lambda230D - lambda234D) / lambda234D, 0.},// + {1., 1., 1.}}); + + exponentialQinvUTh = new Matrix(new double[][]{// + {(lambda234D * lambda238D) / ((lambda230D - lambda238D) * (lambda234D - lambda238D)), 0., 0.},// + {-(lambda234D * lambda238D) / ((lambda230D - lambda234D) * (lambda234D - lambda238D)), lambda234D / (lambda230D - lambda234D), 0.},// + {(lambda234D * lambda238D) / ((lambda230D - lambda234D) * (lambda230D - lambda238D)), -lambda234D / (lambda230D - lambda234D), 1.}}); + + double tPrecision = 1e-14; + int iterationMax = 50; + + r230_238InitialT = r232Th_238Ufc.getValue().doubleValue() * (r230Th_238Udi / r232Th_238Udi); + + numberAtomsTimeT = new Matrix(3, 1); + numberAtomsTimeT.set(0, 0, 1.); + numberAtomsTimeT.set(1, 0, r234U_238Ufc.getValue().doubleValue()); + numberAtomsTimeT.set(2, 0, r230Th_238Ufc.getValue().doubleValue()); + + Matrix tv = new Matrix(iterationMax, 1, 0.0); + + double slope = 0.0; + if (r234U_238Ufc.getValue().doubleValue() < (1.47091e-05 + 2.44231 * r230Th_238Ufc.getValue().doubleValue())) { + // t > 400 ka + //slope from IC of initial 234U=0 at 400 ka to measured point + slope = (r234U_238Ufc.getValue().doubleValue() - 3.71920e-05) / (r230Th_238Ufc.getValue().doubleValue() - 9.20522e-06); + // estimated age based on rotation of isochron + tv.set(0, 0, (54.0138 - (43.3520 * slope) + (8.762243 * slope * slope)) * 1e6); + } else if (r234U_238Ufc.getValue().doubleValue() < (0.0000105036 + 3.128406 * r230Th_238Ufc.getValue().doubleValue())) { + // 200 ka < t < 400 ka + // slope from IC of initial 234U=0 at 200 ka to measured point + slope = (r234U_238Ufc.getValue().doubleValue() - 2.37086e-05) / (r230Th_238Ufc.getValue().doubleValue() - 4.2209e-06); + // estimated age based on rotation of isochron + tv.set(0, 0, (4.80518 - (2.89959 * slope) + (0.4567031 * slope * slope)) * 1e6); + } else { + //t < 200 ka + tv.set(0, 0, -350194.43 * r230Th_238Ufc.getValue().doubleValue() / (1.559285 * r230Th_238Ufc.getValue().doubleValue() - r234U_238Ufc.getValue().doubleValue())); + } + + // solve for 230 Th date + int iNR = 1; + tv.set(1, 0, tv.get(0, 0) - ft(tv.get(0, 0)) / fpt(tv.get(0, 0))); + + while ((Math.abs(tv.get(iNR, 0) - tv.get(iNR - 1, 0)) / tv.get(iNR, 0) > tPrecision) && (iNR < iterationMax)) { + iNR++; + tv.set(iNR, 0, tv.get(iNR - 1, 0) - ft(tv.get(iNR - 1, 0)) / fpt(tv.get(iNR - 1, 0))); // Newton - Raphson + } + double timeUncorrected = tv.get(iNR, 0); + + // Solve for detrital-corrected age + iNR = 1; + tv.set(0, 0, timeUncorrected); + tv.set(1, 0, tv.get(0, 0) - dft(tv.get(0, 0)) / dfpt(tv.get(0, 0))); + + while ((Math.abs(tv.get(iNR, 0) - tv.get(iNR - 1, 0)) / tv.get(iNR, 0) > tPrecision) && (iNR < iterationMax)) { + iNR++; + tv.set(iNR, 0, tv.get(iNR - 1, 0) - dft(tv.get(iNR - 1, 0)) / dfpt(tv.get(iNR - 1, 0))); // Newton - Raphson + } + double timeCorrected = tv.get(iNR, 0); + + // detrital - correction calculations and derivatives + Matrix numberOfIntialAtoms = exponentialUTh(-timeCorrected).times(numberAtomsTimeT); //ni + Matrix dEatcorr = exponentialUTh(timeCorrected); + Matrix dEanegtcorr = exponentialUTh(-timeCorrected); + double diN238 = r232Th_238Ufc.getValue().doubleValue() / r232Th_238Udi * Math.exp(lambda232D * timeCorrected); + Matrix diN = new Matrix(new double[][]{{1.0}, {r234U_238Udi}, {r230Th_238Udi}}).times(diN238); + Matrix nat = numberAtomsTimeT.minus(dEatcorr.times(diN)); + Matrix nai = dEanegtcorr.times(numberAtomsTimeT).minus(diN); + + //J1 + double r08it_r28t_d = r230_238InitialT / r232Th_238Udi; + double r08it_r08di_d = r230Th_238Ufc.getValue().doubleValue() / r230Th_238Udi; + double r08it_r28di_d = -r232Th_238Ufc.getValue().doubleValue() * r230Th_238Udi / (r232Th_238Udi * r232Th_238Udi); + + //J2 + Matrix dT_nt + = dEanegtcorr.getMatrix(2, 2, 0, 2)// + .times(1.0 / (exponentialA.getMatrix(2, 2, 0, 2).times(numberOfIntialAtoms).get(0, 0) // + + lambda232D * r230Th_238Udi / r232Th_238Udi * r232Th_238Ufc.getValue().doubleValue() * Math.exp(lambda232D * timeCorrected))); + double dT_r08it + = -Math.exp(lambda232D * timeCorrected) / (exponentialA.getMatrix(2, 2, 0, 2).times(numberOfIntialAtoms).get(0, 0)// + + lambda232D * r230Th_238Udi / r232Th_238Udi * r232Th_238Ufc.getValue().doubleValue() * Math.exp(lambda232D * timeCorrected)); + + //J3 + double dN238di_t = lambda232D * r232Th_238Ufc.getValue().doubleValue() / r232Th_238Udi * Math.exp(lambda232D * timeCorrected); + double dN238di_r28t = Math.exp(lambda232D * timeCorrected) / r232Th_238Udi; + double dN238di_r28di = -r232Th_238Ufc.getValue().doubleValue() * Math.exp(lambda232D * timeCorrected) / (r232Th_238Udi * r232Th_238Udi); + + //J5 + Matrix dNat_dt = exponentialA.times(dEatcorr).times(diN).times(-1.0); + Matrix dNat_din = dEatcorr.times(-1.0); + Matrix dNat_nt = new Matrix(new double[][]{{1., 0., 0.}, {0., 1., 0.}, {0., 0., 1.}}); + Matrix dNai_dt = exponentialA.times(numberOfIntialAtoms).times(-1.0); + Matrix dNai_din = new Matrix(new double[][]{{-1., 0., 0.}, {0., -1., 0.}, {0., 0., -1.}}); + Matrix dNai_dnt = dEanegtcorr; + + //J6 + double dAr48tc_n238tauth = -nat.get(1, 0) * lambda234D / (nat.get(0, 0) * nat.get(0, 0) * lambda238D); + double dAr48tc_n234tauth = lambda234D / (nat.get(0, 0) * lambda238D); + double dAr08tc_n238tauth = -nat.get(2, 0) * lambda230D / (nat.get(0, 0) * nat.get(0, 0) * lambda238D); + double dAr08tc_n230tauth = lambda230D / (nat.get(0, 0) * lambda238D); + double dAr48ic_n238iauth = -nai.get(1, 0) * lambda234D / (nai.get(0, 0) * nai.get(0, 0) * lambda238D); + double dAr48ic_n234iauth = lambda234D / (nai.get(0, 0) * lambda238D); + + // Propagate Uncertainties + // 1 Uncorrected date + Matrix dT_ntUncorr = exponentialUTh_0(-timeUncorrected).times(1.0 / exponentialA.getMatrix(2, 2, 0, 2).times(numberOfIntialAtoms).get(0, 0)); + double uncorrectedDateOneSigmaABS = Math.sqrt(dT_ntUncorr.getMatrix(0, 0, 1, 2).times(covariance_fc.getMatrix(0, 1, 0, 1)).times(dT_ntUncorr.getMatrix(0, 0, 1, 2).transpose()).get(0, 0));// ' )/1000 ; % 2s abs, ka + + Matrix J1 = new Matrix(7, 6, 0.0); + // note dNat_nt is eye(3) + J1.setMatrix(0, 2, 0, 2, dNat_nt); + J1.setMatrix(4, 6, 3, 5, dNat_nt); + J1.set(3, 4, r08it_r28t_d); + J1.set(3, 4, r08it_r08di_d); + J1.set(3, 5, r08it_r28di_d); + + } + + private static Matrix exponentialGUTh(Double t) { + //mxp.GUTh = @(t) diag([exp(-lambda.U238*t) exp(-lambda.U234*t) exp(-lambda.Th230*t)]); + Matrix exponentialGUTh = new Matrix(3, 3, 0.); + exponentialGUTh.set(0, 0, Math.exp(-lambda238D * t)); + exponentialGUTh.set(1, 1, Math.exp(-lambda234D * t)); + exponentialGUTh.set(2, 2, Math.exp(-lambda230D * t)); + + return exponentialGUTh; + } + + private static Matrix exponentialUTh(double t) { + // mxp.UTh = @(t) mxp.QUTh*mxp.GUTh(t)*mxp.QinvUTh; + return exponentialQUTh.times(exponentialGUTh(t)).times(exponentialQinvUTh); + } + + private static Matrix exponentialUTh_0(double t) { + // mxp.UTh_0 = @(t) mxp.QUTh(3,:)*mxp.GUTh(t)*mxp.QinvUTh; % For the 230 concentration only (to solve for root) + return exponentialQUTh.getMatrix(2, 2, 0, 2).times(exponentialGUTh(t)).times(exponentialQinvUTh); + } + + private static Matrix exponentialUTh_4(double t) { + // mxp.UTh_4 = @(t) mxp.QUTh(2,:)*mxp.GUTh(t)*mxp.QinvUTh; % For the 234 concentration only (to solve for root) + return exponentialQUTh.getMatrix(1, 1, 0, 2).times(exponentialGUTh(t)).times(exponentialQinvUTh); + } + + private static double ft(double t) { + // ft = @(t) mxp.UTh_0(-t)*nt; + return exponentialUTh_0(-t).times(numberAtomsTimeT).get(0, 0); + } + + private static double fpt(double t) { + // fpt = @(t) -mxp.A(3,:)*mxp.UTh(-t)*nt; + return -exponentialA.getMatrix(2, 2, 0, 2).times(exponentialUTh(-t)).times(numberAtomsTimeT).get(0, 0); + } + + private static double dft(double t) { + // dft = @(t) mxp.UTh_0(-t)*nt - init.r08it*exp(lambda.Th232*t); + return ft(t) - r230_238InitialT * Math.exp(lambda232D * t); + } + private static double dfpt(double t) { + // dfpt = @(t) -mxp.A(3,:)*mxp.UTh(-t)*nt - lambda.Th232*init.r08it*exp(lambda.Th232*t); + return fpt(t) - lambda232D * r230_238InitialT * Math.exp(lambda232D * t); } private static void calculateActivityRatios(UThLegacyFractionI fraction) { diff --git a/src/main/java/org/earthtime/fractions/fractionReduction/FractionReducer.java b/src/main/java/org/earthtime/fractions/fractionReduction/FractionReducer.java index deb4258f..25739c17 100644 --- a/src/main/java/org/earthtime/fractions/fractionReduction/FractionReducer.java +++ b/src/main/java/org/earthtime/fractions/fractionReduction/FractionReducer.java @@ -35,6 +35,12 @@ public abstract class FractionReducer { protected static ValueModel lambda234; protected static ValueModel lambda235; protected static ValueModel lambda238; + protected static double lambda230D; + protected static double lambda231D; + protected static double lambda232D; + protected static double lambda234D; + protected static double lambda235D; + protected static double lambda238D; protected static ValueModel gmol204; protected static ValueModel gmol206; protected static ValueModel gmol207; @@ -58,6 +64,14 @@ protected static void initializeDecayConstants( lambda234 = physicalConstantsModel.getDatumByName(Lambdas.lambda234.getName()).copy(); lambda235 = physicalConstantsModel.getDatumByName(Lambdas.lambda235.getName()).copy(); lambda238 = physicalConstantsModel.getDatumByName(Lambdas.lambda238.getName()).copy(); + + lambda230D = lambda230.getValue().doubleValue(); + lambda231D = lambda231.getValue().doubleValue(); + lambda232D = lambda232.getValue().doubleValue(); + lambda234D = lambda234.getValue().doubleValue(); + lambda235D = lambda235.getValue().doubleValue(); + lambda238D = lambda238.getValue().doubleValue(); + } } From 8fd119a97002753a26c30db1607014eca44e6d6d Mon Sep 17 00:00:00 2001 From: bowring Date: Fri, 26 Feb 2016 11:38:22 -0500 Subject: [PATCH 06/10] U-series math progress toward corrected date and revised report table --- .../UPb_Redux/reports/ReportSettings.java | 4 +- .../fractionReduction/UThFractionReducer.java | 81 ++++++++++++++++++- .../earthtime/dataDictionaries/RadDates.java | 3 +- .../ReportSpecifications.java | 25 ++++-- 4 files changed, 102 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java b/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java index 098fa0a6..47032ca4 100644 --- a/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java +++ b/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java @@ -45,7 +45,7 @@ public class ReportSettings implements * version number is advanced so that any existing analysis will update its * report models upon opening in ET_Redux. */ - private static transient int CURRENT_VERSION_REPORT_SETTINGS = 327; + private static transient int CURRENT_VERSION_REPORT_SETTINGS = 332; // Fields private String name; @@ -96,7 +96,7 @@ public ReportSettings(String name, String isotopeStyle) { "Dates", isotypeStyleIsUPb ? ReportSpecifications.ReportCategory_Dates// - : ReportSpecifications.ReportCategory_Dates, isotypeStyleIsUPb); + : ReportSpecifications.ReportCategory_DatesUTh, true); this.datesPbcCorrCategory = new ReportCategory(// diff --git a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java index ae10fe09..51026b6f 100644 --- a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java +++ b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java @@ -22,6 +22,7 @@ import org.earthtime.UPb_Redux.ReduxConstants; import org.earthtime.UPb_Redux.valueModels.ValueModel; import org.earthtime.UTh_Redux.fractions.UThLegacyFractionI; +import org.earthtime.dataDictionaries.RadDates; import org.earthtime.dataDictionaries.UThAnalysisMeasures; import org.earthtime.dataDictionaries.UThFractionationCorrectedIsotopicRatios; import org.earthtime.fractions.fractionReduction.FractionReducer; @@ -308,8 +309,7 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { // Propagate Uncertainties // 1 Uncorrected date Matrix dT_ntUncorr = exponentialUTh_0(-timeUncorrected).times(1.0 / exponentialA.getMatrix(2, 2, 0, 2).times(numberOfIntialAtoms).get(0, 0)); - double uncorrectedDateOneSigmaABS = Math.sqrt(dT_ntUncorr.getMatrix(0, 0, 1, 2).times(covariance_fc.getMatrix(0, 1, 0, 1)).times(dT_ntUncorr.getMatrix(0, 0, 1, 2).transpose()).get(0, 0));// ' )/1000 ; % 2s abs, ka - + Matrix J1 = new Matrix(7, 6, 0.0); // note dNat_nt is eye(3) J1.setMatrix(0, 2, 0, 2, dNat_nt); @@ -318,6 +318,83 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { J1.set(3, 4, r08it_r08di_d); J1.set(3, 5, r08it_r28di_d); + Matrix J2 = new Matrix(7, 7, 0.0); + // note dNat_nt is eye(3) + J2.setMatrix(1, 3, 0, 2, dNat_nt); + J2.setMatrix(4, 6, 4, 6, dNat_nt); + J2.setMatrix(0, 0, 0, 1, dT_nt.getMatrix(0, 0, 1, 2)); + J2.set(0, 3, dT_r08it); + + Matrix J3 = new Matrix(6, 7, 0.0); + J3.set(0, 0, 1.); + J3.setMatrix(2, 3, 1, 2, new Matrix(new double[][]{{1., 0}, {0., 1.}})); + J3.setMatrix(4, 5, 4, 5, new Matrix(new double[][]{{1., 0}, {0., 1.}})); + J3.set(1, 0, dN238di_t); + J3.set(1, 3, dN238di_r28t); + J3.set(1, 6, dN238di_r28di); + + Matrix J4 = new Matrix(new double[][]{// + {1., 0., 0., 0., 0., 0.}, + {0., 1., 0., 0., 0., 0.}, + {0., r234U_238Udi, 0., 0., diN238, 0.}, + {0., r230Th_238Udi, 0., 0., 0., diN238}, + {0., 0., 1., 0., 0., 0.}, + {0., 0., 0., 1., 0., 0.}}); + + Matrix J5 = new Matrix(6, 6, 0.); + J5.set(1, 1, 1.); + J5.setMatrix(1, 3, 0, 0, dNat_dt); + J5.setMatrix(1, 3, 1, 3, dNat_din); + J5.setMatrix(1, 3, 4, 5, dNat_nt.getMatrix(0, 2, 1, 2)); + J5.setMatrix(4, 5, 0, 0, dNai_dt.getMatrix(0, 1, 0, 0)); + J5.setMatrix(4, 5, 1, 3, dNai_din.getMatrix(0, 1, 0, 2)); + J5.setMatrix(4, 5, 4, 5, dNai_dnt.getMatrix(0, 1, 1, 2)); + + Matrix J6 = new Matrix(4, 6, 0.); + J6.set(0, 0, 1.); + J6.set(1, 1, dAr48tc_n238tauth); + J6.set(1, 2, dAr48tc_n234tauth); + J6.set(2, 1, dAr08tc_n238tauth); + J6.set(2, 3, dAr08tc_n230tauth); + J6.set(3, 4, dAr48ic_n238iauth); + J6.set(3, 5, dAr48ic_n234iauth); + + Matrix Cout + = J6.times(J5).times(J4).times(J3).times(J2).times(J1).times(covariance_in)// + .times(J1.transpose()).times(J2.transpose()).times(J3.transpose()).times(J4.transpose()).times(J5.transpose()).times(J6.transpose()); + +// %% Arrange outputs +// +// outvec(1) = nat(3)/nat(1) * lambda.Th230/lambda.U238; % detrital-corrected 230Th/238U AR + double ar230_238corrected = nat.get(2,0)/nat.get(0,0) * lambda230D/lambda238D; +// outvec(3) = nat(2)/nat(1) * lambda.U234/lambda.U238; % detrital-corrected 234U/238U AR + double ar234_238corrected = nat.get(1,0)/nat.get(0,0) * lambda234D/lambda238D; +// outvec(6) = tuncorr/1000; % uncorrected date, ka +// outvec(7) = 2*sqrt( d.t_ntUncorr(2:3)*meas.C(1:2,1:2)*d.t_ntUncorr(2:3)' )/1000 ; % 2s abs, ka + double uncorrectedDateOneSigmaABS = Math.sqrt(dT_ntUncorr.getMatrix(0, 0, 1, 2).times(covariance_fc.getMatrix(0, 1, 0, 1)).times(dT_ntUncorr.getMatrix(0, 0, 1, 2).transpose()).get(0, 0));// ' )/1000 ; % 2s abs, ka +// outvec(8) = tcorr/1000; % detrital-corrected date, ka +// outvec(9) = (tcorr - di.yearsSince1950)/1000; % detrital-corrected date, ka BP (1950) +// outvec(11) = nai(2)/nai(1) * lambda.U234/lambda.U238; % initial corrected 234/238 AR +// +// outvec(2) = 2*sqrt(Cout(3,3))/outvec(1) * 100; % 2s% ar08t corrected +// outvec(4) = 2*sqrt(Cout(2,2))/outvec(3) * 100; % 2s% ar48t corrected +// outvec(5) = Cout(2,3)/sqrt(Cout(2,2)*Cout(3,3)); % corr coef ar08t-ar48t +// outvec(10) = 2*sqrt(Cout(1,1))/1000; % 2s abs detrital-corrected date + double correctedDateOneSigmaAbs = Math.sqrt(Cout.get(0,0)); +// outvec(12) = 2*sqrt(Cout(4,4)); % 2s abs ar48i +// outvec(13) = Cout(1,4)/sqrt(Cout(1,1)*Cout(4,4)); + + System.out.println("corr date " + timeCorrected); + + ValueModel dateCorr = new ValueModel(// + RadDates.dateCorr.getName(), // + new BigDecimal(timeCorrected), /// + "ABS", // + new BigDecimal(correctedDateOneSigmaAbs), // + BigDecimal.ZERO); + + fraction .setRadiogenicIsotopeDateByName(RadDates.dateCorr, dateCorr); + } private static Matrix exponentialGUTh(Double t) { diff --git a/src/main/java/org/earthtime/dataDictionaries/RadDates.java b/src/main/java/org/earthtime/dataDictionaries/RadDates.java index 9f7b6794..342442b6 100644 --- a/src/main/java/org/earthtime/dataDictionaries/RadDates.java +++ b/src/main/java/org/earthtime/dataDictionaries/RadDates.java @@ -110,7 +110,8 @@ public enum RadDates { /** * */ - bestAge_PbcCorr( "bestAge_PbcCorr" ); + bestAge_PbcCorr( "bestAge_PbcCorr" ), + dateCorr("dateCorr"); private String name; diff --git a/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java b/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java index 111ce27d..e614d034 100644 --- a/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java +++ b/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java @@ -196,19 +196,19 @@ public class ReportSpecifications { "", "true", "false", "2", "true", "", "false", "false" }, {"", "r230Th/", "232Thfc", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.r230Th_232Thfc.getName(), "PCT", - "", "true", "false", "2", "true", "", "false", "false" + "", "false", "false", "2", "true", "", "false", "false" }, {"", "r228Ra/", "226Rafc", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.r228Ra_226Rafc.getName(), "PCT", - "", "true", "false", "2", "true", "", "false", "false" + "", "false", "false", "2", "true", "", "false", "false" }, {"", "r231Pa/", "233Pafc", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.r231Pa_233Pafc.getName(), "PCT", - "", "true", "false", "2", "true", "", "false", "false" + "", "false", "false", "2", "true", "", "false", "false" }, {"", "r238U/", "206Pbfc", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.r238U_206Pbfc.getName(), "PCT", - "", "true", "false", "2", "true", "", "false", "false" + "", "false", "false", "2", "true", "", "false", "false" }, {"", "r207Pb/", "206Pbfc", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.r207Pb_206Pbfc.getName(), "PCT", - "", "true", "false", "2", "true", "", "false", "false" + "", "false", "false", "2", "true", "", "false", "false" }, }; @@ -285,7 +285,20 @@ public class ReportSpecifications { }, {"", "best", "date", "Ma", "getRadiogenicIsotopeDateByName", RadDates.bestAge.getName(), "ABS", "", "false", "false", "2", "true", "best date", "true", "true" - } + }, + }; + + // Report column order = + // displayName1, displayName2, displayName3, units, retrieveMethodName, retrieveParameterName, uncertaintyType, + // footnoteSpec, visible, useArbitrary? for value, digitcount value, unct visible (if required), description where needed, + // needsLead, needsUranium + /** + * + */ + public static final String[][] ReportCategory_DatesUTh = new String[][]{ + {"", "Corr", "Date", "ka", "getRadiogenicIsotopeDateByName", RadDates.dateCorr.getName(), "ABS", + "", "true", "false", "2", "true", "", "false", "false" + }, }; // Report column order = From d046a02cdf8daadbd66fbf8411b93cc0ecdd9bb7 Mon Sep 17 00:00:00 2001 From: bowring Date: Sat, 27 Feb 2016 10:57:33 -0500 Subject: [PATCH 07/10] completed Useries math from Noah and refined data table and evolution plot --- src/main/java/org/earthtime/ETReduxFrame.java | 7 +- .../UPb_Redux/reports/ReportSettings.java | 2 +- .../TopsoilEvolutionPlot.java | 136 +++++++----------- .../fractionReduction/UThFractionReducer.java | 92 ++++++------ .../ReportSpecifications.java | 2 +- .../earthtime/reduxLabData/ReduxLabData.java | 37 ++--- .../ReportAliquotFractionsView.java | 5 +- .../earthtime/samples/SampleInterface.java | 2 +- .../dataDictionaries/RadDatesTest.java | 4 +- 9 files changed, 119 insertions(+), 168 deletions(-) diff --git a/src/main/java/org/earthtime/ETReduxFrame.java b/src/main/java/org/earthtime/ETReduxFrame.java index f1ff50bc..e94b5576 100644 --- a/src/main/java/org/earthtime/ETReduxFrame.java +++ b/src/main/java/org/earthtime/ETReduxFrame.java @@ -3386,15 +3386,10 @@ private void helpMenuMenuDeselected(javax.swing.event.MenuEvent evt) {//GEN-FIRS private void interpretSampleDates_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_interpretSampleDates_buttonActionPerformed // Dec 2015 experiment with customization of skins if (theSample.getIsotopeStyle().compareToIgnoreCase("UTh") == 0) { - TopsoilEvolutionPlot topsoilEvolutionChart = new TopsoilEvolutionPlot(); + TopsoilEvolutionPlot topsoilEvolutionChart = TopsoilEvolutionPlot.getInstance(); topsoilEvolutionChart.setSelectedFractions(theSample.getFractions()); topsoilEvolutionChart.preparePanel(); topsoilEvolutionChart.showPanel(); - -// TopsoilEvolutionPlot topsoilEvolutionChart2 = new TopsoilEvolutionPlot(); -// topsoilEvolutionChart2.setSelectedFractions(theSample.getFractions()); -// topsoilEvolutionChart2.preparePanel(); -// topsoilEvolutionChart2.showPanel(); } else { manageSampleDateInterpretation(// diff --git a/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java b/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java index 47032ca4..a70fbc77 100644 --- a/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java +++ b/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java @@ -45,7 +45,7 @@ public class ReportSettings implements * version number is advanced so that any existing analysis will update its * report models upon opening in ET_Redux. */ - private static transient int CURRENT_VERSION_REPORT_SETTINGS = 332; + private static transient int CURRENT_VERSION_REPORT_SETTINGS = 333; // Fields private String name; diff --git a/src/main/java/org/earthtime/UTh_Redux/dateInterpretation/TopsoilEvolutionPlot.java b/src/main/java/org/earthtime/UTh_Redux/dateInterpretation/TopsoilEvolutionPlot.java index 68e05253..0decc9df 100644 --- a/src/main/java/org/earthtime/UTh_Redux/dateInterpretation/TopsoilEvolutionPlot.java +++ b/src/main/java/org/earthtime/UTh_Redux/dateInterpretation/TopsoilEvolutionPlot.java @@ -15,9 +15,12 @@ */ package org.earthtime.UTh_Redux.dateInterpretation; -import javafx.fxml.FXML; -import javafx.scene.control.ToolBar; -import javafx.scene.layout.HBox; +import java.awt.Container; +import java.util.ArrayList; +import java.util.List; +import java.util.Vector; +import javax.swing.JComponent; +import javax.swing.WindowConstants; import org.cirdles.topsoil.dataset.Dataset; import org.cirdles.topsoil.dataset.RawData; import org.cirdles.topsoil.dataset.SimpleDataset; @@ -33,31 +36,21 @@ import org.earthtime.dataDictionaries.UThAnalysisMeasures; import org.earthtime.fractions.ETFractionInterface; -import javax.swing.JComponent; -import javax.swing.WindowConstants; -import java.awt.Container; -import java.util.ArrayList; -import java.util.List; -import java.util.Vector; - /** * * @author bowring */ -public class TopsoilEvolutionPlot{// extends CustomVBox { +public final class TopsoilEvolutionPlot { + private static final TopsoilEvolutionPlot instance = new TopsoilEvolutionPlot(); private Vector selectedFractions; - private Plot myChart; - private List> myFields; + private final Plot myChart; + private final List> myFields; private JComponent plotAsComponent; + private final EvolutionChartDialog topsoilEvolutionChartDialog; + private Container contentPane; - @FXML - private HBox chartAndConfig; - @FXML - private ToolBar chartToolBar; - - public TopsoilEvolutionPlot() { - //super(self -> self.myChart = new EvolutionChart()); + private TopsoilEvolutionPlot() { myChart = new EvolutionPlot(); myFields = new ArrayList<>(); @@ -67,66 +60,33 @@ public TopsoilEvolutionPlot() { myFields.add(new NumberField(UThAnalysisMeasures.ar234U_238Ufc.getName() + "-2sigma")); myFields.add(new NumberField("rho")); - } - - public void showPanel() { - -// Button fitData = new Button("Fit data"); -// fitData.setOnAction(mouseEvent -> { -// ((JavaScriptChart) myChart).fitData(); -// }); -// -// chartToolBar.getItems().addAll(fitData); -// -// try { -// chartAndConfig.getChildren().setAll( -// myChart.displayAsNode(), -// myChart.getPropertiesPanel().displayAsNode()); -// } catch (UnsupportedOperationException ex) { -// chartAndConfig.getChildren().setAll( -// myChart.displayAsNode()); -// } -// -// Scene scene = new Scene(this, 1200, 800); -// -// Stage chartStage = new Stage(); -// chartStage.setScene(scene); -// chartStage.show(); - - class EvolutionChartDialog extends javax.swing.JFrame { - - public EvolutionChartDialog(javax.swing.JFrame owner, boolean modal) { - super(); - } - } - - EvolutionChartDialog testTopsoilDialogDialog = new EvolutionChartDialog(null, true); - testTopsoilDialogDialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); - testTopsoilDialogDialog.setBounds( // + topsoilEvolutionChartDialog = new EvolutionChartDialog(null, true); + topsoilEvolutionChartDialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); + topsoilEvolutionChartDialog.setBounds( // 400, 100, 820, 640); - Container contentPane = testTopsoilDialogDialog.getContentPane(); - + contentPane = topsoilEvolutionChartDialog.getContentPane(); plotAsComponent = myChart.displayAsJComponent(); - plotAsComponent.createToolTip().setTipText("TESTING"); contentPane.add(plotAsComponent); + } -// ET_JButton fitDataButton = new ET_JButton("Fit Data"); -// fitDataButton.setBounds(10, 10, 50, 25); -// fitDataButton.addActionListener(new ActionListener() { -// @Override -// public void actionPerformed(ActionEvent e) { -// ((JavaScriptChart) myChart).fitData(); -// } -// }); -// -// plotAsComponent.add(fitDataButton); + private class EvolutionChartDialog extends javax.swing.JFrame { - testTopsoilDialogDialog.setVisible(true); + public EvolutionChartDialog(javax.swing.JFrame owner, boolean modal) { + super(); + } + } + public static TopsoilEvolutionPlot getInstance() { + return instance; + } + + public void showPanel() { + plotAsComponent.repaint(); + topsoilEvolutionChartDialog.setVisible(true); } public void preparePanel() { @@ -134,22 +94,24 @@ public void preparePanel() { List myEntries = new ArrayList<>(); for (int i = 0; i < selectedFractions.size(); i++) { - UThLegacyFractionI fraction = (UThLegacyFractionI) selectedFractions.get(i); - Entry dataEntry = new SimpleEntry(); - dataEntry.set((Field) myFields.get(0), // - fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar230Th_238Ufc.getName())// - .getValue().doubleValue()); - dataEntry.set((Field) myFields.get(1), // - fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar230Th_238Ufc.getName())// - .getOneSigmaAbs().doubleValue() * 2.0); - dataEntry.set((Field) myFields.get(2), // - fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar234U_238Ufc.getName())// - .getValue().doubleValue()); - dataEntry.set((Field) myFields.get(3), // - fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar234U_238Ufc.getName())// - .getOneSigmaAbs().doubleValue() * 2.0); - dataEntry.set((Field) myFields.get(4), 0.0); - myEntries.add(dataEntry); + if (!selectedFractions.get(i).isRejected()) { + UThLegacyFractionI fraction = (UThLegacyFractionI) selectedFractions.get(i); + Entry dataEntry = new SimpleEntry(); + dataEntry.set((Field) myFields.get(0), // + fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar230Th_238Ufc.getName())// + .getValue().doubleValue()); + dataEntry.set((Field) myFields.get(1), // + fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar230Th_238Ufc.getName())// + .getOneSigmaAbs().doubleValue() * 2.0); + dataEntry.set((Field) myFields.get(2), // + fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar234U_238Ufc.getName())// + .getValue().doubleValue()); + dataEntry.set((Field) myFields.get(3), // + fraction.getLegacyActivityRatioByName(UThAnalysisMeasures.ar234U_238Ufc.getName())// + .getOneSigmaAbs().doubleValue() * 2.0); + dataEntry.set((Field) myFields.get(4), 0.0); + myEntries.add(dataEntry); + } } RawData rawData = new RawData(myFields, myEntries); @@ -172,4 +134,4 @@ public void preparePanel() { public void setSelectedFractions(Vector selectedFractions) { this.selectedFractions = selectedFractions; } -} \ No newline at end of file +} diff --git a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java index 51026b6f..d28985b7 100644 --- a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java +++ b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java @@ -245,7 +245,7 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { int iNR = 1; tv.set(1, 0, tv.get(0, 0) - ft(tv.get(0, 0)) / fpt(tv.get(0, 0))); - while ((Math.abs(tv.get(iNR, 0) - tv.get(iNR - 1, 0)) / tv.get(iNR, 0) > tPrecision) && (iNR < iterationMax)) { + while ((Math.abs(tv.get(iNR, 0) - tv.get(iNR - 1, 0)) / tv.get(iNR, 0) > tPrecision) && (iNR < (iterationMax - 1))) { iNR++; tv.set(iNR, 0, tv.get(iNR - 1, 0) - ft(tv.get(iNR - 1, 0)) / fpt(tv.get(iNR - 1, 0))); // Newton - Raphson } @@ -256,7 +256,7 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { tv.set(0, 0, timeUncorrected); tv.set(1, 0, tv.get(0, 0) - dft(tv.get(0, 0)) / dfpt(tv.get(0, 0))); - while ((Math.abs(tv.get(iNR, 0) - tv.get(iNR - 1, 0)) / tv.get(iNR, 0) > tPrecision) && (iNR < iterationMax)) { + while ((Math.abs(tv.get(iNR, 0) - tv.get(iNR - 1, 0)) / tv.get(iNR, 0) > tPrecision) && (iNR < (iterationMax - 1))) { iNR++; tv.set(iNR, 0, tv.get(iNR - 1, 0) - dft(tv.get(iNR - 1, 0)) / dfpt(tv.get(iNR - 1, 0))); // Newton - Raphson } @@ -273,7 +273,7 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { //J1 double r08it_r28t_d = r230_238InitialT / r232Th_238Udi; - double r08it_r08di_d = r230Th_238Ufc.getValue().doubleValue() / r230Th_238Udi; + double r08it_r08di_d = r232Th_238Ufc.getValue().doubleValue() / r232Th_238Udi; double r08it_r28di_d = -r232Th_238Ufc.getValue().doubleValue() * r230Th_238Udi / (r232Th_238Udi * r232Th_238Udi); //J2 @@ -309,12 +309,12 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { // Propagate Uncertainties // 1 Uncorrected date Matrix dT_ntUncorr = exponentialUTh_0(-timeUncorrected).times(1.0 / exponentialA.getMatrix(2, 2, 0, 2).times(numberOfIntialAtoms).get(0, 0)); - + Matrix J1 = new Matrix(7, 6, 0.0); // note dNat_nt is eye(3) J1.setMatrix(0, 2, 0, 2, dNat_nt); J1.setMatrix(4, 6, 3, 5, dNat_nt); - J1.set(3, 4, r08it_r28t_d); + J1.set(3, 2, r08it_r28t_d); J1.set(3, 4, r08it_r08di_d); J1.set(3, 5, r08it_r28di_d); @@ -342,7 +342,7 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { {0., 0., 0., 1., 0., 0.}}); Matrix J5 = new Matrix(6, 6, 0.); - J5.set(1, 1, 1.); + J5.set(0, 0, 1.); J5.setMatrix(1, 3, 0, 0, dNat_dt); J5.setMatrix(1, 3, 1, 3, dNat_din); J5.setMatrix(1, 3, 4, 5, dNat_nt.getMatrix(0, 2, 1, 2)); @@ -366,34 +366,50 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { // %% Arrange outputs // // outvec(1) = nat(3)/nat(1) * lambda.Th230/lambda.U238; % detrital-corrected 230Th/238U AR - double ar230_238corrected = nat.get(2,0)/nat.get(0,0) * lambda230D/lambda238D; + double ar230_238corrected = nat.get(2, 0) / nat.get(0, 0) * lambda230D / lambda238D; + // outvec(3) = nat(2)/nat(1) * lambda.U234/lambda.U238; % detrital-corrected 234U/238U AR - double ar234_238corrected = nat.get(1,0)/nat.get(0,0) * lambda234D/lambda238D; + double ar234_238corrected = nat.get(1, 0) / nat.get(0, 0) * lambda234D / lambda238D; + // outvec(6) = tuncorr/1000; % uncorrected date, ka // outvec(7) = 2*sqrt( d.t_ntUncorr(2:3)*meas.C(1:2,1:2)*d.t_ntUncorr(2:3)' )/1000 ; % 2s abs, ka double uncorrectedDateOneSigmaABS = Math.sqrt(dT_ntUncorr.getMatrix(0, 0, 1, 2).times(covariance_fc.getMatrix(0, 1, 0, 1)).times(dT_ntUncorr.getMatrix(0, 0, 1, 2).transpose()).get(0, 0));// ' )/1000 ; % 2s abs, ka + // outvec(8) = tcorr/1000; % detrital-corrected date, ka // outvec(9) = (tcorr - di.yearsSince1950)/1000; % detrital-corrected date, ka BP (1950) // outvec(11) = nai(2)/nai(1) * lambda.U234/lambda.U238; % initial corrected 234/238 AR // // outvec(2) = 2*sqrt(Cout(3,3))/outvec(1) * 100; % 2s% ar08t corrected + double ar230_238correctedOneSigmaABS = Math.sqrt(Cout.get(2, 2) / ar230_238corrected); + // outvec(4) = 2*sqrt(Cout(2,2))/outvec(3) * 100; % 2s% ar48t corrected + double ar234_238correctedOneSigmaABS = Math.sqrt(Cout.get(1, 1) / ar234_238corrected); // outvec(5) = Cout(2,3)/sqrt(Cout(2,2)*Cout(3,3)); % corr coef ar08t-ar48t + // outvec(10) = 2*sqrt(Cout(1,1))/1000; % 2s abs detrital-corrected date - double correctedDateOneSigmaAbs = Math.sqrt(Cout.get(0,0)); + double correctedDateOneSigmaAbs = Math.sqrt(Cout.get(0, 0)); + // outvec(12) = 2*sqrt(Cout(4,4)); % 2s abs ar48i // outvec(13) = Cout(1,4)/sqrt(Cout(1,1)*Cout(4,4)); - System.out.println("corr date " + timeCorrected); - ValueModel dateCorr = new ValueModel(// RadDates.dateCorr.getName(), // new BigDecimal(timeCorrected), /// "ABS", // new BigDecimal(correctedDateOneSigmaAbs), // BigDecimal.ZERO); - - fraction .setRadiogenicIsotopeDateByName(RadDates.dateCorr, dateCorr); + + fraction.setRadiogenicIsotopeDateByName(RadDates.dateCorr, dateCorr); + + fraction.getAnalysisMeasure(UThAnalysisMeasures.ar230Th_238Ufc.getName())// + .setValue(ar230_238corrected); + fraction.getAnalysisMeasure(UThAnalysisMeasures.ar230Th_238Ufc.getName())// + .setOneSigma(ar230_238correctedOneSigmaABS); + + fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())// + .setValue(ar234_238corrected); + fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())// + .setOneSigma(ar234_238correctedOneSigmaABS); } @@ -417,11 +433,6 @@ private static Matrix exponentialUTh_0(double t) { return exponentialQUTh.getMatrix(2, 2, 0, 2).times(exponentialGUTh(t)).times(exponentialQinvUTh); } - private static Matrix exponentialUTh_4(double t) { - // mxp.UTh_4 = @(t) mxp.QUTh(2,:)*mxp.GUTh(t)*mxp.QinvUTh; % For the 234 concentration only (to solve for root) - return exponentialQUTh.getMatrix(1, 1, 0, 2).times(exponentialGUTh(t)).times(exponentialQinvUTh); - } - private static double ft(double t) { // ft = @(t) mxp.UTh_0(-t)*nt; return exponentialUTh_0(-t).times(numberAtomsTimeT).get(0, 0); @@ -454,29 +465,28 @@ private static void calculateActivityRatios(UThLegacyFractionI fraction) { fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r232Th_238Ufc.getName()).getOneSigmaAbs()// .multiply(lambda232.getValue())// .divide(lambda238.getValue(), ReduxConstants.mathContext15)); - - fraction.getAnalysisMeasure(UThAnalysisMeasures.ar230Th_238Ufc.getName())// - .setValue(// - fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r230Th_238Ufc.getName()).getValue()// - .multiply(lambda230.getValue())// - .divide(lambda238.getValue(), ReduxConstants.mathContext15)); - fraction.getAnalysisMeasure(UThAnalysisMeasures.ar230Th_238Ufc.getName())// - .setOneSigma(// - fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r230Th_238Ufc.getName()).getOneSigmaAbs()// - .multiply(lambda230.getValue())// - .divide(lambda238.getValue(), ReduxConstants.mathContext15)); - - fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())// - .setValue(// - fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r234U_238Ufc.getName()).getValue()// - .multiply(lambda234.getValue())// - .divide(lambda238.getValue(), ReduxConstants.mathContext15)); - fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())// - .setOneSigma(// - fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r234U_238Ufc.getName()).getOneSigmaAbs()// - .multiply(lambda234.getValue())// - .divide(lambda238.getValue(), ReduxConstants.mathContext15)); - + // math for these two is now in Noah's date-calc math above +// fraction.getAnalysisMeasure(UThAnalysisMeasures.ar230Th_238Ufc.getName())// +// .setValue(// +// fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r230Th_238Ufc.getName()).getValue()// +// .multiply(lambda230.getValue())// +// .divide(lambda238.getValue(), ReduxConstants.mathContext15)); +// fraction.getAnalysisMeasure(UThAnalysisMeasures.ar230Th_238Ufc.getName())// +// .setOneSigma(// +// fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r230Th_238Ufc.getName()).getOneSigmaAbs()// +// .multiply(lambda230.getValue())// +// .divide(lambda238.getValue(), ReduxConstants.mathContext15)); +// +// fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())// +// .setValue(// +// fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r234U_238Ufc.getName()).getValue()// +// .multiply(lambda234.getValue())// +// .divide(lambda238.getValue(), ReduxConstants.mathContext15)); +// fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())// +// .setOneSigma(// +// fraction.getRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.r234U_238Ufc.getName()).getOneSigmaAbs()// +// .multiply(lambda234.getValue())// +// .divide(lambda238.getValue(), ReduxConstants.mathContext15)); } public static void calculateMeasuredAtomRatiosFromLegacyActivityRatios(UThLegacyFractionI fraction) { diff --git a/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java b/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java index e614d034..63ebfb0c 100644 --- a/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java +++ b/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java @@ -121,7 +121,7 @@ public class ReportSpecifications { "FN-18&FN-19", "false", "true", "3", "true", "[230Th/232Th] activity ratio", "false", "false" }, {"[232Th/", "238U]", "", "*1e5", "getAnalysisMeasure", UThAnalysisMeasures.ar232Th_238Ufc.getName(), "ABS", - "FN-19&FN-17", "true", "true", "3", "true", "[232Th/238U] activity ratio", "false", "false" + "FN-19&FN-17", "false", "true", "3", "true", "[232Th/238U] activity ratio", "false", "false" }, {"", "[230Th/", "238U]", "", "getAnalysisMeasure", UThAnalysisMeasures.ar230Th_238Ufc.getName(), "ABS", "FN-18&FN-17", "true", "false", "3", "true", "[230Th/238U] activity ratio", "false", "false" diff --git a/src/main/java/org/earthtime/reduxLabData/ReduxLabData.java b/src/main/java/org/earthtime/reduxLabData/ReduxLabData.java index df43b18e..50fa1b1d 100644 --- a/src/main/java/org/earthtime/reduxLabData/ReduxLabData.java +++ b/src/main/java/org/earthtime/reduxLabData/ReduxLabData.java @@ -345,10 +345,7 @@ public static String getLabDataFileName() { */ public static ReduxLabData getInstance() { if (instance == null) { - instance = (ReduxLabData) ETSerializer.GetSerializedObjectFromFile(ReduxLabData.getMySerializedName()); - if (instance == null) { - instance = new ReduxLabData(); - } + instance = new ReduxLabData(); } return instance; } @@ -433,11 +430,9 @@ public AbstractRatiosDataModel getDefaultLabTracer() throws BadLabDataException addTracer(TracerUPbModel.getNoneInstance()); defaultLabTracer = getFirstTracer(); } else // detect if legacy default is none and change if possible - { - if (defaultLabTracer.equals(getNoneTracer())) { + if (defaultLabTracer.equals(getNoneTracer())) { defaultLabTracer = getFirstTracer(); } - } return defaultLabTracer; } @@ -553,11 +548,9 @@ public ValueModel getDefaultLabAlphaUModel() addAlphaUModel(new ValueModel(ReduxConstants.NONE)); setDefaultLabAlphaUModel(getFirstAlphaUModel()); } else // detect if legacy default is none and change if possible - { - if (defaultLabAlphaUModel.equals(getNoneAlphaUModel())) { + if (defaultLabAlphaUModel.equals(getNoneAlphaUModel())) { setDefaultLabAlphaUModel(getFirstAlphaUModel()); } - } return defaultLabAlphaUModel; } @@ -662,11 +655,9 @@ public ValueModel getDefaultLabAlphaPbModel() addAlphaPbModel(new ValueModel(ReduxConstants.NONE)); setDefaultLabAlphaPbModel(getFirstAlphaPbModel()); } else // detect if legacy default is none and change if possible - { - if (defaultLabAlphaPbModel.equals(getNoneAlphaPbModel())) { + if (defaultLabAlphaPbModel.equals(getNoneAlphaPbModel())) { setDefaultLabAlphaPbModel(getFirstAlphaPbModel()); } - } return defaultLabAlphaPbModel; } @@ -773,11 +764,9 @@ public AbstractRatiosDataModel getDefaultLabPbBlank() addBlank(PbBlankICModel.getNoneInstance()); setDefaultLabPbBlank(getFirstPbBlank()); } else // detect if legacy default is none and change if possible - { - if (defaultLabPbBlank.equals(getNonePbBlankModel())) { + if (defaultLabPbBlank.equals(getNonePbBlankModel())) { setDefaultLabPbBlank(getFirstPbBlank()); } - } return defaultLabPbBlank; } @@ -897,11 +886,9 @@ public AbstractRatiosDataModel getDefaultLabInitialPbModel() defaultLabInitialPbModel = getFirstInitialPbModel(); } else // detect if legacy default is none and change if possible - { - if (defaultLabInitialPbModel.equals(getNoneInitialPbModel())) { + if (defaultLabInitialPbModel.equals(getNoneInitialPbModel())) { defaultLabInitialPbModel = getFirstInitialPbModel(); } - } return defaultLabInitialPbModel; } @@ -1017,9 +1004,11 @@ public AbstractRatiosDataModel getDefaultPhysicalConstantsModel() { addPhysicalConstantsModel(PhysicalConstantsModel.getNoneInstance()); defaultPhysicalConstantsModel = getFirstPhysicalConstantsModel(); } else // detect if legacy default is none and change if possible - if (defaultPhysicalConstantsModel.equals(getNonePhysicalConstantsModel())) { + { + if (defaultPhysicalConstantsModel.equals(getNonePhysicalConstantsModel())) { defaultPhysicalConstantsModel = getFirstPhysicalConstantsModel(); } + } } catch (BadLabDataException badLabDataException) { new ETWarningDialog(badLabDataException).setVisible(true); } @@ -1268,11 +1257,9 @@ public AbstractRatiosDataModel getDefaultRareEarthElementModel() addRareEarthElementModel(RareEarthElementsModel.getNoneInstance()); defaultRareEarthElementModel = getFirstRareEarthElementModel(); } else // detect if legacy default is none and change if possible - { - if (defaultRareEarthElementModel.equals(getNoneRareEarthElementModel())) { + if (defaultRareEarthElementModel.equals(getNoneRareEarthElementModel())) { defaultRareEarthElementModel = getFirstRareEarthElementModel(); } - } return defaultRareEarthElementModel; } @@ -1377,11 +1364,9 @@ public AbstractRatiosDataModel getDefaultDetritalUraniumAndThoriumModel() addDetritalUraniumAndThoriumModel(DetritalUraniumAndThoriumModel.getNoneInstance()); defaultDetritalUraniumAndThoriumModel = getFirstDetritalUraniumAndThoriumModel(); } else // detect if legacy default is none and change if possible - { - if (defaultDetritalUraniumAndThoriumModel.equals(getNoneDetritalUraniumAndThoriumModel())) { + if (defaultDetritalUraniumAndThoriumModel.equals(getNoneDetritalUraniumAndThoriumModel())) { defaultDetritalUraniumAndThoriumModel = getFirstDetritalUraniumAndThoriumModel(); } - } return defaultDetritalUraniumAndThoriumModel; } diff --git a/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java b/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java index 8e49d1e9..2c241202 100644 --- a/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java +++ b/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java @@ -68,7 +68,6 @@ import org.apache.fop.svg.PDFTranscoder; import org.earthtime.ETReduxFrame; import org.earthtime.UPb_Redux.ReduxConstants; -import org.earthtime.UPb_Redux.aliquots.UPbReduxAliquot; import org.earthtime.UPb_Redux.dialogs.fractionManagers.FractionNotesDialog; import org.earthtime.UPb_Redux.filters.SVGFileFilter; import org.earthtime.UPb_Redux.fractions.UPbReduxFractions.UPbFraction; @@ -1091,7 +1090,7 @@ public void mouseClicked(MouseEvent e) { } else { boolean isRejected = !((ETFractionInterface) verticalPixelFractionMap.get(row).rowObject).isRejected(); ((ETFractionInterface) verticalPixelFractionMap.get(row).rowObject).setRejected(isRejected); - // dec 2015 + // dec 2015 for tripoli fractions try { ((UPbFractionI) verticalPixelFractionMap.get(row).rowObject).getTripoliFraction().setIncluded(!isRejected); } catch (Exception noTF) { @@ -1105,7 +1104,7 @@ public void mouseClicked(MouseEvent e) { if (e.getModifiers() == InputEvent.BUTTON1_MASK) { parentFrame.editAliquotByProjectType(((AliquotInterface) verticalPixelFractionMap.get(row).rowObject)); } else { - AliquotInterface.toggleAliquotFractionsRejectedStatus(((UPbReduxAliquot) verticalPixelFractionMap.get(row).rowObject)); + AliquotInterface.toggleAliquotFractionsRejectedStatus(((ReduxAliquotInterface) verticalPixelFractionMap.get(row).rowObject)); parent.updateReportTable(false); } diff --git a/src/main/java/org/earthtime/samples/SampleInterface.java b/src/main/java/org/earthtime/samples/SampleInterface.java index ce8c08b1..ecd671ae 100644 --- a/src/main/java/org/earthtime/samples/SampleInterface.java +++ b/src/main/java/org/earthtime/samples/SampleInterface.java @@ -1169,7 +1169,7 @@ public default ETFractionInterface getFractionByIDAndAliquotNumber(String ID, in public default Vector getFractionsRejected() { Vector retval = new Vector<>(); - getFractions().stream().filter((f) -> (((ETFractionInterface) f).isRejected())).forEach((f) -> { + getFractions().stream().filter((f) -> (f.isRejected())).forEach((f) -> { retval.add(f); }); diff --git a/src/test/java/org/earthtime/dataDictionaries/RadDatesTest.java b/src/test/java/org/earthtime/dataDictionaries/RadDatesTest.java index 6b6e6b95..b059ec7e 100644 --- a/src/test/java/org/earthtime/dataDictionaries/RadDatesTest.java +++ b/src/test/java/org/earthtime/dataDictionaries/RadDatesTest.java @@ -95,8 +95,8 @@ public void test_constructor_0(){ assertEquals("age208_232r",list[13]); assertEquals("bestAge",list[14]); assertEquals("bestAge_PbcCorr",list[15]); - assertEquals("percentDiscordance",list[16]); - assertEquals("percentDiscordance_PbcCorr",list[17]); + assertEquals("percentDiscordance",list[17]); + assertEquals("percentDiscordance_PbcCorr",list[18]); } From 965264b8510991d51baf07fe2d4c287c8316f28d Mon Sep 17 00:00:00 2001 From: bowring Date: Sat, 27 Feb 2016 17:47:56 -0500 Subject: [PATCH 08/10] added delta 234 Uranium column to report table for Useries --- .../UPb_Redux/reports/ReportCategory.java | 2 +- .../reports/ReportColumnXMLConverter.java | 22 ++++++++++++++----- .../UPb_Redux/reports/ReportSettings.java | 3 ++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/earthtime/UPb_Redux/reports/ReportCategory.java b/src/main/java/org/earthtime/UPb_Redux/reports/ReportCategory.java index f219cdd2..05114ae0 100644 --- a/src/main/java/org/earthtime/UPb_Redux/reports/ReportCategory.java +++ b/src/main/java/org/earthtime/UPb_Redux/reports/ReportCategory.java @@ -74,7 +74,7 @@ private ReportColumnInterface SetupReportColumn(int index, String[][] specs) { String displayName1 = specs[index][0]; ReportColumnInterface retVal = new ReportColumn(// displayName1, //specs[index][0], // displayname1 - specs[index][1], // displayname2 + specs[index][1].equalsIgnoreCase("delta") ? " \u03B4" : specs[index][1], // displayname2 specs[index][2], // displayname3 index, // positionIndex specs[index][3], // units diff --git a/src/main/java/org/earthtime/UPb_Redux/reports/ReportColumnXMLConverter.java b/src/main/java/org/earthtime/UPb_Redux/reports/ReportColumnXMLConverter.java index 579a4f37..e236ff7f 100644 --- a/src/main/java/org/earthtime/UPb_Redux/reports/ReportColumnXMLConverter.java +++ b/src/main/java/org/earthtime/UPb_Redux/reports/ReportColumnXMLConverter.java @@ -91,7 +91,13 @@ public void marshal(Object value, HierarchicalStreamWriter writer, writer.endNode(); writer.startNode("displayName2"); - writer.setValue(reportColumn.getDisplayName2()); + String displayName2 = reportColumn.getDisplayName2(); + // test for delta + if (displayName2.contains("\u03B4")) { + writer.setValue("LOWERCASEDELTA"); + } else { + writer.setValue(reportColumn.getDisplayName2()); + } writer.endNode(); writer.startNode("displayName3"); @@ -118,16 +124,16 @@ public void marshal(Object value, HierarchicalStreamWriter writer, if (reportColumn.getUncertaintyColumn() != null) { ReportColumnInterface myReportColumn = reportColumn.getUncertaintyColumn(); // repaired jan 2016 to restore report columns after serialization - String displayName2 = myReportColumn.getDisplayName2(); + displayName2 = myReportColumn.getDisplayName2(); String displayName3 = myReportColumn.getDisplayName3(); - + if (displayName3.contains("%")) { myReportColumn.setDisplayName3("PLUSMINUS2SIGMA%"); } else { myReportColumn.setDisplayName2("PLUSMINUS2SIGMA"); } context.convertAnother(reportColumn.getUncertaintyColumn()); - + // restore myReportColumn.setDisplayName2(displayName2); myReportColumn.setDisplayName3(displayName3); @@ -196,7 +202,13 @@ public Object unmarshal(HierarchicalStreamReader reader, reader.moveUp(); reader.moveDown(); - reportColumn.setDisplayName2(reader.getValue()); + String displayName2 = reader.getValue(); + // test for delta + if (displayName2.contains("LOWERCASEDELTA")) { + reportColumn.setDisplayName2(" \u03B4"); + } else { + reportColumn.setDisplayName2(displayName2); + } reader.moveUp(); reader.moveDown(); diff --git a/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java b/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java index a70fbc77..0b9f7285 100644 --- a/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java +++ b/src/main/java/org/earthtime/UPb_Redux/reports/ReportSettings.java @@ -45,7 +45,7 @@ public class ReportSettings implements * version number is advanced so that any existing analysis will update its * report models upon opening in ET_Redux. */ - private static transient int CURRENT_VERSION_REPORT_SETTINGS = 333; + private static transient int CURRENT_VERSION_REPORT_SETTINGS = 338; // Fields private String name; @@ -560,6 +560,7 @@ public ArrayList getReportCategories() { /** * @return the reportSettingsXMLSchemaURL */ + @Override public String getReportSettingsXMLSchemaURL() { return reportSettingsXMLSchemaURL; } From 7df13978bcfb13b1f1860c253a3f9206197dcd4a Mon Sep 17 00:00:00 2001 From: bowring Date: Sat, 27 Feb 2016 17:49:23 -0500 Subject: [PATCH 09/10] switched to test service environment at SESAR - however service is broken --- .../earthtime/archivingTools/forSESAR/SesarSample.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSample.java b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSample.java index 243d734e..8b7527ea 100644 --- a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSample.java +++ b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSample.java @@ -167,9 +167,12 @@ public static SesarSample createSesarSampleFromSesarRecord(String igsn) { private static File retrieveXMLFileFromSesarForIGSN(String igsn) { + String productionService = "http://app.geosamples.org/webservices/display.php?igsn="; + String testService = "http://sesardev.geoinfogeochem.org/webservices/display.php?igsn="; + File retVal = null; String tempSESARcontents - = URIHelper.getTextFromURI("http://app.geosamples.org/webservices/display.php?igsn=" + igsn); + = URIHelper.getTextFromURI(testService + igsn); if (tempSESARcontents.length() > 0) { // write this to a file @@ -227,6 +230,9 @@ public static Object readXMLObject(String filename) } public String uploadAndRegisterSesarSample() { + String productionServiceV1 = "http://app.geosamples.org/webservices/uploadservice.php"; + String productionServiceV2 = "http://app.geosamples.org/webservices/upload.php"; + String testServiceV2 = "http://sesardev.geoinfogeochem.org/webservices/upload.php"; String content = serializeForUploadToSesar(); @@ -239,7 +245,7 @@ public String uploadAndRegisterSesarSample() { org.w3c.dom.Document doc = null; try { response = ClientHttpRequest.post(// - new URL("http://app.geosamples.org/webservices/uploadservice.php"),// + new URL(testServiceV2),// dataToPost); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); From 54c0864695620a05c87cb3952381f22faa1555d1 Mon Sep 17 00:00:00 2001 From: bowring Date: Sat, 27 Feb 2016 18:09:31 -0500 Subject: [PATCH 10/10] refactored UTh data processing and reporting --- .../GeochronProjectExportManager.java | 20 +++++--------- .../fractionReduction/UThFractionReducer.java | 10 ++++++- .../ReportSpecifications.java | 27 +++++++------------ ...hFractionationCorrectedIsotopicRatios.java | 4 ++- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/projectManagers/exportManagers/GeochronProjectExportManager.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/projectManagers/exportManagers/GeochronProjectExportManager.java index fd12b9e9..25cfba39 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/projectManagers/exportManagers/GeochronProjectExportManager.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/projectManagers/exportManagers/GeochronProjectExportManager.java @@ -30,7 +30,6 @@ import javax.swing.JLayeredPane; import javax.swing.JPanel; import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; import org.earthtime.UPb_Redux.user.ReduxPersistentState; import org.earthtime.archivingTools.GeochronAliquotManager; import org.earthtime.archivingTools.IEDACredentialsValidator; @@ -151,17 +150,12 @@ private void initSamplesDisplay() { aliquotsLayeredPane.setPreferredSize(new Dimension(1100, topMarginForSampleDetails + (row + 1) * 100)); aliquotsLayeredPane.validate(); - instructionsTextPane.addHyperlinkListener(new HyperlinkListener() { - @Override - public void hyperlinkUpdate(HyperlinkEvent e) { - if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { - if (Desktop.isDesktopSupported()) { - try { - Desktop.getDesktop().browse(e.getURL().toURI()); - } catch (IOException | URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } + instructionsTextPane.addHyperlinkListener((HyperlinkEvent e) -> { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + if (Desktop.isDesktopSupported()) { + try { + Desktop.getDesktop().browse(e.getURL().toURI()); + } catch (IOException | URISyntaxException e1) { } } } @@ -322,7 +316,7 @@ private void validateGeochronAndSesarCredentials_buttonActionPerformed(java.awt. }//GEN-LAST:event_validateGeochronAndSesarCredentials_buttonActionPerformed private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing - parent.loadAndShowReportTableData(); + //parent.loadAndShowReportTableData(); }//GEN-LAST:event_formWindowClosing // Variables declaration - do not modify//GEN-BEGIN:variables diff --git a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java index d28985b7..6ccca135 100644 --- a/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java +++ b/src/main/java/org/earthtime/UTh_Redux/fractions/fractionReduction/UThFractionReducer.java @@ -410,7 +410,15 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) { .setValue(ar234_238corrected); fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())// .setOneSigma(ar234_238correctedOneSigmaABS); - + + ValueModel delta234U = new ValueModel(// + UThFractionationCorrectedIsotopicRatios.delta234U.getName(), // + BigDecimal.ZERO, /// + "ABS", // + BigDecimal.ZERO, // + BigDecimal.ZERO); + fraction.setRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.delta234U.getName(), delta234U); + } private static Matrix exponentialGUTh(Double t) { diff --git a/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java b/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java index 63ebfb0c..6d74ed79 100644 --- a/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java +++ b/src/main/java/org/earthtime/dataDictionaries/ReportSpecifications.java @@ -100,8 +100,7 @@ public class ReportSpecifications { }, {"", "Th/U", "(magma)", "", "getAnalysisMeasure", AnalysisMeasures.rTh_Umagma.getName(), "", "FN-11", "false", "true", "3", "", "Th/U magma", "true", "false" - }, - }; + },}; // Report column order = // displayName1, displayName2, displayName3, units, retrieveMethodName, retrieveParameterName, uncertaintyType, @@ -175,10 +174,8 @@ public class ReportSpecifications { "", "false", "true", "3", "", "Correlation coefficient", "true", "true" } }; - - - - // Report column order = + + // Report column order = // displayName1, displayName2, displayName3, units, retrieveMethodName, retrieveParameterName, uncertaintyType, // footnoteSpec, visible, useArbitrary? for value, digitcount value, unct visible (if required), description where needed, // needsLead, needsUranium @@ -209,13 +206,7 @@ public class ReportSpecifications { }, {"", "r207Pb/", "206Pbfc", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.r207Pb_206Pbfc.getName(), "PCT", "", "false", "false", "2", "true", "", "false", "false" - }, - - }; - - - - + },}; // Report column order = // displayName1, displayName2, displayName3, units, retrieveMethodName, retrieveParameterName, uncertaintyType, @@ -285,10 +276,9 @@ public class ReportSpecifications { }, {"", "best", "date", "Ma", "getRadiogenicIsotopeDateByName", RadDates.bestAge.getName(), "ABS", "", "false", "false", "2", "true", "best date", "true", "true" - }, - }; - - // Report column order = + },}; + + // Report column order = // displayName1, displayName2, displayName3, units, retrieveMethodName, retrieveParameterName, uncertaintyType, // footnoteSpec, visible, useArbitrary? for value, digitcount value, unct visible (if required), description where needed, // needsLead, needsUranium @@ -299,6 +289,9 @@ public class ReportSpecifications { {"", "Corr", "Date", "ka", "getRadiogenicIsotopeDateByName", RadDates.dateCorr.getName(), "ABS", "", "true", "false", "2", "true", "", "false", "false" }, + {"", "delta", "234U", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.delta234U.getName(), "ABS", + "", "true", "false", "2", "true", "", "false", "false" + } }; // Report column order = diff --git a/src/main/java/org/earthtime/dataDictionaries/UThFractionationCorrectedIsotopicRatios.java b/src/main/java/org/earthtime/dataDictionaries/UThFractionationCorrectedIsotopicRatios.java index 850320c7..d60311e1 100644 --- a/src/main/java/org/earthtime/dataDictionaries/UThFractionationCorrectedIsotopicRatios.java +++ b/src/main/java/org/earthtime/dataDictionaries/UThFractionationCorrectedIsotopicRatios.java @@ -51,7 +51,9 @@ public enum UThFractionationCorrectedIsotopicRatios { /** * */ - r207Pb_206Pbfc( "r207Pb_206Pbfc" ); + r207Pb_206Pbfc( "r207Pb_206Pbfc" ), + delta234U("delta234U") + ; private String name;