[Swift-commit] r3651 - SwiftApps/Montage/scripts
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Thu Sep 30 15:54:25 CDT 2010
Author: jonmon
Date: 2010-09-30 15:54:24 -0500 (Thu, 30 Sep 2010)
New Revision: 3651
Added:
SwiftApps/Montage/scripts/mDiff_wrap.sh
SwiftApps/Montage/scripts/mFitplane_wrap.sh
Modified:
SwiftApps/Montage/scripts/Swift_Montage_Apps.swift
SwiftApps/Montage/scripts/Swift_Montage_Batch.swift
SwiftApps/Montage/scripts/Swift_Montage_Types.swift
Log:
o Montage/scripts/Swift_Montage_Apps.swift
o Montage/scripts/Swift_Montage_Batch.swift
o Montage/scripts/Swift_Montage_Types.swift
-- Removed all tracefs from code. Seemed to exacerbate hanging problem that is being encountered due to low Java heap memory.
o Montage/scripts/mFitplane_wrap.sh
o Montage/scripts/mDiff_wrap.sh
-- Wrote wrapper script to always return exit code 0. If these Montage functions encounter a problem them return exit code 1 which in turn causes Swift to fail. I do not need Swift to fail, merely continue on.
Modified: SwiftApps/Montage/scripts/Swift_Montage_Apps.swift
===================================================================
--- SwiftApps/Montage/scripts/Swift_Montage_Apps.swift 2010-09-29 17:05:12 UTC (rev 3650)
+++ SwiftApps/Montage/scripts/Swift_Montage_Apps.swift 2010-09-30 20:54:24 UTC (rev 3651)
@@ -1,157 +1,83 @@
-/*! \fn app Image mAdd( Image imgs[], Table img_tbl, MosaicData hdr )
- \brief Adds all images in imgs[] into one image file based off the information in img_tbl and hdr.
-
- \param imgs[] List of images to be added into one image. All images but reside in same directory.
- \param img_tbl Table containing information about images being added
- \param hdr MosaicData file containing information about how mosaic will look.
- \return mos Image file containing data about mosaic.
-*/
app ( Image mos ) mAdd( Image imgs[], Table img_tbl, MosaicData hdr )
{
mAdd "-p" @dirname( imgs[0] ) "-n" @img_tbl @hdr @mos;
}
-/*! \fn app Image mBackground( Image img, Table img_tbl, Table corr_tbl )
- \brief Generates a corrected image from imgs and the information from corr_tbl
-
- \param img Image to be corrected
- \param img_tbl Table containing information about images being added
- \param corr_tbl Correction table containing correction coefficients to be applied
- \return mos bg_img corrected image
-*/
app ( Image bg_img ) mBackground( Image img, float a, float b, float c )
{
mBackground "-n" @img @bg_img a b c;
}
-/*! \fn app Table mBgModel( Table img_tbl, Table fits_tbl )
- \brief Generates the corrected image table from the coefficeints data from fits_tbl and data from the projected image table
-
- \param img_tbl Table containing information about the projected images.
- \param fits_tbl Table containing information about how to correct an image
- \return corr_tbl Correction table containing correction coefficients to be applied
-*/
app ( Table corr_tbl ) mBgModel( Table img_tbl, Table fits_tbl )
{
mBgModel @img_tbl @fits_tbl @corr_tbl;
}
-/*! \fn app Table mConcatFit( Table status_tbl, Status stats[] )
- \brief Takes all the status files created by mFitplane and creates the fits table.
-
- \param status_tbl Table containing the file names for the status files
- \param stats[] Array of all the status files
- \return fits_tbl Table contianing information about how to correct and image.
-*/
app ( Table fits_tbl ) mConcatFit( Table status_tbl, Status stats[] )
{
mConcatFit @status_tbl @fits_tbl @dirname( stats[0] );
}
-/*! \fn app Image mDiff( Image proj_img_1, Image proj_img_2, MosaicData hdr )
- \brief Calculates the difference image from the two projected images and the header file.
-
- \param proj_img_1 The first image to calculate how much is overlapped
- \param proj_img_2 The second image to calculate how much is overlapped
- \param hdr MosaicData file that tells how the mosaic is set up
- \return diff_img Difference image that contains overlapped information
-*/
app ( Image diff_img ) mDiff( Image proj_img_1, Image proj_img_2, MosaicData hdr )
{
- mDiff "-n" @proj_img_1 @proj_img_2 @diff_img @hdr;
+// mDiff "-n" @proj_img_1 @proj_img_2 @diff_img @hdr;
+ mDiff_wrap "-n" @proj_img_1 @proj_img_2 @diff_img @hdr;
}
-/*! \fn app Status mFitplane( Image diff_img )
- \brief Creates a file with all the information on how to fit the particular difference image
-
- \param diff_img The image to calculate best fit for.
- \return stat File containing coefficents and mosaic data on how to fit diff_img.
-*/
app ( Status stat ) mFitplane( Image diff_img )
{
- mFitplane "-s" @stat @diff_img;
+// mFitplane "-s" @stat @diff_img;
+ mFitplane_wrap "-s" @stat @diff_img;
}
-/*! \fn app Table mImgtbl( Image imgs[] )
- \brief Take a list of of images and create a table out of them. All images in the list must be located in the same directory.
-
- \param imgs[] List of files to create an table out of.
- \return img_tbl Table of information of the list of images.
-*/
app ( Table img_tbl ) mImgtbl( Image imgs[] )
{
mImgtbl @dirname( imgs[0] ) @img_tbl;
}
-/*! \fn app JPEG mJPEG( Image mos_img )
- \brief Creates a viewable jpeg image from the mosaic data image
-
- \param mos_img Image file to create a jpeg out of.
- \return mos_img_jpg Jpeg picture.
-*/
app ( JPEG mos_img_jpg ) mJPEG( Image mos_img )
{
mJPEG "-gray" @mos_img "20%" "99.98%" "loglog" "-out" @mos_img_jpg;
}
-/*! \fn app Table mOverlaps( Table img_tbl )
- \brief Calculates which images overlaps each other and creates a table out of.
-
- \param img_tbl Table of projected images.
- \return diff_tbl Table of which overlapped images
-*/
app ( Table diff_tbl ) mOverlaps( Table img_tbl )
{
mOverlaps @img_tbl @diff_tbl;
}
-/*! \fn app Image mProjectPP( Image raw_img, MosaicData hdr )
- \brief Projects an image based off of the header file.
-
- \param raw_img Raw image to project.
- \param hdr MosaicData file telling how the mosaic will be set up in the end.
- \return proj_img Projected image.
-*/
app ( Image proj_img ) mProjectPP( Image raw_img, MosaicData hdr )
{
mProjectPP "-X" @raw_img @proj_img @hdr;
}
+app ( Image proj_img ) mProject( Image raw_img, MosaicData hdr )
+{
+ mProject "-X" @raw_img @proj_img @hdr;
+}
+
+
/*----------------------------------------------------------------------------------*/
/* */
/* Util Scripts */
/* */
/*----------------------------------------------------------------------------------*/
-/*! \fn app Table Background_list( Table imgs_tbl, Table corrs_tbl
- \brief Generates a list of coefficients that need to be applied and the files to apply them to.
-
- \param imgs_tbl Table generated by mImgtbl containing information on the set of images
- \param corrs_tbl Table containing the coefficients and the id of the image to apply them to
- \return back_tbl Table containing the Image file name and the coefficients that need to be applied to the image. Data is set up so readDatat2 can read the data.
-*/
app ( Table back_tbl ) Background_list( Table imgs_tbl, Table corrs_tbl )
{
Background_list @imgs_tbl @corrs_tbl @back_tbl;
}
-/*! \fn app Table create_status_table( Table diff_tbl )
- \brief Generates a Table of the status files created by mFitplane
-
- \param diff_tbl Difference table of the files that mFitplane will run on.
- \return stat_tbl Table that contains the information of the status files that will be generated using mFitplane.
-*/
app ( Table stat_tbl ) create_status_table( Table diff_tbl )
{
create_status_table @diff_tbl @stat_tbl;
Modified: SwiftApps/Montage/scripts/Swift_Montage_Batch.swift
===================================================================
--- SwiftApps/Montage/scripts/Swift_Montage_Batch.swift 2010-09-29 17:05:12 UTC (rev 3650)
+++ SwiftApps/Montage/scripts/Swift_Montage_Batch.swift 2010-09-30 20:54:24 UTC (rev 3651)
@@ -1,19 +1,3 @@
-/*! \file Swift_Montage_Batch.swift
- \brief File containing Batch functions for the Swift Montage wrappers
-
- Each batch function allows basic Montage functions to be called on a list of
- images.
-*/
-
-
-/*! \fn Image mBgBatch( Image bg_imgs[], Table img_tbl, Table corr_tbl )
- \brief Runs the mBackground wrapper on a list of images in parallel.
-
- \param bg_imgs[] The list of images to run the mBackground wrapper on.
- \param img_tbl Table containing information on original images.
- \param corr_tbl Table containing correction coefficients to be applied to the images.
- \return corr_imgs[] List of the corrected images to be added to create image mosaic.
-*/
( Image corr_imgs[] ) mBgBatch( Image bg_imgs[], Table img_tbl, Table corr_tbl )
{
Table tmp <"back_tmp.tbl">;
@@ -36,16 +20,9 @@
}
-/*! \fn Image mDiffBatch( Table diff_tbl, MosaicData hdr )
- \brief Runs the mDiff wrapper on a list of images in parallel.
-
- \param diff_tbl Table containing a list of images that overlap and must calculate by how much they overlap.
- \param hdr File containing information on how the final mosaic will be set up.
- \return diff_imgs[] List of the difference images that must have correction coefficients calculated.
-*/
( Image diff_imgs[] ) mDiffBatch( Table diff_tbl, MosaicData hdr )
{
- DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
+ DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
foreach d_entry, i in diffs
{
@@ -57,18 +34,12 @@
Image diff_img <single_file_mapper; file = @strcat( "diff_dir/", @d_entry.diff )>;
diff_img = mDiff( proj_1, proj_2, hdr );
+
diff_imgs[ i ] = diff_img;
}
}
-/*! \fn app Table mFitBatch( Table diff_tbl, Image diff_imgs[] )
- \brief Generates a corrected image from imgs and the information from corr_tbl
-
- \param diff_tbl
- \param diff_imgs
- \return fits_tbl
-*/
( Table fits_tbl ) mFitBatch( Image diff_imgs[], Table diff_tbl )
{
Status stats[] <structured_regexp_mapper; source = diff_imgs, match = ".*\\/(.*)", transform = "stat_dir/stat.\\1">;
@@ -78,27 +49,20 @@
foreach img, i in stats
{
- stats[i] = mFitplane ( diff_imgs[i] );
+ stats[ i ] = mFitplane ( diff_imgs[i] );
}
fits_tbl = mConcatFit( status_tbl, stats );
}
-/*! \fn Image mProjectPPBatch( Image raw_imgs[], MosaicData hdr )
- \brief Projects the raw images from raw_imgs to a new plane that was declared in hdr.
-
- \param raw_imgs[] List of raw images that need to be projected to new plane.
- \param hdr File containing information on how the final mosaic will be set up.
- \return proj_imgs[] List of newly reprojected images.
-*/
-( Image proj_imgs[] ) mProjectPPBatch( Image raw_imgs[], MosaicData hdr )
+( Image proj_imgs[] ) mProjectBatch( Image raw_imgs[], MosaicData hdr )
{
foreach img, i in raw_imgs
{
- Image proj_img <regexp_mapper; source = @img, match = ".*\\/(.*)", transform = "proj_dir/proj_\\1">;
-
+ Image proj_img <regexp_mapper; source = @img, match = ".*\\/(.*)", transform = "proj_dir/proj_\\1">;
proj_img = mProjectPP( img, hdr );
+// proj_img = mProject( img, hdr );
proj_imgs[ i ] = proj_img;
}
Modified: SwiftApps/Montage/scripts/Swift_Montage_Types.swift
===================================================================
--- SwiftApps/Montage/scripts/Swift_Montage_Types.swift 2010-09-29 17:05:12 UTC (rev 3650)
+++ SwiftApps/Montage/scripts/Swift_Montage_Types.swift 2010-09-30 20:54:24 UTC (rev 3651)
@@ -1,39 +1,9 @@
-/*! \file Swift_Montage_Types.swift
- \brief File containing declared Swift types for the Swift Montage wrappers
-*/
-
-/*! \typdef type Image
- \brief Declared Image Swift type.
-*/
type Image;
-
-
-/*! \typdef type MosaicData
- \brief Declared MosaicData Swift type.
-*/
type MosaicData;
-
-
-/*! \typdef type Table
- \brief Declared Table Swift type.
-*/
type Table;
-
-
-/*! \typdef type JPEG
- \brief Declared JPEG Swift type.
-*/
type JPEG;
-
-/*! \typdef type Status
- \brief Declared Status Swift type.
-*/
type Status;
-
-/*! \struct BackgroundStruct
- \brief Stuct to hold data found in the tables generated my mImgtbl and mBgModel
-*/
type BackgroundStruct
{
string fname;
@@ -43,9 +13,6 @@
};
-/*! \struct DiffStruct
- \brief Stuct to hold data found in the table that is generated from the mOverlaps wrapper.
-*/
type DiffStruct
{
int cntr1;
Added: SwiftApps/Montage/scripts/mDiff_wrap.sh
===================================================================
--- SwiftApps/Montage/scripts/mDiff_wrap.sh (rev 0)
+++ SwiftApps/Montage/scripts/mDiff_wrap.sh 2010-09-30 20:54:24 UTC (rev 3651)
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+mDiff $1 $2 $3 $4 $5
+if [ $? == 1 ]; then
+ touch $4
+fi
+exit 0
Property changes on: SwiftApps/Montage/scripts/mDiff_wrap.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: SwiftApps/Montage/scripts/mFitplane_wrap.sh
===================================================================
--- SwiftApps/Montage/scripts/mFitplane_wrap.sh (rev 0)
+++ SwiftApps/Montage/scripts/mFitplane_wrap.sh 2010-09-30 20:54:24 UTC (rev 3651)
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+mFitplane $1 $2 $3
+if [ $? == 1 ]; then
+ touch $2
+fi
+exit 0
Property changes on: SwiftApps/Montage/scripts/mFitplane_wrap.sh
___________________________________________________________________
Name: svn:executable
+ *
More information about the Swift-commit
mailing list