Skip to content

Commit

Permalink
Merge pull request #60 from bowring/shrimpdibbs
Browse files Browse the repository at this point in the history
Tweaks to U-series and Shrimp
  • Loading branch information
bowring committed Feb 29, 2016
2 parents ddd9f76 + 31df03c commit 159d48f
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ public AbstractRawDataFileTemplate() {
@Override
public int compareTo(AbstractRawDataFileTemplate abstractRawDataFileTemplate) {
String abstractRawDataFileTemplateName
=//
((AbstractRawDataFileTemplate) abstractRawDataFileTemplate).NAME.trim();
= abstractRawDataFileTemplate.NAME.trim();
return (this.NAME.trim().compareToIgnoreCase(abstractRawDataFileTemplateName));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.earthtime.Tripoli.massSpecSetups.AbstractMassSpecSetup;
import org.earthtime.Tripoli.rawDataFiles.handlers.AbstractRawDataFileHandler;
import org.earthtime.Tripoli.rawDataFiles.templates.AbstractRawDataFileTemplate;
import org.earthtime.Tripoli.rawDataFiles.templates.shrimp.ShrimpPrawn_RawDataTemplate_GA;
import org.earthtime.Tripoli.samples.AbstractTripoliSample;
import org.earthtime.Tripoli.sessions.TripoliSession;
import org.earthtime.Tripoli.sessions.TripoliSessionInterface;
Expand Down Expand Up @@ -310,15 +311,24 @@ private synchronized void loadRawDataWorkflow() {

// may 2013 split task to allow for custom parameters ********************
AbstractAcquisitionModel acquisitionModel = rawDataFileTemplate.makeNewAcquisitionModel();
try {
if (acquisitionModel.getPrimaryMineralStandardModel() == null) {
acquisitionModel.setPrimaryMineralStandardModel(ReduxLabData.getInstance().getDefaultLAICPMSPrimaryMineralStandardModel());
}
acquisitionModel.setLeftShadeCount(ReduxLabData.getInstance().getDefaultLeftShadeCountForLAICPMSAquisitions());
if (rawDataFileTemplate instanceof ShrimpPrawn_RawDataTemplate_GA) {
// if (acquisitionModel.getPrimaryMineralStandardModel() == null) {
// acquisitionModel.setPrimaryMineralStandardModel(ReduxLabData.getInstance().getDefaultLAICPMSPrimaryMineralStandardModel());
// }
acquisitionModel.setLeftShadeCount(ReduxLabData.getInstance().getDefaultLeftShadeCountForSHRIMPAquisitions());

} catch (BadLabDataException ex) {
new ETWarningDialog(ex).setVisible(true);
} else {
try {
if (acquisitionModel.getPrimaryMineralStandardModel() == null) {
acquisitionModel.setPrimaryMineralStandardModel(ReduxLabData.getInstance().getDefaultLAICPMSPrimaryMineralStandardModel());
}
acquisitionModel.setLeftShadeCount(ReduxLabData.getInstance().getDefaultLeftShadeCountForLAICPMSAquisitions());

} catch (BadLabDataException ex) {
new ETWarningDialog(ex).setVisible(true);
}
}

project.setAcquisitionModel(acquisitionModel);

// user selects raw data file(s)
Expand Down Expand Up @@ -476,7 +486,7 @@ public void propertyChange(PropertyChangeEvent pce) {
loadDataTaskProgressBar.setValue(progress);
loadDataTaskProgressBar.validate();
} else if ("projectName".equalsIgnoreCase(pce.getPropertyName())) {
project.setProjectName((String)pce.getNewValue());
project.setProjectName((String) pce.getNewValue());
projectName_text.setText(project.getProjectName());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ public ReportCategory(
this.legacyData = false;

}

private ReportColumnInterface SetupReportColumn(int index, String[][] specs) {
String displayName1 = specs[index][0];
ReportColumnInterface retVal = new ReportColumn(//
displayName1, //specs[index][0], // displayname1
specs[index][1].equalsIgnoreCase("delta") ? " \u03B4" : specs[index][1], // displayname2
specs[index][1].contains("delta") ? specs[index][1].replace("delta", "\u03B4") : specs[index][1], // displayname2
specs[index][2], // displayname3
index, // positionIndex
specs[index][3], // units
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ReportCategoryXMLConverter.java
*
*
* Copyright 2006-2015 James F. Bowring and www.Earth-Time.org
* Copyright 2006-2016 James F. Bowring and www.Earth-Time.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ReportColumnXMLConverter.java
*
*
* Copyright 2006-2015 James F. Bowring and www.Earth-Time.org
* Copyright 2006-2016 James F. Bowring and www.Earth-Time.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -93,11 +93,7 @@ public void marshal(Object value, HierarchicalStreamWriter writer,
writer.startNode("displayName2");
String displayName2 = reportColumn.getDisplayName2();
// test for delta
if (displayName2.contains("\u03B4")) {
writer.setValue("LOWERCASEDELTA");
} else {
writer.setValue(reportColumn.getDisplayName2());
}
writer.setValue(displayName2.replace("\u03B4", "LOWERCASEDELTA"));
writer.endNode();

writer.startNode("displayName3");
Expand Down Expand Up @@ -204,11 +200,7 @@ public Object unmarshal(HierarchicalStreamReader reader,
reader.moveDown();
String displayName2 = reader.getValue();
// test for delta
if (displayName2.contains("LOWERCASEDELTA")) {
reportColumn.setDisplayName2(" \u03B4");
} else {
reportColumn.setDisplayName2(displayName2);
}
reportColumn.setDisplayName2(displayName2.replace("LOWERCASEDELTA", "\u03B4"));
reader.moveUp();

reader.moveDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 338;
private static transient int CURRENT_VERSION_REPORT_SETTINGS = 340;

// Fields
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) {
// 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
//
double initialCorrected234_238atomTatio = nai.get(1, 0) / nai.get(0, 0);//*lambda234D /lambda238D;

// outvec(2) = 2*sqrt(Cout(3,3))/outvec(1) * 100; % 2s% ar08t corrected
double ar230_238correctedOneSigmaABS = Math.sqrt(Cout.get(2, 2) / ar230_238corrected);

Expand All @@ -390,6 +391,7 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) {
double correctedDateOneSigmaAbs = Math.sqrt(Cout.get(0, 0));

// outvec(12) = 2*sqrt(Cout(4,4)); % 2s abs ar48i
double initialCorrected234_238atomTatioOneSigmaAbs = Math.sqrt(Cout.get(3, 3));
// outvec(13) = Cout(1,4)/sqrt(Cout(1,1)*Cout(4,4));

ValueModel dateCorr = new ValueModel(//
Expand All @@ -410,15 +412,22 @@ private static void calculateDatesFromLegacyData(UThLegacyFractionI fraction) {
.setValue(ar234_238corrected);
fraction.getAnalysisMeasure(UThAnalysisMeasures.ar234U_238Ufc.getName())//
.setOneSigma(ar234_238correctedOneSigmaABS);

BigDecimal secularEquilibrium = lambda238.getValue().divide(lambda234.getValue(), ReduxConstants.mathContext15);
BigDecimal delta234UInitialValue
= new BigDecimal(initialCorrected234_238atomTatio).subtract(secularEquilibrium)//
.divide(secularEquilibrium, ReduxConstants.mathContext15).movePointRight(3);
BigDecimal delta234UInitialValueOneSigmaAbs
= new BigDecimal(initialCorrected234_238atomTatioOneSigmaAbs).movePointRight(3);

ValueModel delta234U = new ValueModel(//
UThFractionationCorrectedIsotopicRatios.delta234U.getName(), //
BigDecimal.ZERO, ///
delta234UInitialValue, ///
"ABS", //
BigDecimal.ZERO, //
delta234UInitialValueOneSigmaAbs, //
BigDecimal.ZERO);
fraction.setRadiogenicIsotopeRatioByName(UThFractionationCorrectedIsotopicRatios.delta234U.getName(), delta234U);

}

private static Matrix exponentialGUTh(Double t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public class ReportSpecifications {
{"", "Corr", "Date", "ka", "getRadiogenicIsotopeDateByName", RadDates.dateCorr.getName(), "ABS",
"", "true", "false", "2", "true", "", "false", "false"
},
{"", "delta", "234U", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.delta234U.getName(), "ABS",
{"", "delta 234U", "initial", "", "getRadiogenicIsotopeRatioByName", UThFractionationCorrectedIsotopicRatios.delta234U.getName(), "ABS",
"", "true", "false", "2", "true", "", "false", "false"
}
};
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/earthtime/reduxLabData/ReduxLabData.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public final class ReduxLabData implements Serializable {
private AbstractRatiosDataModel defaultLAICPMSPrimaryMineralStandardModel;
private AbstractRatiosDataModel defaultRareEarthElementModel;
private int defaultLeftShadeCountForLAICPMSAquisitions;
private int defaultLeftShadeCountForSHRIMPAquisitions;
// nov 2015
private AbstractRatiosDataModel defaultDetritalUraniumAndThoriumModel;
// feb 2016
Expand Down Expand Up @@ -218,6 +219,7 @@ private ReduxLabData() {
}

this.defaultLeftShadeCountForLAICPMSAquisitions = 0;
this.defaultLeftShadeCountForSHRIMPAquisitions = 0;

initDefaultInterReferenceMaterialReproducibilityMap();

Expand Down Expand Up @@ -2026,4 +2028,18 @@ public void setDefaultInterReferenceMaterialReproducibilityMap(Map<RadRatios, Va
this.defaultInterReferenceMaterialReproducibilityMap = defaultInterReferenceMaterialReproducibilityMap;
}

/**
* @return the defaultLeftShadeCountForSHRIMPAquisitions
*/
public int getDefaultLeftShadeCountForSHRIMPAquisitions() {
return defaultLeftShadeCountForSHRIMPAquisitions;
}

/**
* @param defaultLeftShadeCountForSHRIMPAquisitions the defaultLeftShadeCountForSHRIMPAquisitions to set
*/
public void setDefaultLeftShadeCountForSHRIMPAquisitions(int defaultLeftShadeCountForSHRIMPAquisitions) {
this.defaultLeftShadeCountForSHRIMPAquisitions = defaultLeftShadeCountForSHRIMPAquisitions;
}

}

0 comments on commit 159d48f

Please sign in to comment.