[Swift-commit] r6266 - in SwiftApps/modis: . conf

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Wed Feb 13 12:15:05 CST 2013


Author: davidk
Date: 2013-02-13 12:15:05 -0600 (Wed, 13 Feb 2013)
New Revision: 6266

Modified:
   SwiftApps/modis/clean.sh
   SwiftApps/modis/conf/local.cf
   SwiftApps/modis/demo
   SwiftApps/modis/modis.swift
Log:


Modified: SwiftApps/modis/clean.sh
===================================================================
--- SwiftApps/modis/clean.sh	2013-02-13 18:12:28 UTC (rev 6265)
+++ SwiftApps/modis/clean.sh	2013-02-13 18:15:05 UTC (rev 6266)
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-rm -rf run0*
+rm -rf run*

Modified: SwiftApps/modis/conf/local.cf
===================================================================
--- SwiftApps/modis/conf/local.cf	2013-02-13 18:12:28 UTC (rev 6265)
+++ SwiftApps/modis/conf/local.cf	2013-02-13 18:15:05 UTC (rev 6266)
@@ -8,7 +8,7 @@
 #site local JOBTHROTTLE=0.038
 
 #app getlanduse=$PWD/../bin/getlanduse.sh
-#app analyzelanduse=$PWD/../bin/analyzelanduse2.sh
+#app analyzelanduse=$PWD/../bin/analyzelanduse.sh
 #app colormodis=$PWD/../bin/colormodis.sh
 #app assemble=$PWD/../bin/assemble2.sh
 #app markmap=$PWD/../bin/markmap.sh

Modified: SwiftApps/modis/demo
===================================================================
--- SwiftApps/modis/demo	2013-02-13 18:12:28 UTC (rev 6265)
+++ SwiftApps/modis/demo	2013-02-13 18:15:05 UTC (rev 6266)
@@ -3,7 +3,7 @@
 # Defaults
 LANDTYPE=urban
 NFILES=1000
-NSELECT=12
+NSELECT=10
 SITE=local
 WEBDIR=$HOME/public_html/geo
 MODISDIR=$PWD/data/modis/2002

Modified: SwiftApps/modis/modis.swift
===================================================================
--- SwiftApps/modis/modis.swift	2013-02-13 18:12:28 UTC (rev 6265)
+++ SwiftApps/modis/modis.swift	2013-02-13 18:15:05 UTC (rev 6266)
@@ -2,28 +2,24 @@
 type imagefile;
 type landuse;
 
-# Define application program interfaces
-
 app (landuse output) getLandUse (imagefile input, int sortfield, string mpath)
 {
   getlanduse @input sortfield mpath stdout=@output;
 }
 
-app (file output, file tilelist) analyzeLandUse
-    (landuse input[], string usetype, int maxnum)
+app (file output, file tilelist) analyzeLandUse (landuse input[], string usetype, int maxnum)
 {
-  analyzelanduse @output @tilelist usetype maxnum @filenames(input);
+  analyzelanduse @output @tilelist usetype maxnum @input;
 }
 
-app (imagefile output) colorMODIS (imagefile input)
+app (imagefile output, file olog, file elog) colorMODIS (imagefile input)
 {
-  colormodis @input @output;
+  colormodis @input @output stdout=@olog stderr=@elog;
 }
 
-app (imagefile output) assemble
-    (file selected, imagefile image[], string webdir)
+app (imagefile output, file olog, file elog) assemble (file selected, imagefile image[], string webdir)
 {
-  assemble @output @selected @filename(image[0]) webdir;
+  assemble @output @selected @filename(image[0]) webdir stdout=@olog stderr=@elog;
 }
 
 app (imagefile grid) markMap (file tilelist) 
@@ -32,62 +28,47 @@
 }
 
 # Constants and command line arguments
+int nFiles       = @toInt(@arg("nfiles"));
+int nSelect      = @toInt(@arg("nselect"));
+string landType  = @arg("landtype");
+string MODISdir  = @arg("modisdir");
+string webDir    = @arg("webdir");
 
-int nFiles =      @toInt(@arg("nfiles","1000"));
-int nSelect =     @toInt(@arg("nselect","12"));
-string landType = @arg("landtype","urban");
-string MODISdir=  @arg("modisdir");
-string webDir =   @arg("webdir");
-
-string suffix=".ppm.gz";
-
 # Input Dataset
+imagefile geos[] <ext; exec="../bin/modis.mapper", location=MODISdir, suffix=".pgm.gz", n=nFiles>;
 
-imagefile geos[] <ext; exec="../bin/modis.mapper",
-  location=MODISdir, suffix=".ppm.gz", n=nFiles >; # site=site
-
-
 # Compute the land use summary of each MODIS tile
+landuse land[] <structured_regexp_mapper; source=geos, match="(h..v..)", transform=@strcat("landuse/\\1.landuse.byfreq")>;
 
-landuse land[] <structured_regexp_mapper; source=geos, match="(h..v..)",
-  transform=@strcat("\\1.landuse.byfreq")>;
-
 foreach g,i in geos {
     land[i] = getLandUse(g,1,MODISdir);
 }
 
 # Find the top N tiles (by total area of selected landuse types)
-
-file topSelected<"topselected.txt">;
-file selectedTiles<"selectedtiles.txt">;
+file topSelected <"topselected.txt">;
+file selectedTiles <"selectedtiles.txt">;
 (topSelected, selectedTiles) = analyzeLandUse(land, landType, nSelect);
 
 # Mark the top N tiles on a sinusoidal gridded map
-
-imagefile gridMap<"markedGrid.gif">;
+imagefile gridMap<"markedGrid.ppm.gz">;
 gridMap = markMap(topSelected);
 
 # Create multi-color images for all tiles
+#imagefile colorImage[] <structured_regexp_mapper;
+#          source=geos, match="(h..v..)", 
+#          transform="landuse/\\1.color.png">;
 
-imagefile colorImage[] <structured_regexp_mapper;
-          source=geos, match="(h..v..)", 
-          transform="\\1.color.png">;
+#foreach g, i in geos {
+#  file outfile <single_file_mapper; file=@strcat("logs/colormodis.", i, ".o.log")>;
+#  file errfile <single_file_mapper; file=@strcat("logs/colormodis.", i, ".e.log")>;
+#  // tracef("calling colorimage %s %s\n", @g, @colorImage[i]);
+#  (colorImage[i], outfile, errfile) = colorMODIS(g);
+#}
 
-foreach g, i in geos {
-  colorImage[i] = colorMODIS(g);
-}
-
 # Assemble a montage of the top selected areas
+#imagefile montage<"map.png">; # @arg
+#file assemble_olog <"logs/assemble.o.log">;
+#file assemble_elog <"logs/assemble.e.log">;
+#tracef("Calling assemble %s %s %s %s\n", @montage, @selectedTiles, @colorImage[0], webDir);
+#(montage, assemble_olog, assemble_elog) = assemble(selectedTiles,colorImage,webDir);
 
-imagefile montage <single_file_mapper; file=@strcat("map.png") >; # @arg
-montage = assemble(selectedTiles,colorImage,webDir);
-
-# future args:
-
-int selectHiThreshold;
-int selectLowThreshold;
-string upperLeftTile;
-string lowerRightTile;
-float imageSizes[];
-string displayOptions;
-




More information about the Swift-commit mailing list