[Swift-commit] r4718 - SwiftApps/SwiftMontage/scripts
jonmon at ci.uchicago.edu
jonmon at ci.uchicago.edu
Thu Jun 30 11:49:54 CDT 2011
Author: jonmon
Date: 2011-06-30 11:49:54 -0500 (Thu, 30 Jun 2011)
New Revision: 4718
Added:
SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft
SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft
SwiftApps/SwiftMontage/scripts/SwiftMontage_Types.swift
Removed:
SwiftApps/SwiftMontage/scripts/Swift_Montage_Apps.swift
SwiftApps/SwiftMontage/scripts/Swift_Montage_Batch.swift
SwiftApps/SwiftMontage/scripts/Swift_Montage_Types.swift
Modified:
SwiftApps/SwiftMontage/scripts/montage.swift
Log:
o Renamed some files and minor edits.
Copied: SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft (from rev 4716, SwiftApps/SwiftMontage/scripts/Swift_Montage_Apps.swift)
===================================================================
--- SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft (rev 0)
+++ SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft 2011-06-30 16:49:54 UTC (rev 4718)
@@ -0,0 +1,98 @@
+app ( Image mos ) mAdd( Image imgs[], Table img_tbl, Header hdr )
+{
+ mAdd "-p" @dirname( imgs[0] ) "-n" @img_tbl @hdr @mos;
+}
+
+
+app ( Image rc_img ) mBackground( Image img, float a, float b, float c )
+{
+ mBackground "-n" @img @rc_img a b c;
+}
+
+
+app ( Table rect_tbl ) mBgModel( Table img_tbl, Table fits_tbl )
+{
+ mBgModel @img_tbl @fits_tbl @rect_tbl;
+}
+
+
+app ( Table fits_tbl ) mConcatFit( Table status_tbl, Status stats[] )
+{
+ mConcatFit @status_tbl @fits_tbl @dirname( stats[0] );
+}
+
+
+app ( Image diff_img ) mDiff( Image proj_img_1, Image proj_img_2, Header hdr )
+{
+ mDiff_wrap "-n" @proj_img_1 @proj_img_2 @diff_img @hdr;
+}
+
+
+app ( Image diff_img, Status stat ) mDiffFit( Image img_1, Image img_2, Header hdr )
+{
+ mDiffFit_wrap "-n" "-s" @stat @img_1 @img_2 @diff_img @hdr;
+}
+
+
+app ( Status stat ) mFitplane( Image diff_img )
+{
+ mFitplane_wrap "-s" @stat @diff_img;
+}
+
+
+app ( Table img_tbl ) mImgtbl( Image imgs[] )
+{
+ mImgtbl @dirname( imgs[0] ) @img_tbl;
+}
+
+
+app ( Header hdr ) mMakeHdr( Table img_tbl )
+{
+ mMakeHdr @img_tbl @hdr;
+}
+
+
+app ( JPEG mos_img_jpg ) mJPEG( Image mos_img )
+{
+ mJPEG "-gray" @mos_img "20%" "99.98%" "loglog" "-out" @mos_img_jpg;
+}
+
+
+app ( Table diff_tbl ) mOverlaps( Table img_tbl )
+{
+ mOverlaps @img_tbl @diff_tbl;
+}
+
+
+app ( Image proj_img ) mProjectPP( Image raw_img, Header hdr )
+{
+ mProjectPP "-X" @raw_img @proj_img @hdr;
+}
+
+
+app ( Image proj_img ) mProject( Image raw_img, Header hdr )
+{
+ mProject "-X" @raw_img @proj_img @hdr;
+}
+
+app ( Image shrunk ) mShrink( Image original, int factor )
+{
+ mShrink @original @shrunk factor;
+}
+
+/*----------------------------------------------------------------------------------*/
+/* */
+/* Util Scripts */
+/* */
+/*----------------------------------------------------------------------------------*/
+
+app ( Table back_tbl ) Background_list( Table imgs_tbl, Table rects_tbl )
+{
+ Background_list @imgs_tbl @rects_tbl @back_tbl;
+}
+
+
+app ( Table stat_tbl ) create_status_table( Table diff_tbl )
+{
+ create_status_table @diff_tbl @stat_tbl;
+}
Copied: SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft (from rev 4716, SwiftApps/SwiftMontage/scripts/Swift_Montage_Batch.swift)
===================================================================
--- SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft (rev 0)
+++ SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft 2011-06-30 16:49:54 UTC (rev 4718)
@@ -0,0 +1,88 @@
+( Image rect_imgs[] ) mBackgroundBatch( string dest, Image imgs[], Table img_tbl, Table rect_tbl )
+{
+ Table back_list = Background_list( img_tbl, rect_tbl );
+
+ BackgroundStruct back_struct[] = readData2( back_list );
+
+ foreach background_entry, i in back_struct
+ {
+ Image orig_img <single_file_mapper; file = @strcat( @dirname( imgs[i] )+"/", @background_entry.fname )>;
+ Image rect_img <regexp_mapper; source = @orig_img, match = ".*\\/(.*)", transform = dest+"/\\1">;
+
+ float a = background_entry.a;
+ float b = background_entry.b;
+ float c = background_entry.c;
+ rect_img = mBackground( orig_img, a, b, c );
+
+ rect_imgs[ i ] = rect_img;
+ }
+}
+
+
+( Image diff_imgs[] ) mDiffBatch( string src, string dest, Table diff_tbl, Header hdr )
+{
+ DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
+
+ foreach d_entry, i in diffs
+ {
+ Image img_1 <single_file_mapper; file = @strcat( src+"/", @d_entry.plus )>;
+ Image img_2 <single_file_mapper; file = @strcat( src+"/", @d_entry.minus )>;
+
+ Image diff_img <single_file_mapper; file = @strcat( dest+"/", @d_entry.diff )>;
+ diff_img = mDiff( img_1, img_2, hdr );
+
+ diff_imgs[ i ] = diff_img;
+ }
+}
+
+
+( Image diff_imgs[], Table fits_tbl ) mDiffFitBatch( string src, string dest, string stat, string files[], Table diff_tbl, Header 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+"/", @d_entry.plus )>;
+ Image img_2 <single_file_mapper; file = @strcat( src+"/", @d_entry.minus )>;
+
+ Image diff_img <single_file_mapper; file = @strcat( dest+"/", @d_entry.diff )>;
+ Status stat_file <single_file_mapper; file = stat+ at strcat( "/stat.", @d_entry.diff)>;
+
+ ( diff_img, stat_file ) = mDiffFit( img_1, img_2, hdr );
+
+ diff_imgs[ i ] = diff_img;
+ stats[ i ] = stat_file;
+ }
+ fits_tbl = mConcatFit( status_tbl, stats );
+}
+
+
+( Table fits_tbl ) mFitBatch( string stat, Image diff_imgs[], Table diff_tbl )
+{
+ Status stats[] <structured_regexp_mapper; source = diff_imgs, match = ".*\\/(.*)", transform = stat+"/stat.\\1">;
+
+ Table status_tbl = create_status_table( diff_tbl );
+
+ foreach img, i in stats
+ {
+ stats[ i ] = mFitplane ( diff_imgs[i] );
+ }
+
+ fits_tbl = mConcatFit( status_tbl, stats );
+}
+
+
+( Image proj_imgs[] ) mProjectBatch( string dest, Image raw_imgs[], Header hdr )
+{
+ foreach img, i in raw_imgs
+ {
+ Image proj_img <regexp_mapper; source = @img, match = ".*\\/(.*)", transform = dest+"/proj_\\1">;
+ proj_img = mProject( img, hdr );
+// proj_img = mProjectPP( img, hdr );
+
+ proj_imgs[ i ] = proj_img;
+ }
+}
Copied: SwiftApps/SwiftMontage/scripts/SwiftMontage_Types.swift (from rev 4716, SwiftApps/SwiftMontage/scripts/Swift_Montage_Types.swift)
===================================================================
--- SwiftApps/SwiftMontage/scripts/SwiftMontage_Types.swift (rev 0)
+++ SwiftApps/SwiftMontage/scripts/SwiftMontage_Types.swift 2011-06-30 16:49:54 UTC (rev 4718)
@@ -0,0 +1,23 @@
+type Image;
+type Header;
+type Table;
+type JPEG;
+type Status;
+
+type BackgroundStruct
+{
+ string fname;
+ float a;
+ float b;
+ float c;
+};
+
+
+type DiffStruct
+{
+ int cntr1;
+ int cntr2;
+ Image plus;
+ Image minus;
+ Image diff;
+};
Deleted: SwiftApps/SwiftMontage/scripts/Swift_Montage_Apps.swift
===================================================================
--- SwiftApps/SwiftMontage/scripts/Swift_Montage_Apps.swift 2011-06-30 16:49:23 UTC (rev 4717)
+++ SwiftApps/SwiftMontage/scripts/Swift_Montage_Apps.swift 2011-06-30 16:49:54 UTC (rev 4718)
@@ -1,98 +0,0 @@
-app ( Image mos ) mAdd( Image imgs[], Table img_tbl, Header hdr )
-{
- mAdd "-p" @dirname( imgs[0] ) "-n" @img_tbl @hdr @mos;
-}
-
-
-app ( Image rc_img ) mBackground( Image img, float a, float b, float c )
-{
- mBackground "-n" @img @rc_img a b c;
-}
-
-
-app ( Table rect_tbl ) mBgModel( Table img_tbl, Table fits_tbl )
-{
- mBgModel @img_tbl @fits_tbl @rect_tbl;
-}
-
-
-app ( Table fits_tbl ) mConcatFit( Table status_tbl, Status stats[] )
-{
- mConcatFit @status_tbl @fits_tbl @dirname( stats[0] );
-}
-
-
-app ( Image diff_img ) mDiff( Image proj_img_1, Image proj_img_2, Header hdr )
-{
- mDiff_wrap "-n" @proj_img_1 @proj_img_2 @diff_img @hdr;
-}
-
-
-app ( Image diff_img, Status stat ) mDiffFit( Image img_1, Image img_2, Header hdr )
-{
- mDiffFit_wrap "-n" "-s" @stat @img_1 @img_2 @diff_img @hdr;
-}
-
-
-app ( Status stat ) mFitplane( Image diff_img )
-{
- mFitplane_wrap "-s" @stat @diff_img;
-}
-
-
-app ( Table img_tbl ) mImgtbl( Image imgs[] )
-{
- mImgtbl @dirname( imgs[0] ) @img_tbl;
-}
-
-
-app ( Header hdr ) mMakeHdr( Table img_tbl )
-{
- mMakeHdr @img_tbl @hdr;
-}
-
-
-app ( JPEG mos_img_jpg ) mJPEG( Image mos_img )
-{
- mJPEG "-gray" @mos_img "20%" "99.98%" "loglog" "-out" @mos_img_jpg;
-}
-
-
-app ( Table diff_tbl ) mOverlaps( Table img_tbl )
-{
- mOverlaps @img_tbl @diff_tbl;
-}
-
-
-app ( Image proj_img ) mProjectPP( Image raw_img, Header hdr )
-{
- mProjectPP "-X" @raw_img @proj_img @hdr;
-}
-
-
-app ( Image proj_img ) mProject( Image raw_img, Header hdr )
-{
- mProject "-X" @raw_img @proj_img @hdr;
-}
-
-app ( Image shrunk ) mShrink( Image original, int factor )
-{
- mShrink @original @shrunk factor;
-}
-
-/*----------------------------------------------------------------------------------*/
-/* */
-/* Util Scripts */
-/* */
-/*----------------------------------------------------------------------------------*/
-
-app ( Table back_tbl ) Background_list( Table imgs_tbl, Table rects_tbl )
-{
- Background_list @imgs_tbl @rects_tbl @back_tbl;
-}
-
-
-app ( Table stat_tbl ) create_status_table( Table diff_tbl )
-{
- create_status_table @diff_tbl @stat_tbl;
-}
Deleted: SwiftApps/SwiftMontage/scripts/Swift_Montage_Batch.swift
===================================================================
--- SwiftApps/SwiftMontage/scripts/Swift_Montage_Batch.swift 2011-06-30 16:49:23 UTC (rev 4717)
+++ SwiftApps/SwiftMontage/scripts/Swift_Montage_Batch.swift 2011-06-30 16:49:54 UTC (rev 4718)
@@ -1,88 +0,0 @@
-( Image rect_imgs[] ) mBackgroundBatch( string dest, Image imgs[], Table img_tbl, Table rect_tbl )
-{
- Table back_list = Background_list( img_tbl, rect_tbl );
-
- BackgroundStruct back_struct[] = readData2( back_list );
-
- foreach background_entry, i in back_struct
- {
- Image orig_img <single_file_mapper; file = @strcat( @dirname( imgs[i] )+"/", @background_entry.fname )>;
- Image rect_img <regexp_mapper; source = @orig_img, match = ".*\\/(.*)", transform = dest+"/\\1">;
-
- float a = background_entry.a;
- float b = background_entry.b;
- float c = background_entry.c;
- rect_img = mBackground( orig_img, a, b, c );
-
- rect_imgs[ i ] = rect_img;
- }
-}
-
-
-( Image diff_imgs[] ) mDiffBatch( string src, string dest, Table diff_tbl, Header hdr )
-{
- DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
-
- foreach d_entry, i in diffs
- {
- Image img_1 <single_file_mapper; file = @strcat( src+"/", @d_entry.plus )>;
- Image img_2 <single_file_mapper; file = @strcat( src+"/", @d_entry.minus )>;
-
- Image diff_img <single_file_mapper; file = @strcat( dest+"/", @d_entry.diff )>;
- diff_img = mDiff( img_1, img_2, hdr );
-
- diff_imgs[ i ] = diff_img;
- }
-}
-
-
-( Image diff_imgs[], Table fits_tbl ) mDiffFitBatch( string src, string dest, string stat, string files[], Table diff_tbl, Header 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+"/", @d_entry.plus )>;
- Image img_2 <single_file_mapper; file = @strcat( src+"/", @d_entry.minus )>;
-
- Image diff_img <single_file_mapper; file = @strcat( dest+"/", @d_entry.diff )>;
- Status stat_file <single_file_mapper; file = stat+ at strcat( "/stat.", @d_entry.diff)>;
-
- ( diff_img, stat_file ) = mDiffFit( img_1, img_2, hdr );
-
- diff_imgs[ i ] = diff_img;
- stats[ i ] = stat_file;
- }
- fits_tbl = mConcatFit( status_tbl, stats );
-}
-
-
-( Table fits_tbl ) mFitBatch( string stat, Image diff_imgs[], Table diff_tbl )
-{
- Status stats[] <structured_regexp_mapper; source = diff_imgs, match = ".*\\/(.*)", transform = stat+"/stat.\\1">;
-
- Table status_tbl = create_status_table( diff_tbl );
-
- foreach img, i in stats
- {
- stats[ i ] = mFitplane ( diff_imgs[i] );
- }
-
- fits_tbl = mConcatFit( status_tbl, stats );
-}
-
-
-( Image proj_imgs[] ) mProjectBatch( string dest, Image raw_imgs[], Header hdr )
-{
- foreach img, i in raw_imgs
- {
- Image proj_img <regexp_mapper; source = @img, match = ".*\\/(.*)", transform = dest+"/proj_\\1">;
- proj_img = mProject( img, hdr );
-// proj_img = mProjectPP( img, hdr );
-
- proj_imgs[ i ] = proj_img;
- }
-}
Deleted: SwiftApps/SwiftMontage/scripts/Swift_Montage_Types.swift
===================================================================
--- SwiftApps/SwiftMontage/scripts/Swift_Montage_Types.swift 2011-06-30 16:49:23 UTC (rev 4717)
+++ SwiftApps/SwiftMontage/scripts/Swift_Montage_Types.swift 2011-06-30 16:49:54 UTC (rev 4718)
@@ -1,23 +0,0 @@
-type Image;
-type Header;
-type Table;
-type JPEG;
-type Status;
-
-type BackgroundStruct
-{
- string fname;
- float a;
- float b;
- float c;
-};
-
-
-type DiffStruct
-{
- int cntr1;
- int cntr2;
- Image plus;
- Image minus;
- Image diff;
-};
Modified: SwiftApps/SwiftMontage/scripts/montage.swift
===================================================================
--- SwiftApps/SwiftMontage/scripts/montage.swift 2011-06-30 16:49:23 UTC (rev 4717)
+++ SwiftApps/SwiftMontage/scripts/montage.swift 2011-06-30 16:49:54 UTC (rev 4718)
@@ -4,7 +4,7 @@
Table images_tbl <"images.tbl">;
Table difference_tbl <"diffs.tbl">;
Table fits_images_tbl <"fits.tbl">;
-Table corrections_tbl <"corrections.tbl">;
+Table rectification_tbl <"rectification.tbl">;
Table stat_tbl <"stats.tbl">;
Image rectified_mos <"final/rectified.fits">;
JPEG rectified_jpg_img <"final/rectified.jpg">;
@@ -22,9 +22,9 @@
( difference_images, fits_images_tbl ) = mDiffFitBatch( "proj_dir", "diff_dir", "stat_dir", @filenames(projected_images), difference_tbl, header );
-corrections_tbl = mBgModel( images_tbl, fits_images_tbl );
+rectification_tbl = mBgModel( images_tbl, fits_images_tbl );
-rectified_images = mBackgroundBatch( "corr_dir", projected_images, images_tbl, corrections_tbl );
+rectified_images = mBackgroundBatch( "rect_dir", projected_images, images_tbl, rectification_tbl );
rectified_mos = mAdd( rectified_images, images_tbl, header );
More information about the Swift-commit
mailing list