[Swift-commit] r4572 - SwiftApps/Montage/scripts

jonmon at ci.uchicago.edu jonmon at ci.uchicago.edu
Mon Jun 6 15:30:40 CDT 2011


Author: jonmon
Date: 2011-06-06 15:30:40 -0500 (Mon, 06 Jun 2011)
New Revision: 4572

Modified:
   SwiftApps/Montage/scripts/Swift_Montage_Apps.swift
   SwiftApps/Montage/scripts/Swift_Montage_Batch.swift
Log:
Added more functionality
   o Now can use the mDiffFit fucntion from Montage


Modified: SwiftApps/Montage/scripts/Swift_Montage_Apps.swift
===================================================================
--- SwiftApps/Montage/scripts/Swift_Montage_Apps.swift	2011-06-06 19:15:11 UTC (rev 4571)
+++ SwiftApps/Montage/scripts/Swift_Montage_Apps.swift	2011-06-06 20:30:40 UTC (rev 4572)
@@ -29,6 +29,12 @@
 }
 
 
+app ( Image diff_img, Status stat ) mDiffFit( Image img_1, Image img_2, MosaicData hdr )
+{
+    mDiffFit "-n" "-s" @stat @img_1 @img_2 @diff_img @hdr;
+}
+
+
 app ( Status stat ) mFitplane( Image diff_img )
 {
 //    mFitplane "-s" @stat @diff_img;

Modified: SwiftApps/Montage/scripts/Swift_Montage_Batch.swift
===================================================================
--- SwiftApps/Montage/scripts/Swift_Montage_Batch.swift	2011-06-06 19:15:11 UTC (rev 4571)
+++ SwiftApps/Montage/scripts/Swift_Montage_Batch.swift	2011-06-06 20:30:40 UTC (rev 4572)
@@ -36,6 +36,30 @@
 }
 
 
+( Image diff_imgs[], Table fits_tbl ) mDiffFitBatch( string src_dir, string dest_dir, Table diff_tbl, MosaicData hdr )
+{
+    DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
+    Status stats[];
+
+    Table status_tbl = create_status_table( diff_tbl );
+    
+    foreach d_entry, i in diffs
+    {
+        Image img_1 <single_file_mapper; file = @strcat( src_dir+"/", @d_entry.plus )>;
+        Image img_2 <single_file_mapper; file = @strcat( src_dir+"/", @d_entry.minus )>;
+
+        Image diff_img <single_file_mapper; file = @strcat( dest_dir+"/", @d_entry.diff )>;
+	Status stat <single_file_mapper; file = @strcat( "stat_dir/stat.", @d_entry.diff)>;
+        
+        ( diff_img, stat ) = mDiffFit( img_1, img_2, hdr );
+
+	diff_imgs[ i ] = diff_img;
+        stats[ i ] = stat;
+    }
+    fits_tbl = mConcatFit( status_tbl, stats );
+}
+
+
 ( Table fits_tbl ) mFitBatch( Image diff_imgs[], Table diff_tbl )
 {
     Status stats[] <structured_regexp_mapper; source = diff_imgs, match = ".*\\/(.*)", transform = "stat_dir/stat.\\1">;
@@ -56,8 +80,8 @@
     foreach img, i in raw_imgs
     {
         Image proj_img <regexp_mapper; source = @img, match = ".*\\/(.*)", transform = "proj_dir/proj_\\1">;
+        proj_img = mProject( img, hdr );
 //        proj_img = mProjectPP( img, hdr );
-        proj_img = mProject( img, hdr );
 
         proj_imgs[ i ] = proj_img;
     }




More information about the Swift-commit mailing list