Commit b15f9feb authored by Andrey Filippov's avatar Andrey Filippov

Merge remote-tracking branch 'origin/dct'

parents c7e1de46 7c36f258
...@@ -12003,7 +12003,11 @@ if (MORE_BUTTONS) { ...@@ -12003,7 +12003,11 @@ if (MORE_BUTTONS) {
int loopDebugLevel){ int loopDebugLevel){
boolean noMove=false; boolean noMove=false;
if (newMotorPos==null) { if (newMotorPos==null) {
newMotorPos=focusingMotors.readElphel10364Motors().clone(); try {
newMotorPos=focusingMotors.readElphel10364Motors().clone();
} catch (Exception e){
System.out.println("moveAndMaybeProbe(): Failed to read motors");
}
justMove=true; justMove=true;
noMove=true; noMove=true;
} }
...@@ -12098,7 +12102,11 @@ if (MORE_BUTTONS) { ...@@ -12098,7 +12102,11 @@ if (MORE_BUTTONS) {
// System.out.println(">"+focusingMotors.historySize()+": "+focusingMotors.curpos[0]+", "+focusingMotors.curpos[1]+", "+focusingMotors.curpos[2]); // System.out.println(">"+focusingMotors.historySize()+": "+focusingMotors.curpos[0]+", "+focusingMotors.curpos[1]+", "+focusingMotors.curpos[2]);
boolean noMove=false; boolean noMove=false;
if (newMotorPos==null) { if (newMotorPos==null) {
newMotorPos=focusingMotors.readElphel10364Motors().clone(); try {
newMotorPos=focusingMotors.readElphel10364Motors().clone();
} catch (Exception e){
System.out.println("moveMeasureAndSave(): motors unreachable.");
}
noMove=true; noMove=true;
} }
if (!noMove)focusingMotors.moveElphel10364Motors( if (!noMove)focusingMotors.moveElphel10364Motors(
...@@ -2671,7 +2671,7 @@ public class CalibrationHardwareInterface { ...@@ -2671,7 +2671,7 @@ public class CalibrationHardwareInterface {
} }
boolean result=commandToDevice(command); boolean result=commandToDevice(command);
updateCurrents(); if (result) updateCurrents();
return result; return result;
} }
...@@ -2718,7 +2718,8 @@ public class CalibrationHardwareInterface { ...@@ -2718,7 +2718,8 @@ public class CalibrationHardwareInterface {
String msg = e1.getMessage(); String msg = e1.getMessage();
if (msg==null || msg.equals("")) msg = ""+e1; if (msg==null || msg.equals("")) msg = ""+e1;
IJ.showMessage("Error",msg); IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg); return false;
// throw new IllegalArgumentException (msg);
}catch(ParserConfigurationException pce) { }catch(ParserConfigurationException pce) {
pce.printStackTrace(); pce.printStackTrace();
return false; return false;
...@@ -3471,7 +3472,9 @@ public class CalibrationHardwareInterface { ...@@ -3471,7 +3472,9 @@ public class CalibrationHardwareInterface {
IJ.showStatus(""); IJ.showStatus("");
String error = e1.getMessage(); String error = e1.getMessage();
if (error==null || error.equals("")) error = ""+e1; if (error==null || error.equals("")) error = ""+e1;
IJ.showMessage("commandElphel10364Motors ERRROR", ""+error); System.out.println("commandElphel10364Motors ERRROR: "+error);
// *********** Temporary removed message box (usually "HOST UNREACHABLE") *************
// IJ.showMessage("commandElphel10364Motors ERRROR", ""+error);
return null; return null;
}catch(ParserConfigurationException pce) { }catch(ParserConfigurationException pce) {
pce.printStackTrace(); pce.printStackTrace();
...@@ -6529,7 +6532,9 @@ if (debugLevel>=debugThreshold) System.out.println(i+" "+diff[0]+" "+diff[1]+" " ...@@ -6529,7 +6532,9 @@ if (debugLevel>=debugThreshold) System.out.println(i+" "+diff[0]+" "+diff[1]+" "
} }
public double distFromProbed(int [] position){ public double distFromProbed(int [] position){
double minDist=Double.NaN; double minDist=Double.NaN;
if (this.history.size() <1) return Double.NaN;
if (position==null) position= this.history.get(this.history.size()-1).motorsPos; if (position==null) position= this.history.get(this.history.size()-1).motorsPos;
if (this.history.size()>0){ if (this.history.size()>0){
for (int i=0;i<this.history.size();i++) if (this.history.get(i).isProbed) { for (int i=0;i<this.history.size();i++) if (this.history.get(i).isProbed) {
int [] probedPosition=this.history.get(i).motorsPos; int [] probedPosition=this.history.get(i).motorsPos;
......
...@@ -1691,15 +1691,25 @@ import org.apache.commons.configuration.XMLConfiguration; ...@@ -1691,15 +1691,25 @@ import org.apache.commons.configuration.XMLConfiguration;
if (gridImages!=null) { if (gridImages!=null) {
// this.pathName=""; // modified, keep the path anyway // this.pathName=""; // modified, keep the path anyway
// overwrite saved paths with the provided images, number of images{ should match // overwrite saved paths with the provided images, number of images{ should match
if (this.gIP.length!=gridImages.length){ if (this.gIP.length == gridImages.length){
for (int i=0;i<this.gIP.length;i++){
this.gIP[i].gridImage=gridImages[i];
this.gIP[i].path=null; // not needed, just in case
this.gIP[i].enabled=true;// enable all (actually just one) acquired images
}
} else {
String msg="Number of provided images ("+gridImages.length+") does not match parameters restored from the "+pathname+" ("+this.gIP.length+")"; String msg="Number of provided images ("+gridImages.length+") does not match parameters restored from the "+pathname+" ("+this.gIP.length+")";
IJ.showMessage("Error",msg); IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg); // throw new IllegalArgumentException (msg);
} for (int i=0; i<this.gIP.length ; i++){
for (int i=0;i<this.gIP.length;i++){ this.gIP[i].path=null; // not needed, just in case
this.gIP[i].gridImage=gridImages[i]; this.gIP[i].enabled=true;// enable all (actually just one) acquired images
this.gIP[i].path=null; // not needed, just in case if (i < gridImages.length) {
this.gIP[i].enabled=true;// enable all (actually just one) acquired images this.gIP[i].gridImage=gridImages[i];
} else {
this.gIP[i].gridImage=null;
}
}
} }
// setGridImages(gridImages); // setGridImages(gridImages);
} }
...@@ -2080,7 +2090,7 @@ import org.apache.commons.configuration.XMLConfiguration; ...@@ -2080,7 +2090,7 @@ import org.apache.commons.configuration.XMLConfiguration;
imp_grid=this.gIP[numGridImg].gridImage; imp_grid=this.gIP[numGridImg].gridImage;
} else { } else {
if (this.updateStatus) IJ.showStatus("Reading grid file "+(fileNumber+1)+" (of "+(numImages)+"): "+this.gIP[fileNumber].path); if (this.updateStatus) IJ.showStatus("Reading grid file "+(fileNumber+1)+" (of "+(numImages)+"): "+this.gIP[fileNumber].path);
if (this.debugLevel>1) System.out.print(fileNumber+" ("+this.gIP[fileNumber].getStationNumber()+"): "+this.gIP[fileNumber].path); if (this.debugLevel>-1) System.out.print(fileNumber+" ("+this.gIP[fileNumber].getStationNumber()+"): "+this.gIP[fileNumber].path);
imp_grid=opener.openImage("", this.gIP[fileNumber].path); // or (path+filenames[nFile]) imp_grid=opener.openImage("", this.gIP[fileNumber].path); // or (path+filenames[nFile])
if (imp_grid==null) { if (imp_grid==null) {
String msg="Failed to read grid file "+this.gIP[fileNumber].path; String msg="Failed to read grid file "+this.gIP[fileNumber].path;
......
This diff is collapsed.
...@@ -107,16 +107,6 @@ public class EyesisCorrections { ...@@ -107,16 +107,6 @@ public class EyesisCorrections {
//if ((this.debugLevel>1) && (correctionsParameters.sourcePaths!=null) && (correctionsParameters.sourcePaths.length>0)) { //if ((this.debugLevel>1) && (correctionsParameters.sourcePaths!=null) && (correctionsParameters.sourcePaths.length>0)) {
if ((this.debugLevel>101) && (correctionsParameters.sourcePaths!=null) && (correctionsParameters.sourcePaths.length>0)) { if ((this.debugLevel>101) && (correctionsParameters.sourcePaths!=null) && (correctionsParameters.sourcePaths.length>0)) {
testFF(correctionsParameters.sourcePaths[0]); testFF(correctionsParameters.sourcePaths[0]);
// this.channelVignettingCorrection[srcChannel]=this.pixelMapping.getBayerFlatFieldFloat(
/*
SDFA_INSTANCE.showArrays(
this.channelVignettingCorrection,
this.channelWidthHeight[srcChannel][0],
this.channelWidthHeight[srcChannel][1],
true,
"Flat-Field");
//LENS_DISTORTIONS.displayGridTitles());
*/
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
...@@ -151,23 +151,11 @@ public class PixelMapping { ...@@ -151,23 +151,11 @@ public class PixelMapping {
return (this.sensors != null) && (channel>=0) && (channel<this.sensors.length) && (this.sensors[channel]!=null); return (this.sensors != null) && (channel>=0) && (channel<this.sensors.length) && (this.sensors[channel]!=null);
} }
/*
public int [] channelsForSubCamera(int subCamera){
if (this.sensors == null) return null;
int numChannels=0;
for (int i=0;i<this.sensors.length;i++) if ((this.sensors[i]!=null) &&(this.sensors[i].subcamera==subCamera)) numChannels++;
int [] result=new int [numChannels];
numChannels=0;
for (int i=0;i<this.sensors.length;i++) if ((this.sensors[i]!=null) &&(this.sensors[i].subcamera==subCamera)) result[numChannels++]=i;
return result;
}
*/
// Updating for nc393. subCamera here is 0..9 for Eyesis4pi393 - 0-based index of the file, so it combines physical camera (separate IP) // Updating for nc393. subCamera here is 0..9 for Eyesis4pi393 - 0-based index of the file, so it combines physical camera (separate IP)
// as stored in "subcamera" field of the calibration file and "sensor_port". sensor_port may start from non-0, so we need to count all combinations // as stored in "subcamera" field of the calibration file and "sensor_port". sensor_port may start from non-0, so we need to count all combinations
//removeUnusedSensorData xshould be off!
public int [] channelsForSubCamera(int subCamera){ public int [] channelsForSubCamera(int subCamera){
System.out.println("channelsForSubCamera("+subCamera+"),this.sensors.length="+this.sensors.length);
// ArrayList<ArrayList<ArrayList<Integer>>> camera_IPs = new ArrayList<ArrayList<ArrayList<Integer>>>(); // ArrayList<ArrayList<ArrayList<Integer>>> camera_IPs = new ArrayList<ArrayList<ArrayList<Integer>>>();
ArrayList<Point> cam_port = new ArrayList<Point>(); ArrayList<Point> cam_port = new ArrayList<Point>();
for (int i=0;i<this.sensors.length;i++) if (this.sensors[i]!=null) { for (int i=0;i<this.sensors.length;i++) if (this.sensors[i]!=null) {
...@@ -175,6 +163,7 @@ public class PixelMapping { ...@@ -175,6 +163,7 @@ public class PixelMapping {
if (!cam_port.contains(cp)){ if (!cam_port.contains(cp)){
cam_port.add(cp); cam_port.add(cp);
} }
// System.out.println("this.sensors["+i+"]!=null, this.sensors[i].subcamera="+this.sensors[i].subcamera+", this.sensors[i].sensor_port="+this.sensors[i].sensor_port);
} }
Point [] cam_port_arr = cam_port.toArray(new Point[0]); Point [] cam_port_arr = cam_port.toArray(new Point[0]);
Arrays.sort(cam_port_arr, new Comparator<Point>() { Arrays.sort(cam_port_arr, new Comparator<Point>() {
...@@ -183,9 +172,7 @@ public class PixelMapping { ...@@ -183,9 +172,7 @@ public class PixelMapping {
return (o1.x>o2.x)? 1:((o1.x < o2.x)?-1:(o1.y > o2.y)? 1:((o1.y < o2.y)?-1:0)); return (o1.x>o2.x)? 1:((o1.x < o2.x)?-1:(o1.y > o2.y)? 1:((o1.y < o2.y)?-1:0));
} }
}); });
// for (int i=0; i<cam_port_arr.length;i++){ // debugging:
// System.out.println("----- physical camera #"+cam_port_arr[i].x+", sensor_port="+cam_port_arr[i].y);
// }
System.out.println("----- This filename subcamera "+subCamera+": physical camera "+cam_port_arr[subCamera].x+", sensor_port "+cam_port_arr[subCamera].y); System.out.println("----- This filename subcamera "+subCamera+": physical camera "+cam_port_arr[subCamera].x+", sensor_port "+cam_port_arr[subCamera].y);
if (subCamera >= cam_port_arr.length) { if (subCamera >= cam_port_arr.length) {
System.out.println("Error: Subcamera "+subCamera+" > that total namera of sensor ports in the system = "+cam_port_arr.length); System.out.println("Error: Subcamera "+subCamera+" > that total namera of sensor ports in the system = "+cam_port_arr.length);
......
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