Skip to content

Commit 9b8e818

Browse files
author
Luca Lutterotti
committed
New version 2.999
1 parent f9dde8c commit 9b8e818

File tree

10 files changed

+70
-30
lines changed

10 files changed

+70
-30
lines changed

Maud.iws

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
<component name="ChangeListManager">
77
<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.">
88
<change beforePath="$PROJECT_DIR$/Maud.iws" beforeDir="false" afterPath="$PROJECT_DIR$/Maud.iws" afterDir="false" />
9+
<change beforePath="$PROJECT_DIR$/build.xml" beforeDir="false" afterPath="$PROJECT_DIR$/build.xml" afterDir="false" />
10+
<change beforePath="$PROJECT_DIR$/src/help/readme.txt" beforeDir="false" afterPath="$PROJECT_DIR$/src/help/readme.txt" afterDir="false" />
11+
<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" />
12+
<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" />
13+
<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" />
14+
<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" />
15+
<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" />
16+
<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" />
917
</list>
1018
<option name="SHOW_DIALOG" value="false" />
1119
<option name="HIGHLIGHT_CONFLICTS" value="true" />

build.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<property name="myself" value="myself"/>
1717
<property name="bundle.icon" value="maud.icns"/>
1818
<property name="icon" value="src/images/${bundle.icon}"/>
19-
<property name="maud_version" value="2.998"/>
19+
<property name="maud_version" value="2.999"/>
2020
<property name="application_OSX.title" value="Maud.app"/>
2121
<property name="app_osx_295" location="${user.home}/Projects/maud/osx_295"/>
2222
<property name="app_osx_arm" location="${user.home}/Projects/maud/osx_arm"/>
@@ -2073,7 +2073,7 @@
20732073
shortversion="${maud_version}"
20742074
icon="${icon}"
20752075
mainclassname="com.radiographema.Maud"
2076-
copyright="Maud, for materials analysis, Copyright 1997-2022 Luca Lutterotti"
2076+
copyright="Maud, for materials analysis, Copyright 1997-2064 Luca Lutterotti"
20772077
applicationCategory="public.app-category.productivity">
20782078

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

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

26792679
<!-- The directory where your OpenJDK runtime is. -->

libs/current/Help.jar

80 Bytes
Binary file not shown.

src/help/readme.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ from the older one.
4343

4444
Maud Version notes:
4545

46+
(03/07/2023): 2.999. The "Holy grail" release.
47+
Finally the slow as hell bug was found.
48+
Fixing a bug that was slowing Maud a lot for certain analyses. It
49+
started after version 2.995. Other speed improvements made.
50+
4651
(08/06/2023): 2.998. The "Rattle snake" release.
4752
Someone you don't want to meet.
4853
Fixing a bug on the new routines to modify statistical weights for

src/it/unitn/ing/rista/diffr/DataFileSet.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ public void updateStringtoDoubleBuffering(boolean firstLoading) {
352352
}
353353

354354

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

357360
public double[] getDataForPlot() {
@@ -2719,7 +2722,7 @@ public int getNumberOfData() {
27192722

27202723
@Override
27212724
public boolean isActive(XRDcat obj) {
2722-
return isEnabled() && super.isActive(obj);
2725+
return enabled(); // not needed, it check again if dataset enabled: && super.isActive(obj);
27232726
}
27242727

27252728
public double[] getData() {

src/it/unitn/ing/rista/diffr/FilePar.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,9 +2474,9 @@ public void mainfunction(boolean hasoutput, boolean refreshAll) {
24742474
if (Constants.testtime)
24752475
Constants.tmpTime = System.currentTimeMillis();
24762476

2477-
refreshAll(false);
2478-
// refreshAll = MaudPreferences.getBoolean("testing.computeWithRefresh", false);
2477+
// boolean forceRefreshAll = MaudPreferences.getBoolean("testing.computeWithRefresh", false);
24792478
if (refreshAll) {
2479+
refreshAll(false);
24802480
//b else
24812481
//b refreshPartially = true; // speedModification
24822482

@@ -2488,7 +2488,9 @@ public void mainfunction(boolean hasoutput, boolean refreshAll) {
24882488
}
24892489
// System.out.println("Updating phases");
24902490
updateAllPhases();
2491-
}
2491+
}/* else if (forceRefreshAll) {
2492+
refreshAll(false);
2493+
}*/
24922494
indexesComputed = false;
24932495
// to be implemented in subclasses
24942496
for (int i = 0; i < samplesNumber(); i++) {

src/it/unitn/ing/rista/diffr/Phase.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,19 @@ public void refreshAll(boolean firstLoading) {
741741
// getActiveStress().refreshStress = true;
742742
CellSymmetry();
743743
}
744-
super.refreshAll(firstLoading);
744+
// super.refreshAll(firstLoading);
745+
// this is what the super does, we remove some of the objects refresh
746+
refreshComputation = true;
747+
setRefreshAllStatus();
748+
update(firstLoading);
749+
Object[] childrens = getObjectChildren();
750+
int numberOfChildrens = childrens.length;
751+
for (int i = 0; i < numberOfChildrens; i++) {
752+
// System.out.println(this.toXRDcatString() + ": " + childrens[i].toXRDcatString());
753+
XRDcat subObject = (XRDcat) childrens[i];
754+
if (subObject != getActiveTexture() || subObject != getActiveStrain())
755+
subObject.refreshAll(firstLoading);
756+
}
745757
}
746758
}
747759

src/it/unitn/ing/rista/diffr/Sample.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,7 @@ public void setNumberActiveDatafiles(int value) {
645645
}
646646

647647
public boolean isDataSetActive(DataFileSet adataset) {
648-
if (adataset.enabled())
649-
return true;
650-
return false;
648+
return adataset.enabled();
651649
}
652650

653651
public Layer getlayer(int index) {

src/it/unitn/ing/rista/diffr/instbroad/InstrumentBroadeningGSAS1f.java

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,14 @@ public void notifyParameterChanged(Parameter source) {
167167
}
168168

169169
double truncationFactor = 0.01;
170+
double log_truncation = Math.log(truncationFactor);
170171
int convolutionStep = MaudPreferences.getInteger("asymmetry.convolutionStep", 1);
171172

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

557559

558-
Instrument ainstrument = (Instrument) getParent();
560+
// Instrument ainstrument = (Instrument) getParent();
559561

560-
double newFit[];
562+
double[] newFit = null;
563+
double[] cal = null;
561564

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

570576
for (int j = min; j < max; j++) {
571577
int absdirection = convolutionStep; // increasing step
572-
double x = diffrDataFile.getXDataForCalibration(j);
578+
double x = cal[j - min];
573579
double total_asymmetry = getInstrumentalAsymmetry(diffrDataFile.getXData(j), diffrDataFile);
574580
// System.out.println(total_asymmetry);
575581
if (total_asymmetry == 0.0)
@@ -583,13 +589,13 @@ public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double
583589
double function = afit[j];
584590
double normalization = 1.0;
585591
int ij = j + direction;
586-
if (diffrDataFile.insiderange(ij)) {
587-
double difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
592+
if (ij < max && ij >= min) { //diffrDataFile.insiderange(ij)) {
593+
double difference = Math.abs(cal[ij - min] - x);
588594
double expasymmetry = 1.0;
589-
double truncation_angle = Math.abs(-Math.log(truncationFactor) / total_asymmetry);
595+
double truncation_angle = Math.abs(-log_truncation / total_asymmetry);
590596
// System.out.println(total_asymmetry + " " + truncation_angle + " " + difference);
591-
for (; difference < truncation_angle && diffrDataFile.insiderange(ij); ij += direction) {
592-
difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
597+
for (; difference < truncation_angle && ij < max && ij >= min; ij += direction) { //diffrDataFile.insiderange(ij); ij += direction) {
598+
difference = Math.abs(cal[ij - min] - x);
593599
expasymmetry = Math.exp(-difference * total_asymmetry);
594600
function += afit[ij] * expasymmetry;
595601
normalization += expasymmetry;
@@ -612,11 +618,17 @@ public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double
612618
total_asymmetrymax = Math.abs(total_asymmetrymax);
613619
// System.out.println("alpha " + total_asymmetrymax + " " + total_asymmetrymin);
614620
if (Math.min(total_asymmetrymax, total_asymmetrymin) < 1) {
615-
newFit = new double[max - min];
621+
if (newFit == null)
622+
newFit = new double[max - min];
623+
if (cal == null) {
624+
cal = new double[max - min];
625+
for (int j = min; j < max; j++)
626+
cal[j - min] = diffrDataFile.getXDataForCalibration(j);
627+
}
616628

617629
for (int j = min; j < max; j++) {
618630
int absdirection = -1; // increasing step
619-
double x = diffrDataFile.getXDataForCalibration(j);
631+
double x = cal[j-min];
620632
double total_asymmetry = getSecondInstrumentalAsymmetry(diffrDataFile.getXData(j), diffrDataFile);
621633
// System.out.println(total_asymmetry);
622634
if (total_asymmetry == 0.0)
@@ -630,13 +642,13 @@ public void computeAsymmetry(DiffrDataFile diffrDataFile, Sample asample, double
630642
double function = afit[j];
631643
double normalization = 1.0;
632644
int ij = j + direction;
633-
if (diffrDataFile.insiderange(ij)) {
634-
double difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
645+
if (ij < max && ij >= min) {
646+
double difference = Math.abs(cal[ij - min] - x);
635647
double expasymmetry = 1.0;
636-
double truncation_angle = Math.abs(-Math.log(truncationFactor) / total_asymmetry);
648+
double truncation_angle = Math.abs(-log_truncation / total_asymmetry);
637649
// System.out.println(total_asymmetry + " " + truncation_angle + " " + difference);
638-
for (; difference < truncation_angle && diffrDataFile.insiderange(ij); ij += direction) {
639-
difference = Math.abs(diffrDataFile.getXDataForCalibration(ij) - x);
650+
for (; difference < truncation_angle && ij < max && ij >= min; ij += direction) {
651+
difference = Math.abs(cal[ij - min] - x);
640652
expasymmetry = Math.exp(-difference * total_asymmetry);
641653
function += afit[ij] * expasymmetry;
642654
normalization += expasymmetry;

src/it/unitn/ing/rista/util/Constants.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ public class Constants {
266266
public static String resultsFile = "results.txt";
267267
public static String userName = null;
268268
public static String startPath = "/";
269-
public static String maudReleaseBuilt = "$Revision: 2.998 $";
270-
public static String maudDateBuilt = "$Date: 2023/06/08 11:07:00 $";
269+
public static String maudReleaseBuilt = "$Revision: 2.999 $";
270+
public static String maudDateBuilt = "$Date: 2023/07/03 07:40:00 $";
271271

272272
public static final double arg2PIover3 = PI2 / 3.;
273273
public static final double sinArg2PIover3 = Math.sin(arg2PIover3);
274274
public static final double cosArg2PIover3 = Math.cos(arg2PIover3);
275-
public static double maud_version = 2.998;
275+
public static double maud_version = 2.999;
276276
public static boolean useOpenCL = false;
277277
public static Vector<OpenCLDevice> openClDevices= null;
278278
public static OpenCLDevice openclDevice = null;

0 commit comments

Comments
 (0)