Commit 2b8ae048 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Before updating IMS interpolation

parent 726f4add
Loading
Loading
Loading
Loading
+87 −20
Original line number Original line Diff line number Diff line
@@ -103,7 +103,12 @@ public class EyesisCorrectionParameters {
    	public String sourceSequencesList=     "";
    	public String sourceSequencesList=     "";
    	public boolean useSourceList=          false;
    	public boolean useSourceList=          false;
    	
    	
    	public String sourceImsDirectory=      ""; // source IMS log files
//    	public String sourceImsDirectory=      ""; // source IMS log files
    	public String imsRootDirectory=        ""; // source IMS log files
    	public String imsDataSubdirectory=     "data"; // source IMS log files relative to imsRootDirectory
    	public String imsPrintSubdirectory=    "print"; // directory to print DiD-s in human-readable format
    	public String imsSuffix=               "-ims.corr-xml";  // model subdirectory to store IMS data
    	public String egomotionSuffix=         "-egomotion.csv"; // Egomotion table


    	public String sourcePrefix=            "";
    	public String sourcePrefix=            "";
    	public String sourceSuffix=            ".tiff"; //".jp4"
    	public String sourceSuffix=            ".tiff"; //".jp4"
@@ -206,6 +211,7 @@ public class EyesisCorrectionParameters {
    	public String x3dModelVersion="v01";
    	public String x3dModelVersion="v01";
    	public String jp4SubDir="jp4"; // FIXME:
    	public String jp4SubDir="jp4"; // FIXME:
    	
    	

    	public String linkedModels="";   // linked models with reference scenes
    	public String linkedModels="";   // linked models with reference scenes
    	public String x3dDirectory="";
    	public String x3dDirectory="";
    	public String videoDirectory=""; // combined (with MPEG) from multiple scene sequences video files
    	public String videoDirectory=""; // combined (with MPEG) from multiple scene sequences video files
@@ -279,7 +285,12 @@ public class EyesisCorrectionParameters {
  			cp.sourceSequencesList=     this.sourceSequencesList;
  			cp.sourceSequencesList=     this.sourceSequencesList;
  			cp.useSourceList=    	    this.useSourceList;
  			cp.useSourceList=    	    this.useSourceList;


  			cp.sourceImsDirectory=    	this.sourceImsDirectory;
///  			cp.sourceImsDirectory=    	this.sourceImsDirectory;
  			cp.imsRootDirectory =       this.imsRootDirectory;      
  			cp.imsDataSubdirectory =    this.imsDataSubdirectory;
  			cp.imsPrintSubdirectory =   this.imsPrintSubdirectory;
  			cp.imsSuffix =              this.imsSuffix;
  			cp.egomotionSuffix =        this.egomotionSuffix;
  			
  			
  			cp.tile_processor_gpu =     this.tile_processor_gpu;
  			cp.tile_processor_gpu =     this.tile_processor_gpu;
  			cp.use_set_dirs =           this.use_set_dirs;
  			cp.use_set_dirs =           this.use_set_dirs;
@@ -473,7 +484,12 @@ public class EyesisCorrectionParameters {
    		properties.setProperty(prefix+"sourceSequencesList",this.sourceSequencesList);
    		properties.setProperty(prefix+"sourceSequencesList",this.sourceSequencesList);
    		properties.setProperty(prefix+"useSourceList",this.useSourceList+"");
    		properties.setProperty(prefix+"useSourceList",this.useSourceList+"");
    		
    		
    		properties.setProperty(prefix+"sourceImsDirectory",this.sourceImsDirectory);
///    		properties.setProperty(prefix+"sourceImsDirectory",this.sourceImsDirectory);
    		properties.setProperty(prefix+"imsRootDirectory",    this.imsRootDirectory);
    		properties.setProperty(prefix+"imsDataSubdirectory", this.imsDataSubdirectory);
    		properties.setProperty(prefix+"imsPrintSubdirectory",this.imsPrintSubdirectory);
    		properties.setProperty(prefix+"imsSuffix",           this.imsSuffix);
    		properties.setProperty(prefix+"egomotionSuffix",     this.egomotionSuffix);
    		
    		
    		properties.setProperty(prefix+"tile_processor_gpu",this.tile_processor_gpu);
    		properties.setProperty(prefix+"tile_processor_gpu",this.tile_processor_gpu);


@@ -664,7 +680,13 @@ public class EyesisCorrectionParameters {
			if (properties.getProperty(prefix+"sourceDirectory")!=      null) this.sourceDirectory=properties.getProperty(prefix+"sourceDirectory");
			if (properties.getProperty(prefix+"sourceDirectory")!=      null) this.sourceDirectory=properties.getProperty(prefix+"sourceDirectory");
			if (properties.getProperty(prefix+"sourceSequencesList")!=  null) this.sourceSequencesList=properties.getProperty(prefix+"sourceSequencesList");			
			if (properties.getProperty(prefix+"sourceSequencesList")!=  null) this.sourceSequencesList=properties.getProperty(prefix+"sourceSequencesList");			
  		    if (properties.getProperty(prefix+"useSourceList")!=null) this.useSourceList=Boolean.parseBoolean(properties.getProperty(prefix+"useSourceList")); // save 32-bit tiff also if the end result is 8 or 16 bit
  		    if (properties.getProperty(prefix+"useSourceList")!=null) this.useSourceList=Boolean.parseBoolean(properties.getProperty(prefix+"useSourceList")); // save 32-bit tiff also if the end result is 8 or 16 bit
			if (properties.getProperty(prefix+"sourceImsDirectory")!=   null) this.sourceImsDirectory=properties.getProperty(prefix+"sourceImsDirectory");
///			if (properties.getProperty(prefix+"sourceImsDirectory")!=   null) this.sourceImsDirectory=properties.getProperty(prefix+"sourceImsDirectory");
			if (properties.getProperty(prefix+"imsRootDirectory")!=     null) this.imsRootDirectory    =properties.getProperty(prefix+"imsRootDirectory");
			if (properties.getProperty(prefix+"imsDataSubdirectory")!=  null) this.imsDataSubdirectory =properties.getProperty(prefix+"imsDataSubdirectory");
			if (properties.getProperty(prefix+"imsPrintSubdirectory")!= null) this.imsPrintSubdirectory=properties.getProperty(prefix+"imsPrintSubdirectory");
			if (properties.getProperty(prefix+"imsSuffix")!= null)      this.imsSuffix=properties.getProperty(prefix+"imsSuffix");
			if (properties.getProperty(prefix+"egomotionSuffix")!=null) this.egomotionSuffix=properties.getProperty(prefix+"egomotionSuffix");
			
			if (properties.getProperty(prefix+"tile_processor_gpu")!=   null) this.tile_processor_gpu=properties.getProperty(prefix+"tile_processor_gpu");
			if (properties.getProperty(prefix+"tile_processor_gpu")!=   null) this.tile_processor_gpu=properties.getProperty(prefix+"tile_processor_gpu");
  		    if (properties.getProperty(prefix+"firstSubCamera")!=       null) this.firstSubCamera=Integer.parseInt(properties.getProperty(prefix+"firstSubCamera"));
  		    if (properties.getProperty(prefix+"firstSubCamera")!=       null) this.firstSubCamera=Integer.parseInt(properties.getProperty(prefix+"firstSubCamera"));
  		    if (properties.getProperty(prefix+"firstSubCameraConfig")!= null) this.firstSubCameraConfig=Integer.parseInt(properties.getProperty(prefix+"firstSubCameraConfig"));
  		    if (properties.getProperty(prefix+"firstSubCameraConfig")!= null) this.firstSubCameraConfig=Integer.parseInt(properties.getProperty(prefix+"firstSubCameraConfig"));
@@ -871,8 +893,15 @@ public class EyesisCorrectionParameters {
    		gd.addCheckbox    ("Select source directory",                          false);
    		gd.addCheckbox    ("Select source directory",                          false);
    		gd.addCheckbox    ("Use individual subdirectory for image set",        this.use_set_dirs);
    		gd.addCheckbox    ("Use individual subdirectory for image set",        this.use_set_dirs);
    		
    		
    		gd.addStringField ("Source IMS logs directory",                        this.sourceImsDirectory, 80);  // 10?
///    		gd.addStringField ("Source IMS logs directory",                        this.sourceImsDirectory, 80);  // 10?
    		gd.addCheckbox    ("Select IMS logs directory",                        false);                        // 10?
///    		gd.addCheckbox    ("Select IMS logs directory",                        false);                        // 10?

    		gd.addStringField ("IMS root directory",                               this.imsRootDirectory, 80);    // 10?
    		gd.addCheckbox    ("Select IMS root directory",                        false);                        // 10?
    		gd.addStringField ("IMS source logs subdirectory",                     this.imsDataSubdirectory, 80);    // 10?
    		gd.addStringField ("IMS print human-readable subdirectory",            this.imsPrintSubdirectory, 80);
    		gd.addStringField ("IMS data suffix",                                  this.imsSuffix, 80);
    		gd.addStringField ("Egomotion table filename suffix",                  this.egomotionSuffix, 80);
    		
    		
    		gd.addStringField ("Source sequences list file",                       this.sourceSequencesList, 80);
    		gd.addStringField ("Source sequences list file",                       this.sourceSequencesList, 80);
    		gd.addCheckbox    ("Select source sequences file",                     false);
    		gd.addCheckbox    ("Select source sequences file",                     false);
@@ -1017,12 +1046,16 @@ public class EyesisCorrectionParameters {
    		this.sourceDirectory=        gd.getNextString(); if (gd.getNextBoolean()) selectSourceDirectory(false, false);
    		this.sourceDirectory=        gd.getNextString(); if (gd.getNextBoolean()) selectSourceDirectory(false, false);
    		this.use_set_dirs =          gd.getNextBoolean();
    		this.use_set_dirs =          gd.getNextBoolean();
    		
    		
    		this.sourceImsDirectory=     gd.getNextString(); if (gd.getNextBoolean()) selectSourceImsDirectory(false, false);   // 3
///    		this.sourceImsDirectory=     gd.getNextString(); if (gd.getNextBoolean()) selectSourceImsDirectory(false, false);   // 3
    		this.imsRootDirectory=       gd.getNextString(); if (gd.getNextBoolean()) selectImsRootDirectory(false, false);   // 3
    		this.imsDataSubdirectory=    gd.getNextString();
    		this.imsPrintSubdirectory=   gd.getNextString();
    		this.imsSuffix=              gd.getNextString();
    		this.egomotionSuffix=        gd.getNextString();


    		this.sourceSequencesList=    gd.getNextString(); if (gd.getNextBoolean()) selectSourceSequencesList(false, false);
    		this.sourceSequencesList=    gd.getNextString(); if (gd.getNextBoolean()) selectSourceSequencesList(false, false);
    		this.useSourceList =         gd.getNextBoolean();
    		this.useSourceList =         gd.getNextBoolean();
    		
    		
    		
    		this.sensorDirectory=        gd.getNextString(); if (gd.getNextBoolean()) selectSensorDirectory(false, false);
    		this.sensorDirectory=        gd.getNextString(); if (gd.getNextBoolean()) selectSensorDirectory(false, false);
    		this.sharpKernelDirectory=   gd.getNextString(); if (gd.getNextBoolean()) selectSharpKernelDirectory(false, false);
    		this.sharpKernelDirectory=   gd.getNextString(); if (gd.getNextBoolean()) selectSharpKernelDirectory(false, false);
    		this.smoothKernelDirectory=  gd.getNextString(); if (gd.getNextBoolean()) selectSmoothKernelDirectory(false, true);
    		this.smoothKernelDirectory=  gd.getNextString(); if (gd.getNextBoolean()) selectSmoothKernelDirectory(false, true);
@@ -1097,8 +1130,14 @@ public class EyesisCorrectionParameters {
    		gd.addCheckbox    ("Select source directory",                          false);                       // 3
    		gd.addCheckbox    ("Select source directory",                          false);                       // 3
    		gd.addCheckbox    ("Use individual subdirectory for each image set (timestamp as name)", this.use_set_dirs); //10
    		gd.addCheckbox    ("Use individual subdirectory for each image set (timestamp as name)", this.use_set_dirs); //10
    		
    		
    		gd.addStringField ("Source IMS logs directory",                        this.sourceImsDirectory, 80);  // 10?
///    		gd.addStringField ("Source IMS logs directory",                        this.sourceImsDirectory, 80);  // 10?
    		gd.addCheckbox    ("Select IMS logs directory",                        false);                        // 10?
///    		gd.addCheckbox    ("Select IMS logs directory",                        false);                        // 10?
    		gd.addStringField ("IMS root directory",                               this.imsRootDirectory, 80);    // 10?
    		gd.addCheckbox    ("Select IMS root directory",                        false);                        // 10?
    		gd.addStringField ("IMS source logs subdirectory",                     this.imsDataSubdirectory, 80);    // 10?
    		gd.addStringField ("IMS print human-readable subdirectory",            this.imsPrintSubdirectory, 80);    // 10?
    		gd.addStringField ("IMS data suffix",                                  this.imsSuffix, 80);
    		gd.addStringField ("Egomotion table filename suffix",                  this.egomotionSuffix, 80);


    		gd.addStringField ("Source sequences list file",                       this.sourceSequencesList, 80); // 10x
    		gd.addStringField ("Source sequences list file",                       this.sourceSequencesList, 80); // 10x
    		gd.addCheckbox    ("Select source sequences file",                     false);                        // 10y
    		gd.addCheckbox    ("Select source sequences file",                     false);                        // 10y
@@ -1275,7 +1314,12 @@ public class EyesisCorrectionParameters {
    		this.sourceDirectory=        gd.getNextString(); if (gd.getNextBoolean()) selectSourceDirectory(false, false);   // 3
    		this.sourceDirectory=        gd.getNextString(); if (gd.getNextBoolean()) selectSourceDirectory(false, false);   // 3
    		this.use_set_dirs =          gd.getNextBoolean();
    		this.use_set_dirs =          gd.getNextBoolean();
    		
    		
    		this.sourceImsDirectory=     gd.getNextString(); if (gd.getNextBoolean()) selectSourceImsDirectory(false, false);   // 3
//    		this.sourceImsDirectory=     gd.getNextString(); if (gd.getNextBoolean()) selectImsRootDirectory(false, false);   // 3
    		this.imsRootDirectory=       gd.getNextString(); if (gd.getNextBoolean()) selectImsRootDirectory(false, false);   // 3
    		this.imsDataSubdirectory=    gd.getNextString();
    		this.imsPrintSubdirectory=   gd.getNextString();
    		this.imsSuffix=              gd.getNextString();
    		this.egomotionSuffix=        gd.getNextString();    		
    		
    		
    		this.sourceSequencesList=    gd.getNextString(); if (gd.getNextBoolean()) selectSourceSequencesList(false, false); // 10x,10y
    		this.sourceSequencesList=    gd.getNextString(); if (gd.getNextBoolean()) selectSourceSequencesList(false, false); // 10x,10y
    		this.useSourceList =         gd.getNextBoolean();                                                                  // 10z
    		this.useSourceList =         gd.getNextBoolean();                                                                  // 10z
@@ -2221,18 +2265,41 @@ public class EyesisCorrectionParameters {
    		return dir;
    		return dir;
    	}
    	}
    	
    	
    	public String selectSourceImsDirectory(boolean smart, boolean newAllowed) { // normally newAllowed=false
    	public String selectImsRootDirectory(boolean smart, boolean newAllowed) { // normally newAllowed=false
    		String dir= CalibrationFileManagement.selectDirectory(
    		String dir= CalibrationFileManagement.selectDirectory(
    				smart,
    				smart,
    				newAllowed, // save
    				newAllowed, // save
    				"Source (acquired from the camera) IMS logs directory", // title
    				"IMS root directory", // title
    				"Select source IMS directory", // button
    				"Select IMS root directory", // button
    				null, // filter
    				null, // filter
    				this.sourceImsDirectory); // this.sourceDirectory);
    				this.imsRootDirectory); // this.sourceDirectory);
    		if (dir!=null) this.sourceImsDirectory=dir;
    		if (dir!=null) {
    			while (dir.endsWith(Prefs.getFileSeparator())) {
    				dir=dir.substring(0, dir.length()-1);
    			}
    			this.imsRootDirectory=dir;
    		}
    		return dir;
    		return dir;
    	}
    	}
    	public String getImsSourceDirectory() {
			while (this.imsDataSubdirectory.startsWith(Prefs.getFileSeparator())) {
				this.imsDataSubdirectory=this.imsDataSubdirectory.substring(1);
			}
			while (this.imsDataSubdirectory.endsWith(Prefs.getFileSeparator())) {
				this.imsDataSubdirectory=this.imsDataSubdirectory.substring(0, this.imsDataSubdirectory.length()-1);
			}
    		return this.imsRootDirectory + Prefs.getFileSeparator() + this.imsDataSubdirectory;
     	}


    	public String getImsPrintDirectory() {
			while (this.imsPrintSubdirectory.startsWith(Prefs.getFileSeparator())) {
				this.imsPrintSubdirectory=this.imsPrintSubdirectory.substring(1);
			}
			while (this.imsPrintSubdirectory.endsWith(Prefs.getFileSeparator())) {
				this.imsPrintSubdirectory=this.imsPrintSubdirectory.substring(0, this.imsPrintSubdirectory.length()-1);
			}
    		return this.imsRootDirectory + Prefs.getFileSeparator() + this.imsPrintSubdirectory;
     	}
    	
    	
    	
    	
    	public String selectSourceSequencesList(boolean smart, boolean newAllowed) { // normally newAllowed=false
    	public String selectSourceSequencesList(boolean smart, boolean newAllowed) { // normally newAllowed=false
@@ -2407,10 +2474,10 @@ public class EyesisCorrectionParameters {
    						null, // filter
    						null, // filter
    						name); //this.x3dDirectory + Prefs.getFileSeparator()+name); //this.sourceDirectory);
    						name); //this.x3dDirectory + Prefs.getFileSeparator()+name); //this.sourceDirectory);
    			}
    			}
    		}
        		while (dir.endsWith(Prefs.getFileSeparator())) {
        		while (dir.endsWith(Prefs.getFileSeparator())) {
        			dir = dir.substring(0, dir.length()-1);
        			dir = dir.substring(0, dir.length()-1);
        		}
        		}
    		}
    		return dir;
    		return dir;
    	}
    	}


+15 −11
Original line number Original line Diff line number Diff line
@@ -411,6 +411,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
	public static EyesisCorrections EYESIS_CORRECTIONS = null;
	public static EyesisCorrections EYESIS_CORRECTIONS = null;
	public static EyesisCorrections EYESIS_CORRECTIONS_AUX = null;
	public static EyesisCorrections EYESIS_CORRECTIONS_AUX = null;
	public static EyesisCorrectionParameters.EquirectangularParameters EQUIRECTANGULAR_PARAMETERS = new EyesisCorrectionParameters.EquirectangularParameters();
	public static EyesisCorrectionParameters.EquirectangularParameters EQUIRECTANGULAR_PARAMETERS = new EyesisCorrectionParameters.EquirectangularParameters();
	public static EventLogger EVENT_LOGGER = null;
	public static int CONVOLVE_FFT_SIZE = 128; // FFT size for sliding convolution with kernel
	public static int CONVOLVE_FFT_SIZE = 128; // FFT size for sliding convolution with kernel
	public static int THREADS_MAX = 100; // testing multi-threading, limit maximal number of threads
	public static int THREADS_MAX = 100; // testing multi-threading, limit maximal number of threads
@@ -5523,19 +5524,22 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
			DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
			DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
			EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
			EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
			CLT_PARAMETERS.batch_run = true;
			CLT_PARAMETERS.batch_run = true;
			/*
			String imx_logs = CORRECTION_PARAMETERS.getImsSourceDirectory(); // sourceImsDirectory;
			Imx5 imx5 = new Imx5();
			if (EVENT_LOGGER == null) {
			byte [] imx5_rslt = imx5.test_imx();
			System.out.println("imx5_rslt.length="+imx5_rslt.length);
			*/
//			EventLogger eventLogger = new EventLogger ("/home/elphel/lwir16-proc/ims/ims_selected/");
			String imx_logs = CORRECTION_PARAMETERS.sourceImsDirectory;
				if ((imx_logs != null) && !imx_logs.equals("")) {
				if ((imx_logs != null) && !imx_logs.equals("")) {
				EventLogger eventLogger = new EventLogger (imx_logs);
					EVENT_LOGGER = new EventLogger (imx_logs);
				} else {
				} else {
					System.out.println("sourceImsDirectory is not set. Use Setup CLT Batch parameters to define it.");
					System.out.println("sourceImsDirectory is not set. Use Setup CLT Batch parameters to define it.");
				}
				}
			
			}
			if (EVENT_LOGGER != null) {
				EVENT_LOGGER.printPimu(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_pimu");
				EVENT_LOGGER.printGps(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_gps", 7);
				EVENT_LOGGER.printDidIns1(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_ins1");
				EVENT_LOGGER.printDidIns2(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_ins2");
			} else {
				System.out.println("EVENT_LOGGEER is null.");
			}
			return;
			return;
//JTabbedTest
//JTabbedTest
// End of buttons code
// End of buttons code
+49 −1
Original line number Original line Diff line number Diff line
@@ -2,6 +2,9 @@ package com.elphel.imagej.ims;


import java.nio.ByteBuffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ByteOrder;
import java.util.Properties;

import com.elphel.imagej.tileprocessor.IntersceneMatchParameters;


/** (DID_GPS1_POS, DID_GPS1_UBX_POS, DID_GPS2_POS) GPS position data */
/** (DID_GPS1_POS, DID_GPS1_UBX_POS, DID_GPS2_POS) GPS position data */
public class Did_gps_pos {
public class Did_gps_pos {
@@ -94,10 +97,14 @@ public class Did_gps_pos {
	}
	}
	public Did_gps_pos() {}
	public Did_gps_pos() {}


	public Did_gps_pos(String prefix, Properties properties) {
		getProperties(prefix, properties);
	}

	public Did_gps_pos interpolate(double frac, Did_gps_pos next_did) {
	public Did_gps_pos interpolate(double frac, Did_gps_pos next_did) {
		Did_gps_pos new_did = new Did_gps_pos();
		Did_gps_pos new_did = new Did_gps_pos();
		double time_ms_this = timeOfWeekMs + Did_strobe_in_time.WEEK_MS * week;
		double time_ms_this = timeOfWeekMs + Did_strobe_in_time.WEEK_MS * week;
		double time_ms_next = timeOfWeekMs + Did_strobe_in_time.WEEK_MS * week;
		double time_ms_next = next_did.timeOfWeekMs + Did_strobe_in_time.WEEK_MS * next_did.week;
		long   time_ms =      (long) Did_ins.interpolateDouble(frac, time_ms_this, time_ms_next);
		long   time_ms =      (long) Did_ins.interpolateDouble(frac, time_ms_this, time_ms_next);
		new_did.week =         (int) Math.floor(time_ms / Did_strobe_in_time.WEEK_MS);
		new_did.week =         (int) Math.floor(time_ms / Did_strobe_in_time.WEEK_MS);
		new_did.timeOfWeekMs = (int) (time_ms - new_did.week * Did_strobe_in_time.WEEK_MS); 
		new_did.timeOfWeekMs = (int) (time_ms - new_did.week * Did_strobe_in_time.WEEK_MS); 
@@ -161,4 +168,45 @@ public class Did_gps_pos {
		return s;
		return s;
	}
	}
	
	
 	public void getProperties(String prefix, Properties properties) {
		if (properties.getProperty(prefix+"week")!=null)         this.week= Integer.parseInt(properties.getProperty(prefix+"week"));
		if (properties.getProperty(prefix+"timeOfWeekMs")!=null) this.timeOfWeekMs= Integer.parseInt(properties.getProperty(prefix+"week"));
		if (properties.getProperty(prefix+"status")!=null)       this.status= Integer.parseInt(properties.getProperty(prefix+"status"));
		if (properties.getProperty(prefix+"ecef")!=null) 	     this.ecef= IntersceneMatchParameters.StringToDoubles(properties.getProperty(prefix+"ecef"),3);
		if (properties.getProperty(prefix+"lla")!=null) 	     this.lla= IntersceneMatchParameters.StringToDoubles(properties.getProperty(prefix+"lla"),3);
		if (properties.getProperty(prefix+"hMSL")!=null)         this.hMSL= Float.parseFloat(properties.getProperty(prefix+"hMSL"));
		if (properties.getProperty(prefix+"hAcc")!=null)         this.hAcc= Float.parseFloat(properties.getProperty(prefix+"hAcc"));
		if (properties.getProperty(prefix+"vAcc")!=null)         this.vAcc= Float.parseFloat(properties.getProperty(prefix+"vAcc"));
		if (properties.getProperty(prefix+"pDop")!=null)         this.pDop= Float.parseFloat(properties.getProperty(prefix+"pDop"));
		if (properties.getProperty(prefix+"cnoMean")!=null)      this.cnoMean= Float.parseFloat(properties.getProperty(prefix+"cnoMean"));
		if (properties.getProperty(prefix+"towOffset")!=null)    this.towOffset= Double.parseDouble(properties.getProperty(prefix+"towOffset"));
		if (properties.getProperty(prefix+"leapS")!=null)        this.leapS= Byte.parseByte(properties.getProperty(prefix+"leapS"));
		if (properties.getProperty(prefix+"satsUsed")!=null)     this.satsUsed= Byte.parseByte(properties.getProperty(prefix+"satsUsed"));
		if (properties.getProperty(prefix+"cnoMeanSigma")!=null) this.cnoMeanSigma= Byte.parseByte(properties.getProperty(prefix+"cnoMeanSigma"));
		if (properties.getProperty(prefix+"reserved")!=null)     this.reserved= Byte.parseByte(properties.getProperty(prefix+"reserved"));
		
	}
 	
	public Properties setProperties(String prefix, Properties properties){ // save // USED in lwir
		if (properties == null) {
			properties = new Properties();
		}
		properties.setProperty(prefix+"week",         this.week+"");
		properties.setProperty(prefix+"timeOfWeekMs", this.timeOfWeekMs+"");
		properties.setProperty(prefix+"status",       this.status+"");
		properties.setProperty(prefix+"ecef",         IntersceneMatchParameters.doublesToString(this.ecef));
		properties.setProperty(prefix+"lla",          IntersceneMatchParameters.doublesToString(this.lla));
		properties.setProperty(prefix+"hMSL",         this.hMSL+"");
		properties.setProperty(prefix+"hAcc",         this.hAcc+"");
		properties.setProperty(prefix+"vAcc",         this.vAcc+"");
		properties.setProperty(prefix+"pDop",         this.pDop+"");
		properties.setProperty(prefix+"cnoMean",      this.cnoMean+"");
		properties.setProperty(prefix+"towOffset",    this.towOffset+"");
		properties.setProperty(prefix+"leapS",        this.leapS+"");
		properties.setProperty(prefix+"satsUsed",     this.satsUsed+"");
		properties.setProperty(prefix+"cnoMeanSigma", this.cnoMeanSigma+"");
		properties.setProperty(prefix+"reserved",     this.reserved+"");
		return properties;
	}

}
}
 No newline at end of file
+23 −0
Original line number Original line Diff line number Diff line
package com.elphel.imagej.ims;
package com.elphel.imagej.ims;


import java.util.Properties;

import com.elphel.imagej.tileprocessor.IntersceneMatchParameters;

public abstract class Did_ins <T extends Did_ins <T>>{
public abstract class Did_ins <T extends Did_ins <T>>{
	final static int WEEK_SECONDS = 7 * 24 * 3600;
	final static int WEEK_SECONDS = 7 * 24 * 3600;
	/** GPS number of weeks since January 6th, 1980 */
	/** GPS number of weeks since January 6th, 1980 */
@@ -42,4 +46,23 @@ public abstract class Did_ins <T extends Did_ins <T>>{
    		new_did.lla[i] =   interpolateDouble(frac, lla[i], next_did.lla[i]) ;
    		new_did.lla[i] =   interpolateDouble(frac, lla[i], next_did.lla[i]) ;
    	}
    	}
	}
	}
	
	public void getProperties(String prefix, Properties properties) {
		if (properties.getProperty(prefix+"week")!=null)       this.week= Integer.parseInt(properties.getProperty(prefix+"week"));
		if (properties.getProperty(prefix+"timeOfWeek")!=null) this.timeOfWeek= Double.parseDouble(properties.getProperty(prefix+"timeOfWeek"));
		if (properties.getProperty(prefix+"insStatus")!=null)  this.insStatus= Integer.parseInt(properties.getProperty(prefix+"insStatus"));
		if (properties.getProperty(prefix+"hdwStatus")!=null)  this.hdwStatus= Integer.parseInt(properties.getProperty(prefix+"hdwStatus"));
		if (properties.getProperty(prefix+"lla")!=null) 	   this.lla= IntersceneMatchParameters.StringToDoubles(properties.getProperty(prefix+"lla"),3);
	}
	public Properties setProperties(String prefix, Properties properties){ // save // USED in lwir
		if (properties == null) {
			properties = new Properties();
		}
		properties.setProperty(prefix+"week",       this.week+"");
		properties.setProperty(prefix+"timeOfWeek", this.timeOfWeek+"");
		properties.setProperty(prefix+"insStatus",  this.insStatus+"");
		properties.setProperty(prefix+"hdwStatus",  this.hdwStatus+"");
		properties.setProperty(prefix+"lla",        IntersceneMatchParameters.doublesToString(this.lla));		
		return properties;
	}
}
}
 No newline at end of file
+21 −1
Original line number Original line Diff line number Diff line
@@ -3,6 +3,9 @@ package com.elphel.imagej.ims;
//import java.io.Serializable;
//import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ByteOrder;
import java.util.Properties;

import com.elphel.imagej.tileprocessor.IntersceneMatchParameters;


//public class Did_ins_1 implements Serializable {
//public class Did_ins_1 implements Serializable {
//	static final long serialVersionUID = 4;
//	static final long serialVersionUID = 4;
@@ -36,6 +39,10 @@ public class Did_ins_1 extends Did_ins <Did_ins_1>{
		ned[0]=    bb.getFloat();  ned[1] =   bb.getFloat();  ned[2]=   bb.getFloat();
		ned[0]=    bb.getFloat();  ned[1] =   bb.getFloat();  ned[2]=   bb.getFloat();
	}
	}
	public Did_ins_1() {}
	public Did_ins_1() {}
	public Did_ins_1(String prefix, Properties properties) {
		getProperties(prefix, properties);
	}
	


	public Did_ins_1 interpolate(double frac, Did_ins_1 next_did) {
	public Did_ins_1 interpolate(double frac, Did_ins_1 next_did) {
		Did_ins_1 new_did = new Did_ins_1();
		Did_ins_1 new_did = new Did_ins_1();
@@ -76,5 +83,18 @@ public class Did_ins_1 extends Did_ins <Did_ins_1>{
		return s;
		return s;
	}
	}


	public void getProperties(String prefix, Properties properties) {
		super.getProperties(prefix, properties);
		if (properties.getProperty(prefix+"theta")!=null) 	   this.theta= IntersceneMatchParameters.StringToFloats(properties.getProperty(prefix+"theta"),3);
		if (properties.getProperty(prefix+"uvw")!=null) 	   this.uvw=   IntersceneMatchParameters.StringToFloats(properties.getProperty(prefix+"uvw"),3);
		if (properties.getProperty(prefix+"ned")!=null) 	   this.ned=   IntersceneMatchParameters.StringToFloats(properties.getProperty(prefix+"ned"),3);
	}
	public Properties setProperties(String prefix, Properties properties){ // save // USED in lwir
		properties = super.setProperties(prefix, properties);
		properties.setProperty(prefix+"theta",        IntersceneMatchParameters.floatsToString(this.theta));		
		properties.setProperty(prefix+"uvw",          IntersceneMatchParameters.floatsToString(this.uvw));		
		properties.setProperty(prefix+"ned",          IntersceneMatchParameters.floatsToString(this.ned));		
		return properties;
	}	


}
}
 No newline at end of file
Loading