[Swift-commit] r6307 - in SwiftApps/modis: . bin tutorial

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Fri Feb 22 16:19:48 CST 2013


Author: davidk
Date: 2013-02-22 16:19:48 -0600 (Fri, 22 Feb 2013)
New Revision: 6307

Removed:
   SwiftApps/modis/modis.swift
Modified:
   SwiftApps/modis/bin/getlanduse.sh
   SwiftApps/modis/bin/markmap.sh
   SwiftApps/modis/tutorial/modis01.swift
   SwiftApps/modis/tutorial/modis02.swift
   SwiftApps/modis/tutorial/modis03.swift
   SwiftApps/modis/tutorial/modis04.swift
Log:
Simplify things a bit by removing the is_land script. This is not really needed for map generation. If an image exists, it covers land (which is why there aren't more than 317 tiles)


Modified: SwiftApps/modis/bin/getlanduse.sh
===================================================================
--- SwiftApps/modis/bin/getlanduse.sh	2013-02-22 20:08:23 UTC (rev 6306)
+++ SwiftApps/modis/bin/getlanduse.sh	2013-02-22 22:19:48 UTC (rev 6307)
@@ -2,4 +2,3 @@
 
 BINDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 $BINDIR/getlanduse.pl $1 | sort -rn
-$BINDIR/is_land.pl $1 > $2

Modified: SwiftApps/modis/bin/markmap.sh
===================================================================
--- SwiftApps/modis/bin/markmap.sh	2013-02-22 20:08:23 UTC (rev 6306)
+++ SwiftApps/modis/bin/markmap.sh	2013-02-22 22:19:48 UTC (rev 6307)
@@ -6,8 +6,6 @@
 tilefile=$1
 outmap=$2
 asciimap=$3
-modisdir=$4
-is_land_files=$5
 
 cp $BINDIR/grid.ppm $outmap
 
@@ -19,23 +17,3 @@
   mv $outmap.tmp $outmap
 done
 
-for h in {0..35}; do
-   h=$( printf %02d $h );
-   for v in {0..17}; do
-      v=$( printf %02d $v );
-      hv=h${h}v${v}
-      #echo hv is $hv >> $asciimap
-      if [ -f "landuse/$hv.is_land" ]; then
-         is_land=$( cat landuse/$hv.is_land )
-         if [ "$is_land" == 0 ]; then
-            echo -n "X" >> $asciimap
-         else
-            echo -n "_" >> $asciimap
-         fi
-      else
-         echo -n " " >> $asciimap
-      fi
-   done
-   echo "" >> $asciimap
-done
-

Deleted: SwiftApps/modis/modis.swift
===================================================================
--- SwiftApps/modis/modis.swift	2013-02-22 20:08:23 UTC (rev 6306)
+++ SwiftApps/modis/modis.swift	2013-02-22 22:19:48 UTC (rev 6307)
@@ -1,74 +0,0 @@
-type file;
-type imagefile;
-type landuse;
-
-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)
-{
-  analyzelanduse @output @tilelist usetype maxnum @input;
-}
-
-app (imagefile output, file olog, file elog) colorMODIS (imagefile input)
-{
-  colormodis @input @output stdout=@olog stderr=@elog;
-}
-
-app (imagefile output, file olog, file elog) assemble (file selected, imagefile image[], string webdir)
-{
-  assemble @output @selected @filename(image[0]) webdir stdout=@olog stderr=@elog;
-}
-
-app (imagefile grid) markMap (file tilelist) 
-{
-  markmap @tilelist @grid;
-}
-
-# 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");
-
-# Input Dataset
-imagefile geos[] <ext; exec="../bin/modis.mapper", location=MODISdir, suffix=".rgb", n=nFiles>;
-
-# 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")>;
-
-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">;
-(topSelected, selectedTiles) = analyzeLandUse(land, landType, nSelect);
-
-# Mark the top N tiles on a sinusoidal gridded map
-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">;
-
-#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);
-#}
-
-# 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);
-

Modified: SwiftApps/modis/tutorial/modis01.swift
===================================================================
--- SwiftApps/modis/tutorial/modis01.swift	2013-02-22 20:08:23 UTC (rev 6306)
+++ SwiftApps/modis/tutorial/modis01.swift	2013-02-22 22:19:48 UTC (rev 6307)
@@ -1,12 +1,11 @@
 type imagefile;
 type landuse;
 
-app (landuse output, landuse is_land) getLandUse (imagefile input)
+app (landuse output) getLandUse (imagefile input)
 {
-  getlanduse @filename(input) @filename(is_land) stdout=@filename(output);
+  getlanduse @filename(input) stdout=@filename(output);
 }
 
 imagefile modisImage <"../data/modis/2002/h00v09.rgb">;
 landuse result <"landuse/h00v09.landuse.byfreq">;
-landuse land_result <"landuse/h00v09.is_land">;
-(result, land_result) = getLandUse(modisImage);
+result = getLandUse(modisImage);

Modified: SwiftApps/modis/tutorial/modis02.swift
===================================================================
--- SwiftApps/modis/tutorial/modis02.swift	2013-02-22 20:08:23 UTC (rev 6306)
+++ SwiftApps/modis/tutorial/modis02.swift	2013-02-22 22:19:48 UTC (rev 6307)
@@ -1,9 +1,9 @@
 type imagefile;
 type landuse;
 
-app (landuse output, landuse island) getLandUse (imagefile input)
+app (landuse output) getLandUse (imagefile input)
 {
-  getlanduse @filename(input) @filename(island) stdout=@filename(output);
+  getlanduse @filename(input) stdout=@filename(output);
 }
 
 # Constants and command line arguments
@@ -15,9 +15,8 @@
 
 # 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 is_land[] <structured_regexp_mapper; source=geos, match="(h..v..)", transform=@strcat("landuse/\\1.is_land")>;
 
 foreach g,i in geos {
-    (land[i], is_land[i]) = getLandUse(g);
+    land[i] = getLandUse(g);
 }
 

Modified: SwiftApps/modis/tutorial/modis03.swift
===================================================================
--- SwiftApps/modis/tutorial/modis03.swift	2013-02-22 20:08:23 UTC (rev 6306)
+++ SwiftApps/modis/tutorial/modis03.swift	2013-02-22 22:19:48 UTC (rev 6307)
@@ -2,9 +2,9 @@
 type imagefile;
 type landuse;
 
-app (landuse output, landuse island) getLandUse (imagefile input)
+app (landuse output) getLandUse (imagefile input)
 {
-  getlanduse @filename(input) @filename(island) stdout=@filename(output);
+  getlanduse @filename(input) stdout=@filename(output);
 }
 
 app (file output, file tilelist) analyzeLandUse (landuse input[], string usetype, int maxnum)
@@ -23,10 +23,9 @@
 
 # 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 is_land[] <structured_regexp_mapper; source=geos, match="(h..v..)", transform=@strcat("landuse/\\1.is_land")>;
 
 foreach g,i in geos {
-    (land[i], is_land[i]) = getLandUse(g);
+    land[i] = getLandUse(g);
 }
 
 # Find the top N tiles (by total area of selected landuse types)

Modified: SwiftApps/modis/tutorial/modis04.swift
===================================================================
--- SwiftApps/modis/tutorial/modis04.swift	2013-02-22 20:08:23 UTC (rev 6306)
+++ SwiftApps/modis/tutorial/modis04.swift	2013-02-22 22:19:48 UTC (rev 6307)
@@ -2,9 +2,9 @@
 type imagefile;
 type landuse;
 
-app (landuse output, landuse island) getLandUse (imagefile input)
+app (landuse output) getLandUse (imagefile input)
 {
-  getlanduse @filename(input) @filename(island) stdout=@filename(output);
+  getlanduse @filename(input) stdout=@filename(output);
 }
 
 app (file output, file tilelist) analyzeLandUse (landuse input[], string usetype, int maxnum)
@@ -12,9 +12,9 @@
   analyzelanduse @output @tilelist usetype maxnum @input;
 }
 
-app (imagefile grid, file asciimap) markMap (file tilelist, string mdir, landuse island[]) 
+app (imagefile grid) markMap (file tilelist) 
 {
-  markmap @tilelist @grid @filename(asciimap) mdir @island;
+  markmap @tilelist @grid;
 }
 
 # Constants and command line arguments
@@ -28,10 +28,9 @@
 
 # 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 is_land[] <structured_regexp_mapper; source=geos, match="(h..v..)", transform=@strcat("landuse/\\1.is_land")>;
 
 foreach g,i in geos {
-    (land[i], is_land[i]) = getLandUse(g);
+    land[i] = getLandUse(g);
 }
 
 # Find the top N tiles (by total area of selected landuse types)
@@ -42,4 +41,4 @@
 # Mark the top N tiles on a sinusoidal gridded map
 imagefile gridMap <"markedGrid.ppm">;
 file asciiMap <"map.txt">;
-(gridMap, asciiMap) = markMap(topSelected, MODISdir, is_land);
+gridMap = markMap(topSelected);




More information about the Swift-commit mailing list