Skip to content

Commit

Permalink
Merge pull request #54 from bowring/shrimpdibbs
Browse files Browse the repository at this point in the history
Preparing for U Kansas, DIBBs, and Shrimp with continuous refactoring.
  • Loading branch information
bowring committed Feb 21, 2016
2 parents 79fcf8b + 2ecfec1 commit a9e4034
Show file tree
Hide file tree
Showing 67 changed files with 5,679 additions and 648 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>org.cirdles</groupId>
<artifactId>ET_Redux</artifactId>
<name>ET_Redux</name>
<version>3.4.2</version>
<version>3.4.3</version>
<description>Successor to U-Pb_Redux</description>
<url>https://cirdles.org</url>
<inceptionYear>2006</inceptionYear>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/earthtime/ETReduxFrame.form
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<MenuItem class="javax.swing.JMenuItem" name="newProjectRawDataSHRIMP">
<Properties>
<Property name="text" type="java.lang.String" value="SHRIMP - in development - DEMO only"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="newProjectRawDataSHRIMPActionPerformed"/>
Expand Down Expand Up @@ -477,7 +476,7 @@
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="editMineralStandardsModels">
<Properties>
<Property name="text" type="java.lang.String" value="Mineral Standards Models"/>
<Property name="text" type="java.lang.String" value="Reference Material Models"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="editMineralStandardsModelsActionPerformed"/>
Expand Down
94 changes: 49 additions & 45 deletions src/main/java/org/earthtime/ETReduxFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ private void openTheProject(File projectReduxFile) {
} else if (!(deserializedFile instanceof ProjectInterface)) {
System.out.println("Trying to open an invalid .redux file.");
} else {

// project
stopLiveUpdate();

myState.setMRUProjectFile(projectReduxFile);
Expand Down Expand Up @@ -584,8 +584,13 @@ private void openTheProject(File projectReduxFile) {

} else { // instantiate project manager so processing can be initialited

myProjectManager
= new ProjectManagerFor_LAICPMS_FromRawData(this, true, myState, theProject);
if (theProject.getSampleAnalysisType().compareTo(SampleAnalysisTypesEnum.LAICPMS) == 0) {
myProjectManager
= new ProjectManagerFor_LAICPMS_FromRawData(this, true, myState, theProject);
} else if (theProject.getSampleAnalysisType().compareTo(SampleAnalysisTypesEnum.SHRIMP) == 0) {
myProjectManager
= new ProjectManagerFor_SHRIMP_FromRawData(this, true, myState, theProject);
}
myProjectManager.initDialogContent();
myProjectManager.setVisible(true);
}
Expand Down Expand Up @@ -776,11 +781,13 @@ private void manageTheProject() {
new ETWarningDialog(ex).setVisible(true);
}
}
} else {
} else if (theProject.getSampleAnalysisType().compareTo(SampleAnalysisTypesEnum.LAICPMS) == 0) {
myProjectManager
= new ProjectManagerFor_LAICPMS_FromRawData(this, true, myState, theProject);
} else if (theProject.getSampleAnalysisType().compareTo(SampleAnalysisTypesEnum.SHRIMP) == 0) {
myProjectManager
= new ProjectManagerFor_SHRIMP_FromRawData(this, true, myState, theProject);
}

myProjectManager.initDialogContent();
}

Expand All @@ -792,21 +799,32 @@ private void manageTheProject() {
}

private void manageRawDataSession() {
if ((myProjectManager == null) || !(myProjectManager instanceof ProjectManagerFor_LAICPMS_FromRawData)) {
myProjectManager
= new ProjectManagerFor_LAICPMS_FromRawData(this, true, myState, theProject);
myProjectManager.initDialogContent();
if (theProject.getSampleAnalysisType().compareTo(SampleAnalysisTypesEnum.LAICPMS) == 0) {
if ((myProjectManager == null) || !(myProjectManager instanceof ProjectManagerFor_LAICPMS_FromRawData)) {
myProjectManager
= new ProjectManagerFor_LAICPMS_FromRawData(this, true, myState, theProject);
myProjectManager.initDialogContent();
}
}
if (theProject.getSampleAnalysisType().compareTo(SampleAnalysisTypesEnum.SHRIMP) == 0) {
if ((myProjectManager == null) || !(myProjectManager instanceof ProjectManagerFor_SHRIMP_FromRawData)) {
myProjectManager
= new ProjectManagerFor_SHRIMP_FromRawData(this, true, myState, theProject);
myProjectManager.initDialogContent();
}
}

((ProjectManagerSubscribeInterface) myProjectManager).initializeSessionManager(false, true, false);
}

private void setUpNewTripolizedProject(String sampleAnalysisType) {
private void setUpNewTripolizedProject(SampleAnalysisTypesEnum sampleAnalysisType) {
theProject = new Project(myState);
theProject.setSampleAnalysisType(sampleAnalysisType);

if (sampleAnalysisType.equalsIgnoreCase(SampleAnalysisTypesEnum.LAICPMS.getName())) {
if (sampleAnalysisType.compareTo(SampleAnalysisTypesEnum.LAICPMS) == 0) {
myProjectManager
= new ProjectManagerFor_LAICPMS_FromRawData(this, true, myState, theProject);
} else if (sampleAnalysisType.equalsIgnoreCase(SampleAnalysisTypesEnum.SHRIMP.getName())) {
} else if (sampleAnalysisType.compareTo(SampleAnalysisTypesEnum.SHRIMP) == 0) {
myProjectManager
= new ProjectManagerFor_SHRIMP_FromRawData(this, true, myState, theProject);
}
Expand Down Expand Up @@ -1299,8 +1317,7 @@ private boolean saveSampleFileAs() throws BadLabDataException {
* @throws BadLabDataException
*/
@Override
public synchronized void setUpTheSample(boolean performReduction)
throws BadLabDataException {
public synchronized void setUpTheSample(boolean performReduction) {

theSample.setUpSample();

Expand Down Expand Up @@ -1493,9 +1510,8 @@ public void loadAndShowReportTableData() {
((TabbedReportViews) getReportTableTabbedPane()).prepareTabs();
}

private void openTheSample(File selFile, boolean checkSavedStatus) throws BadLabDataException {
private void openTheSample(File selFile, boolean checkSavedStatus) {

// forceCloseOfSampleDateInterpretations();
closeProjectAndOrSample();

if (checkSavedStatus) {
Expand Down Expand Up @@ -2252,7 +2268,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
newProjectFromRawData_menu.add(newProjectRawDataLAICPMS);

newProjectRawDataSHRIMP.setText("SHRIMP - in development - DEMO only");
newProjectRawDataSHRIMP.setEnabled(false);
newProjectRawDataSHRIMP.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
newProjectRawDataSHRIMPActionPerformed(evt);
Expand Down Expand Up @@ -2650,7 +2665,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
});
labDataMenu.add(editPhysicalConstantsModels);

editMineralStandardsModels.setText("Mineral Standards Models");
editMineralStandardsModels.setText("Reference Material Models");
editMineralStandardsModels.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
editMineralStandardsModelsActionPerformed(evt);
Expand Down Expand Up @@ -3071,12 +3086,7 @@ private void visitGeoSamplesOrgActionPerformed(java.awt.event.ActionEvent evt) {
private void mruSampleMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
// open the MRU sample file
if (checkSavedStatusTheSample()) {
try {
openTheSample(new File(((AbstractButton) evt.getSource()).getText()), true);
} catch (BadLabDataException ex) {
new ETWarningDialog(ex).setVisible(true);
}

openTheSample(new File(((AbstractButton) evt.getSource()).getText()), true);
}
}

Expand All @@ -3098,7 +3108,9 @@ private void sampleFileMenuActionPerformed(java.awt.event.ActionEvent evt) {//GE
*/
public void loadMostRecentProject(boolean checkSavedStatus) {
ArrayList<String> myMRUs = myState.getMRUProjectList();
openTheProject(new File(myMRUs.get(0)));
if (!myMRUs.isEmpty()) {
openTheProject(new File(myMRUs.get(0)));
}
}

/**
Expand All @@ -3107,12 +3119,8 @@ public void loadMostRecentProject(boolean checkSavedStatus) {
*/
public void loadMostRecentSample(boolean checkSavedStatus) {
ArrayList<String> myMRUs = myState.getMRUSampleList();

try {
if (!myMRUs.isEmpty()) {
openTheSample(new File(myMRUs.get(0)), checkSavedStatus);
} catch (BadLabDataException ex) {
new ETWarningDialog(ex).setVisible(true);
System.out.println("No Recent File");
}
}

Expand Down Expand Up @@ -3171,6 +3179,7 @@ private void sampleFileMenuMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-
}//GEN-LAST:event_sampleFileMenuMenuSelected

//**************************************PROJECT MENUS **********************
// private ArrayList<String>
/**
*
*/
Expand Down Expand Up @@ -3251,11 +3260,8 @@ private void manageSampleModel_menuItemActionPerformed(java.awt.event.ActionEven
}

// setup sample and views with no datareduction flag = true
try {
setUpTheSample(!theSample.isAnalyzed());
} catch (BadLabDataException ex) {
new ETWarningDialog(ex).setVisible(true);
}
setUpTheSample(!theSample.isAnalyzed());

}//GEN-LAST:event_manageSampleModel_menuItemActionPerformed

private void saveSampleFileAsActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveSampleFileAsActionPerformed
Expand Down Expand Up @@ -3432,7 +3438,7 @@ private void manageSampleDateInterpretation(SampleTreeI dateTreeByAliquot, Sampl
sampleDateInterpDialog.dispose();
}
sampleDateInterpDialog
= //
=
new SampleDateInterpretationsManager(
this,
false,// try floating as of october 2014 true,
Expand Down Expand Up @@ -3651,11 +3657,9 @@ private void performSampleDataUpdate() {
}
theSample.setSampleType(SampleTypesEnum.ANALYSIS.getName());
liveUpdateSample();
try {
setUpTheSample(false);
} catch (BadLabDataException ex) {
new ETWarningDialog(ex).setVisible(true);
}

setUpTheSample(false);

}

/**
Expand Down Expand Up @@ -4053,7 +4057,7 @@ private void reportResultsTableAsNumbersInCSV_menuItemActionPerformed ( java.awt
}//GEN-LAST:event_reportResultsTableAsNumbersInCSV_menuItemActionPerformed

private void newProjectRawDataLAICPMSActionPerformed ( java.awt.event.ActionEvent evt ) {//GEN-FIRST:event_newProjectRawDataLAICPMSActionPerformed
setUpNewTripolizedProject(SampleAnalysisTypesEnum.LAICPMS.getName());
setUpNewTripolizedProject(SampleAnalysisTypesEnum.LAICPMS);
}//GEN-LAST:event_newProjectRawDataLAICPMSActionPerformed

private void openProjectFile_menuItemActionPerformed ( java.awt.event.ActionEvent evt ) {//GEN-FIRST:event_openProjectFile_menuItemActionPerformed
Expand Down Expand Up @@ -4165,12 +4169,12 @@ private void writeCSVFileOfProjectLegacyDataSampleFieldNames_UCSB_LASS_AActionPe

private void loadLastProject_buttonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadLastProject_buttonMouseEntered
ArrayList<String> myMRUs = myState.getMRUProjectList();
loadLastProject_button.setToolTipText(myMRUs.get(0));
loadLastProject_button.setToolTipText(myMRUs.isEmpty() ? "No recent projects" : myMRUs.get(0));
}//GEN-LAST:event_loadLastProject_buttonMouseEntered

private void loadLastSample_buttonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadLastSample_buttonMouseEntered
ArrayList<String> myMRUs = myState.getMRUSampleList();
loadLastSample_button.setToolTipText(myMRUs.get(0));
loadLastSample_button.setToolTipText(myMRUs.isEmpty() ? "No recent samples" : myMRUs.get(0));
}//GEN-LAST:event_loadLastSample_buttonMouseEntered

private void dibbs_USeriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dibbs_USeriesActionPerformed
Expand All @@ -4182,7 +4186,7 @@ private void reportSettingsHelpActionPerformed(java.awt.event.ActionEvent evt) {
}//GEN-LAST:event_reportSettingsHelpActionPerformed

private void newProjectRawDataSHRIMPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newProjectRawDataSHRIMPActionPerformed
setUpNewTripolizedProject(SampleAnalysisTypesEnum.SHRIMP.getName());
setUpNewTripolizedProject(SampleAnalysisTypesEnum.SHRIMP);
}//GEN-LAST:event_newProjectRawDataSHRIMPActionPerformed

private void helpMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ public class MaskingSingleton implements Serializable {

// Class variables
private static final long serialVersionUID = -2086025499717049075L;
private static MaskingSingleton instance = null;
private static MaskingSingleton instance = new MaskingSingleton();
// instance variables
private boolean[] maskingArray;
private int leftShadeCount;
private int rightShadeCount;

private MaskingSingleton() {

maskingArray = new boolean[0];
leftShadeCount = -1;
rightShadeCount = -1;
}
Expand All @@ -46,9 +47,6 @@ private MaskingSingleton() {
* @return
*/
public static MaskingSingleton getInstance() {
if (instance == null) {
instance = new MaskingSingleton();
}
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ public void calculateIntensityMatrixSDiagonal(double integrationTime) {

diagonalOfMatrixSIntensities = collectorModel.calculateMeasuredCountsAndMatrixSIntensityDiagonal( //
baselineIntensities.length, allItensities, integrationTime).clone();

}

/**
Expand Down Expand Up @@ -1215,4 +1214,18 @@ public void setUSING_FULL_PROPAGATION(boolean USING_FULL_PROPAGATION) {
public AbstractFunctionOfX getSelectedDownHoleFitFunction() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

/**
* @return the diagonalOfMatrixSIntensities
*/
public double[] getDiagonalOfMatrixSIntensities() {
return diagonalOfMatrixSIntensities;
}

/**
* @param diagonalOfMatrixSIntensities the diagonalOfMatrixSIntensities to set
*/
public void setDiagonalOfMatrixSIntensities(double[] diagonalOfMatrixSIntensities) {
this.diagonalOfMatrixSIntensities = diagonalOfMatrixSIntensities;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ public void calculateRawAndLogRatios() {
* @return
*/
public String outputLogRatios() {
String retval = //
String retval
= //
this.getDataModelName() + " \tLogRatios:\t";

for (int i = 0; i < logRatios.length; i++) {
Expand Down Expand Up @@ -290,11 +291,13 @@ public void propagateUnctInRatios() {
// v3 jan 2013 check if the SAME ion counter
hasTwoIdenticalIonCounters()) {

matrixSxyod = //
matrixSxyod
= //
((RawIntensityDataModel) topIsotope).getColumnVectorOfCorrectedOnPeakIntensities()//
.times(((RawIntensityDataModel) botIsotope).getColumnVectorOfCorrectedOnPeakIntensities().transpose());

double deadtimeOneSigmaAbsSqr = //
double deadtimeOneSigmaAbsSqr
= //
((IonCounterCollectorModel) botIsotope//
.getCollectorModel()).getDeadTime().getOneSigmaAbs().movePointLeft(0).pow(2).doubleValue();

Expand Down Expand Up @@ -1041,7 +1044,8 @@ public void generateSetOfFitFunctions(boolean propagateUncertainties, boolean do
public double[] getNormalizedOnPeakAquireTimes() {
double[] normalizedAquire = new double[ratios.length];
for (int i = 0; i < normalizedAquire.length; i++) {
normalizedAquire[i] =//
normalizedAquire[i]
=//
((RawIntensityDataModel) topIsotope).getOnPeakVirtualCollector().getOnPeakAquireTimes()[i] / COLLECTOR_DATA_FREQUENCY_MILLISECS;
}

Expand All @@ -1056,7 +1060,8 @@ public double[] getNormalizedOnPeakAquireTimes() {
public double[] getOnPeakAquireTimesInSeconds() {
double[] onPeakAquireTimesInSeconds = new double[ratios.length];
for (int i = 0; i < onPeakAquireTimesInSeconds.length; i++) {
onPeakAquireTimesInSeconds[i] =//
onPeakAquireTimesInSeconds[i]
=//
((RawIntensityDataModel) topIsotope).getOnPeakVirtualCollector().getOnPeakAquireTimes()[i] / 1000.0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void setCollectedDataStyle(CollectedDataStyle collectedDataStyle) {
public double[] calculateMeasuredCountsAndMatrixSIntensityDiagonal(int countOfBaselineIntensities, double[] allItensities, double integrationTime) {

double[] measuredVarianceFromIonCounts = new double[allItensities.length];
// measuredIntensityIonCounter = new double[allItensities.length];

for (int i = 0; i < allItensities.length; i++) {

measuredVarianceFromIonCounts[i] = allItensities[i] / integrationTime; // march 2013 Noah's famous EFFING comment / integrationTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import java.util.Map;
import org.earthtime.Tripoli.dataModels.collectorModels.FaradayCollectorModel;
import org.earthtime.Tripoli.massSpecSetups.AbstractMassSpecSetup;
import org.earthtime.UPb_Redux.exceptions.BadLabDataException;
import org.earthtime.reduxLabData.ReduxLabData;
import org.earthtime.dataDictionaries.AcquisitionTypesEnum;
import org.earthtime.ratioDataModels.AbstractRatiosDataModel;

Expand Down Expand Up @@ -110,10 +108,8 @@ public AbstractAcquisitionModel() {
this.usingFullPropagation = true;
this.leftShadeCount = 0;

try {
this.primaryMineralStandardModel = ReduxLabData.getInstance().getDefaultLAICPMSPrimaryMineralStandardModel();
} catch (BadLabDataException badLabDataException) {
}
this.primaryMineralStandardModel = null;

}

/**
Expand Down
Loading

0 comments on commit a9e4034

Please sign in to comment.