Commit 238d29e8 authored by Andrey Filippov's avatar Andrey Filippov

Improving efficiency

parent c5547fbb
......@@ -10407,6 +10407,7 @@ LogTee.clearSceneLog(); // stop per‑scene logging
for (int i=0;i<enabledFiles.length;i++) enabledFiles[i]=false;
int numFilesToProcess=0;
int numImagesToProcess=0;
/*
for (int nFile=0;nFile<enabledFiles.length;nFile++){
if ( (sourceFiles[nFile]!=null) &&
(sourceFiles[nFile].length() > 1) &&
......@@ -10420,6 +10421,28 @@ LogTee.clearSceneLog(); // stop per‑scene logging
}
}
}
}
*/
int [][] channels_files = new int[enabledFiles.length][]; // (single_set_name == null) ? null: new int[enabledFiles.length][];
for (int nFile=0;nFile<enabledFiles.length;nFile++) if ((sourceFiles[nFile]!=null) && (sourceFiles[nFile].length() > 1)) {
boolean do_proc = (single_set_name == null);
if (!do_proc) {
String name_from_tiff=correctionsParameters.getNameFromTiff(sourceFiles[nFile]);
if ((name_from_tiff != null) && (name_from_tiff.contains(single_set_name))) {
do_proc = true;
}
}
if (do_proc) {
int [] channels= fileChannelToSensorChannels(correctionsParameters.getChannelFromSourceTiff(sourceFiles[nFile]));
channels_files[nFile] = channels;
if (channels!=null){
for (int i=0;i<channels.length;i++) if (eyesisCorrections.isChannelEnabled(channels[i])){
if (!enabledFiles[nFile]) numFilesToProcess++;
enabledFiles[nFile]=true;
numImagesToProcess++;
}
}
}
}
if (numFilesToProcess==0){
System.out.println("No files to process (of "+sourceFiles.length+")");
......@@ -10429,11 +10452,8 @@ LogTee.clearSceneLog(); // stop per‑scene logging
}
int [][] fileIndices=new int [numImagesToProcess][2]; // file index, channel number
int index=0;
for (int nFile=0;nFile<enabledFiles.length;nFile++){ // enabledFiles not used anymore?
// if ((single_set_name != null) && (correctionsParameters.getNameFromTiff(sourceFiles[nFile])==null)) {
// System.out.println("sourceFiles["+nFile+"]==null");
// continue;
// }
for (int nFile=0;nFile<enabledFiles.length;nFile++) if ((sourceFiles[nFile]!=null) && (sourceFiles[nFile].length()>1)) { // enabledFiles not used anymore?
/*
if ( (sourceFiles[nFile]!=null) &&
(sourceFiles[nFile].length()>1) &&
((single_set_name == null) || ((correctionsParameters.getNameFromTiff(sourceFiles[nFile]) != null)&& correctionsParameters.getNameFromTiff(sourceFiles[nFile]).contains(single_set_name)))) { // not used in lwir
......@@ -10445,6 +10465,16 @@ LogTee.clearSceneLog(); // stop per‑scene logging
}
}
}
*/
if (channels_files[nFile] != null) {
int [] channels= channels_files[nFile]; // fileChannelToSensorChannels(correctionsParameters.getChannelFromSourceTiff(sourceFiles[nFile]));
if (channels!=null){
for (int i=0;i<channels.length;i++) if (eyesisCorrections.isChannelEnabled(channels[i])){
fileIndices[index ][0]=nFile;
fileIndices[index++][1]=channels[i];
}
}
}
}
ArrayList<String> setNames = new ArrayList<String>();
ArrayList<ArrayList<Integer>> setFiles = new ArrayList<ArrayList<Integer>>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment