Skip to content

Commit

Permalink
New version 2.999
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Lutterotti committed Jul 3, 2023
1 parent f9dde8c commit 9b8e818
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 30 deletions.
8 changes: 8 additions & 0 deletions Maud.iws
Expand Up @@ -6,6 +6,14 @@
<component name="ChangeListManager">
<list default="true" id="61caab25-241f-4ab1-85f0-b423f2950da9" name="Changes" comment="New version 5/2023&#10;Some modifications on GSASDataFile and more options for plotting types.">
<change beforePath="$PROJECT_DIR$/Maud.iws" beforeDir="false" afterPath="$PROJECT_DIR$/Maud.iws" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build.xml" beforeDir="false" afterPath="$PROJECT_DIR$/build.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/help/readme.txt" beforeDir="false" afterPath="$PROJECT_DIR$/src/help/readme.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/DataFileSet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/DataFileSet.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/FilePar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/FilePar.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/Phase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/Phase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/Sample.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/Sample.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/instbroad/InstrumentBroadeningGSAS1f.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/it/unitn/ing/rista/diffr/instbroad/InstrumentBroadeningGSAS1f.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/it/unitn/ing/rista/util/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/it/unitn/ing/rista/util/Constants.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
Expand Down
8 changes: 4 additions & 4 deletions build.xml
Expand Up @@ -16,7 +16,7 @@
<property name="myself" value="myself"/>
<property name="bundle.icon" value="maud.icns"/>
<property name="icon" value="src/images/${bundle.icon}"/>
<property name="maud_version" value="2.998"/>
<property name="maud_version" value="2.999"/>
<property name="application_OSX.title" value="Maud.app"/>
<property name="app_osx_295" location="${user.home}/Projects/maud/osx_295"/>
<property name="app_osx_arm" location="${user.home}/Projects/maud/osx_arm"/>
Expand Down Expand Up @@ -2073,7 +2073,7 @@
shortversion="${maud_version}"
icon="${icon}"
mainclassname="com.radiographema.Maud"
copyright="Maud, for materials analysis, Copyright 1997-2022 Luca Lutterotti"
copyright="Maud, for materials analysis, Copyright 1997-2064 Luca Lutterotti"
applicationCategory="public.app-category.productivity">

<!-- The directory where your OpenJDK runtime is. -->
Expand Down Expand Up @@ -2247,7 +2247,7 @@
shortversion="${maud_version}"
icon="${icon}"
mainclassname="com.radiographema.Maud"
copyright="Maud, for materials analysis, Copyright 1997-2022 Luca Lutterotti"
copyright="Maud, for materials analysis, Copyright 1997-2064 Luca Lutterotti"
applicationCategory="public.app-category.productivity">

<!-- The directory where your OpenJDK runtime is. -->
Expand Down Expand Up @@ -2673,7 +2673,7 @@
shortversion="${maud_version}"
icon="${icon}"
mainclassname="com.radiographema.Maud"
copyright="Maud, for materials analysis, Copyright 1997-2022 Luca Lutterotti"
copyright="Maud, for materials analysis, Copyright 1997-2064 Luca Lutterotti"
applicationCategory="public.app-category.productivity">

<!-- The directory where your OpenJDK runtime is. -->
Expand Down
Binary file modified libs/current/Help.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions src/help/readme.txt
Expand Up @@ -43,6 +43,11 @@ from the older one.

Maud Version notes:

(03/07/2023): 2.999. The "Holy grail" release.
Finally the slow as hell bug was found.
Fixing a bug that was slowing Maud a lot for certain analyses. It
started after version 2.995. Other speed improvements made.

(08/06/2023): 2.998. The "Rattle snake" release.
Someone you don't want to meet.
Fixing a bug on the new routines to modify statistical weights for
Expand Down
5 changes: 4 additions & 1 deletion src/it/unitn/ing/rista/diffr/DataFileSet.java
Expand Up @@ -352,6 +352,9 @@ public void updateStringtoDoubleBuffering(boolean firstLoading) {
}


public boolean shouldNotifyParent(XRDcat source, int reason) {
return false; // not the default
}
public double[] dataForPlot = null;

public double[] getDataForPlot() {
Expand Down Expand Up @@ -2719,7 +2722,7 @@ public int getNumberOfData() {

@Override
public boolean isActive(XRDcat obj) {
return isEnabled() && super.isActive(obj);
return enabled(); // not needed, it check again if dataset enabled: && super.isActive(obj);
}

public double[] getData() {
Expand Down
8 changes: 5 additions & 3 deletions src/it/unitn/ing/rista/diffr/FilePar.java
Expand Up @@ -2474,9 +2474,9 @@ public void mainfunction(boolean hasoutput, boolean refreshAll) {
if (Constants.testtime)
Constants.tmpTime = System.currentTimeMillis();

refreshAll(false);
// refreshAll = MaudPreferences.getBoolean("testing.computeWithRefresh", false);
// boolean forceRefreshAll = MaudPreferences.getBoolean("testing.computeWithRefresh", false);
if (refreshAll) {
refreshAll(false);
//b else
//b refreshPartially = true; // speedModification

Expand All @@ -2488,7 +2488,9 @@ public void mainfunction(boolean hasoutput, boolean refreshAll) {
}
// System.out.println("Updating phases");
updateAllPhases();
}
}/* else if (forceRefreshAll) {
refreshAll(false);
}*/
indexesComputed = false;
// to be implemented in subclasses
for (int i = 0; i < samplesNumber(); i++) {
Expand Down
14 changes: 13 additions & 1 deletion src/it/unitn/ing/rista/diffr/Phase.java
Expand Up @@ -741,7 +741,19 @@ public void refreshAll(boolean firstLoading) {
// getActiveStress().refreshStress = true;
CellSymmetry();
}
super.refreshAll(firstLoading);
// super.refreshAll(firstLoading);
// this is what the super does, we remove some of the objects refresh
refreshComputation = true;
setRefreshAllStatus();
update(firstLoading);
Object[] childrens = getObjectChildren();
int numberOfChildrens = childrens.length;
for (int i = 0; i < numberOfChildrens; i++) {
// System.out.println(this.toXRDcatString() + ": " + childrens[i].toXRDcatString());
XRDcat subObject = (XRDcat) childrens[i];
if (subObject != getActiveTexture() || subObject != getActiveStrain())
subObject.refreshAll(firstLoading);
}
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/it/unitn/ing/rista/diffr/Sample.java
Expand Up @@ -645,9 +645,7 @@ public void setNumberActiveDatafiles(int value) {
}

public boolean isDataSetActive(DataFileSet adataset) {
if (adataset.enabled())
return true;
return false;
return adataset.enabled();
}

public Layer getlayer(int index) {
Expand Down
Expand Up @@ -167,12 +167,14 @@ public void notifyParameterChanged(Parameter source) {
}

double truncationFactor = 0.01;
double log_truncation = Math.log(truncationFactor);
int convolutionStep = MaudPreferences.getInteger("asymmetry.convolutionStep", 1);

public void updateStringtoDoubleBuffering(boolean firstLoading) {
super.updateStringtoDoubleBuffering(false);
int banks = banknumbers();
truncationFactor = Double.parseDouble(getTruncationField());
log_truncation = Math.log(truncationFactor);
typeNumber = new int[banks];
for (int bank = 0; bank < banks; bank++)
typeNumber[bank] = getTypeNumber(bank);
Expand Down Expand Up @@ -555,9 +557,10 @@ public double getSecondInstrumentalAsymmetry(double d, DiffrDataFile diffrDataFi
public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double[] afit, int min, int max) {


Instrument ainstrument = (Instrument) getParent();
// Instrument ainstrument = (Instrument) getParent();

double newFit[];
double[] newFit = null;
double[] cal = null;

double total_asymmetrymin = getInstrumentalAsymmetry(diffrDataFile.getXData(min), diffrDataFile);
total_asymmetrymin = Math.abs(total_asymmetrymin);
Expand All @@ -566,10 +569,13 @@ public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double
// System.out.println(total_asymmetrymax + " " + total_asymmetrymin);
if (Math.min(total_asymmetrymax, total_asymmetrymin) < 1 && max > min) {
newFit = new double[max - min];
cal = new double[max - min];
for (int j = min; j < max; j++)
cal[j - min] = diffrDataFile.getXDataForCalibration(j);

for (int j = min; j < max; j++) {
int absdirection = convolutionStep; // increasing step
double x = diffrDataFile.getXDataForCalibration(j);
double x = cal[j - min];
double total_asymmetry = getInstrumentalAsymmetry(diffrDataFile.getXData(j), diffrDataFile);
// System.out.println(total_asymmetry);
if (total_asymmetry == 0.0)
Expand All @@ -583,13 +589,13 @@ public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double
double function = afit[j];
double normalization = 1.0;
int ij = j + direction;
if (diffrDataFile.insiderange(ij)) {
double difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
if (ij < max && ij >= min) { //diffrDataFile.insiderange(ij)) {
double difference = Math.abs(cal[ij - min] - x);
double expasymmetry = 1.0;
double truncation_angle = Math.abs(-Math.log(truncationFactor) / total_asymmetry);
double truncation_angle = Math.abs(-log_truncation / total_asymmetry);
// System.out.println(total_asymmetry + " " + truncation_angle + " " + difference);
for (; difference < truncation_angle && diffrDataFile.insiderange(ij); ij += direction) {
difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
for (; difference < truncation_angle && ij < max && ij >= min; ij += direction) { //diffrDataFile.insiderange(ij); ij += direction) {
difference = Math.abs(cal[ij - min] - x);
expasymmetry = Math.exp(-difference * total_asymmetry);
function += afit[ij] * expasymmetry;
normalization += expasymmetry;
Expand All @@ -612,11 +618,17 @@ public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double
total_asymmetrymax = Math.abs(total_asymmetrymax);
// System.out.println("alpha " + total_asymmetrymax + " " + total_asymmetrymin);
if (Math.min(total_asymmetrymax, total_asymmetrymin) < 1) {
newFit = new double[max - min];
if (newFit == null)
newFit = new double[max - min];
if (cal == null) {
cal = new double[max - min];
for (int j = min; j < max; j++)
cal[j - min] = diffrDataFile.getXDataForCalibration(j);
}

for (int j = min; j < max; j++) {
int absdirection = -1; // increasing step
double x = diffrDataFile.getXDataForCalibration(j);
double x = cal[j-min];
double total_asymmetry = getSecondInstrumentalAsymmetry(diffrDataFile.getXData(j), diffrDataFile);
// System.out.println(total_asymmetry);
if (total_asymmetry == 0.0)
Expand All @@ -630,13 +642,13 @@ public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double
double function = afit[j];
double normalization = 1.0;
int ij = j + direction;
if (diffrDataFile.insiderange(ij)) {
double difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
if (ij < max && ij >= min) {
double difference = Math.abs(cal[ij - min] - x);
double expasymmetry = 1.0;
double truncation_angle = Math.abs(-Math.log(truncationFactor) / total_asymmetry);
double truncation_angle = Math.abs(-log_truncation / total_asymmetry);
// System.out.println(total_asymmetry + " " + truncation_angle + " " + difference);
for (; difference < truncation_angle && diffrDataFile.insiderange(ij); ij += direction) {
difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
for (; difference < truncation_angle && ij < max && ij >= min; ij += direction) {
difference = Math.abs(cal[ij - min] - x);
expasymmetry = Math.exp(-difference * total_asymmetry);
function += afit[ij] * expasymmetry;
normalization += expasymmetry;
Expand Down
6 changes: 3 additions & 3 deletions src/it/unitn/ing/rista/util/Constants.java
Expand Up @@ -266,13 +266,13 @@ public class Constants {
public static String resultsFile = "results.txt";
public static String userName = null;
public static String startPath = "/";
public static String maudReleaseBuilt = "$Revision: 2.998 $";
public static String maudDateBuilt = "$Date: 2023/06/08 11:07:00 $";
public static String maudReleaseBuilt = "$Revision: 2.999 $";
public static String maudDateBuilt = "$Date: 2023/07/03 07:40:00 $";

public static final double arg2PIover3 = PI2 / 3.;
public static final double sinArg2PIover3 = Math.sin(arg2PIover3);
public static final double cosArg2PIover3 = Math.cos(arg2PIover3);
public static double maud_version = 2.998;
public static double maud_version = 2.999;
public static boolean useOpenCL = false;
public static Vector<OpenCLDevice> openClDevices= null;
public static OpenCLDevice openclDevice = null;
Expand Down

0 comments on commit 9b8e818

Please sign in to comment.