Commit in CDMS/src/CDMS/kscheck on MAIN
CreateRoadMapFile.java+3-11.5 -> 1.6
SortCoordsTest.java+2-21.6 -> 1.7
SortCoordsFile.java+3-11.3 -> 1.4
+8-4
3 modified files
Minor update for a bug: horizontal isStraight detection was going on only around pi, not for 0. Updated to correct this, though it actually had no effect on actual output, still good to have corrected.

In the future, should move utility methods to a static utility class. (Need to change the getNextLine to be consistent between classes in that case).

CDMS/src/CDMS/kscheck
CreateRoadMapFile.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- CreateRoadMapFile.java	31 Jan 2011 03:05:11 -0000	1.5
+++ CreateRoadMapFile.java	31 Jan 2011 04:11:11 -0000	1.6
@@ -669,7 +669,9 @@
     	
     	//if((piremain1 < FLAT_ANGLE_CUT || piremain1 > Math.PI-FLAT_ANGLE_CUT)
     	//		&& (piremain2 < FLAT_ANGLE_CUT || piremain2 > Math.PI-FLAT_ANGLE_CUT) ){
-    	if(Math.abs(Math.abs(angle1)-Math.PI) < FLAT_ANGLE_CUT && Math.abs(Math.abs(angle2)-Math.PI) < FLAT_ANGLE_CUT ){
+    	//if(Math.abs(Math.abs(angle1)-Math.PI) < FLAT_ANGLE_CUT && Math.abs(Math.abs(angle2)-Math.PI) < FLAT_ANGLE_CUT ){
+    	if((Math.abs(Math.abs(angle1)-Math.PI) < FLAT_ANGLE_CUT || Math.abs(angle1) < FLAT_ANGLE_CUT) 
+    			&& (Math.abs(Math.abs(angle2)-Math.PI) < FLAT_ANGLE_CUT || Math.abs(angle1) < FLAT_ANGLE_CUT)  ){
     	//both are horizontal in this case: check that they're in the same line now
     		if(Math.abs(y1-y2) < FLAT_XY_CUT){
     			// they're in the same line, and they're horizontal

CDMS/src/CDMS/kscheck
SortCoordsTest.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- SortCoordsTest.java	31 Jan 2011 03:05:11 -0000	1.6
+++ SortCoordsTest.java	31 Jan 2011 04:11:11 -0000	1.7
@@ -18,11 +18,11 @@
     public static void main(String[] args) throws FileNotFoundException, IOException {
     	System.out.println("testing!");
         //SortCoordsFile pcfile = new SortCoordsFile("side1_copy.txt","sortedCoords.txt");
-        CreateRoadMapFile roadmap1 = new CreateRoadMapFile("/Users/maxinion/Documents/Work/CDMS/code/imaging/testfiles1-28/sortedCoords_test_beta_short.txt","/Users/maxinion/Documents/Work/CDMS/code/imaging/testfiles1-28/test_short.txt",0.00059,0);
+        CreateRoadMapFile roadmap1 = new CreateRoadMapFile("/Users/maxinion/Documents/Work/CDMS/code/imaging/testfiles1-30/sortedCoords_test_beta.txt","/Users/maxinion/Documents/Work/CDMS/code/imaging/testfiles1-30/test_long.csv",0.00059,1);
         //CreateRoadMapFile roadmap2 = new CreateRoadMapFile("shortTest2.txt","testautorun2.txt",0.00067);
         //CreateRoadMapFile roadmap3 = new CreateRoadMapFile("longTest.txt","testautorun3.txt",0.00067);
         //SplitSortedFile splitfile = new SplitSortedFile("sortedCoords.txt","splittest.txt");
-//    	SortCoordsFile pcfile = new SortCoordsFile("/Users/maxinion/Documents/Work/CDMS/code/imaging/side1_copy.txt","/Users/maxinion/Documents/Work/CDMS/code/imaging/testfiles1-28/sortedCoords_test_beta.txt");
+//    	SortCoordsFile pcfile = new SortCoordsFile("/Users/maxinion/Documents/Work/CDMS/code/imaging/side1_copy.txt","/Users/maxinion/Documents/Work/CDMS/code/imaging/testfiles1-30/sortedCoords_test_beta.txt");
 //    	if(pcfile.getInputStatus()==true){
 //    		pcfile.sortBeta();
 //    		pcfile.printOut();

CDMS/src/CDMS/kscheck
SortCoordsFile.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- SortCoordsFile.java	28 Jan 2011 23:41:04 -0000	1.3
+++ SortCoordsFile.java	31 Jan 2011 04:11:11 -0000	1.4
@@ -499,7 +499,9 @@
     	
     	//if((piremain1 < FLAT_ANGLE_CUT || piremain1 > Math.PI-FLAT_ANGLE_CUT)
     	//		&& (piremain2 < FLAT_ANGLE_CUT || piremain2 > Math.PI-FLAT_ANGLE_CUT) ){
-    	if(Math.abs(Math.abs(angle1)-Math.PI) < FLAT_ANGLE_CUT && Math.abs(Math.abs(angle2)-Math.PI) < FLAT_ANGLE_CUT ){
+    	//if(Math.abs(Math.abs(angle1)-Math.PI) < FLAT_ANGLE_CUT && Math.abs(Math.abs(angle2)-Math.PI) < FLAT_ANGLE_CUT ){
+    	if((Math.abs(Math.abs(angle1)-Math.PI) < FLAT_ANGLE_CUT || Math.abs(angle1) < FLAT_ANGLE_CUT) 
+    			&& (Math.abs(Math.abs(angle2)-Math.PI) < FLAT_ANGLE_CUT || Math.abs(angle1) < FLAT_ANGLE_CUT)  ){
     	//both are horizontal in this case: check that they're in the same line now
     		if(Math.abs(y1-y2) < FLAT_XY_CUT){
     			// they're in the same line, and they're horizontal
CVSspam 0.2.8