[Swift-commit] r6807 - SwiftApps/Scattering/paintgrid/docs

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Thu Aug 8 14:43:57 CDT 2013


Author: davidk
Date: 2013-08-08 14:43:57 -0500 (Thu, 08 Aug 2013)
New Revision: 6807

Added:
   SwiftApps/Scattering/paintgrid/docs/paintGrid.png
Modified:
   SwiftApps/Scattering/paintgrid/docs/README
   SwiftApps/Scattering/paintgrid/docs/tutorial.html
Log:
Diagram and explanation of paintgrid.swift


Modified: SwiftApps/Scattering/paintgrid/docs/README
===================================================================
--- SwiftApps/Scattering/paintgrid/docs/README	2013-08-08 19:12:14 UTC (rev 6806)
+++ SwiftApps/Scattering/paintgrid/docs/README	2013-08-08 19:43:57 UTC (rev 6807)
@@ -113,5 +113,56 @@
    0.000000   0.000000   0.000000       0.000000
 -----
 
+paintgrid.swift
+---------------
+image:paintGrid.png[]
 
-swift -tc.file apps -sites.file amd.xml paintgrid.swift -runDir=$PWD -params=genpoints.params -image=data.0001.tiny  
+The paintgrid Swift script first runs genPoints.py to create a list of point
+files. The processpoints.py script is then run for each of the point files that
+genPoints.py creates. Below is the paintgrid.swift script.
+
+-----
+type file;
+
+# External app to generate sets of input data points
+
+app (file plist) genPoints (file pyscript, file paramFile)
+{
+  local_python @pyscript @paramFile runDir stdout=@plist;
+}
+
+# External app to process a set of data points (a mockup of paintGrid)
+
+app (file ofile) processPoints (file pyscript, file imageFile, file points)
+{
+  python @pyscript @imageFile @points runTime stdout=@ofile;
+}
+
+# The actual python scripts for the app() functions above
+
+file genPoints_script     <"genpoints.py">;
+file processPoints_script <"processpoints.py">;
+
+# Command line args to this script
+
+file   params   <single_file_mapper;file=@arg("params", "genpoints.params")>;
+file   image    <single_file_mapper;file=@arg("image",  "UNSPECIFIED.tif")>;
+global string runTime = @arg("runTime","0.0");
+global string runDir  = @java("java.lang.System","getProperty","user.dir");
+
+# Main script:
+#   Call genPoints to make a set of files, each of which contains a set of data points to process
+#   The params file specifies the range of points to generate, and how to batch them into files
+#   (In this example the input points are triples in 3-space)
+
+string pointSetFileNames[]=readData(genPoints(genPoints_script,params));
+file   pointSets[] <array_mapper; files=pointSetFileNames>;
+
+foreach pointSet, i in pointSets {
+  file ofile<single_file_mapper; file=@strcat("out/out.", at strcut(@strcat("00000",i),"(.....$)"))>;
+  ofile = processPoints(processPoints_script, image, pointSet);
+} 
+-----
+
+How to run
+----------

Added: SwiftApps/Scattering/paintgrid/docs/paintGrid.png
===================================================================
(Binary files differ)


Property changes on: SwiftApps/Scattering/paintgrid/docs/paintGrid.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: SwiftApps/Scattering/paintgrid/docs/tutorial.html
===================================================================
--- SwiftApps/Scattering/paintgrid/docs/tutorial.html	2013-08-08 19:12:14 UTC (rev 6806)
+++ SwiftApps/Scattering/paintgrid/docs/tutorial.html	2013-08-08 19:43:57 UTC (rev 6807)
@@ -773,15 +773,23 @@
 Runtime is  1.0  seconds per point
    0.000000   0.000000   0.000000       0.000000</tt></pre>
 </div></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_paintgrid_swift">paintgrid.swift</h2>
+<div class="sectionbody">
+<div class="paragraph"><p><span class="image">
+<img src="paintGrid.png" alt="paintGrid.png" />
+</span></p></div>
 <div class="paragraph"><p>swift -tc.file apps -sites.file amd.xml paintgrid.swift -runDir=$PWD -params=genpoints.params -image=data.0001.tiny</p></div>
 </div>
 </div>
 </div>
-</div>
 <div id="footnotes"><hr /></div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2013-08-08 14:07:42 CDT
+Last updated 2013-08-08 14:30:35 CDT
 </div>
 </div>
 </body>




More information about the Swift-commit mailing list