[Swift-commit] r6762 - in SwiftTutorials/ATPESC_2013-08-06/modis: bin modis06
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Mon Aug 5 14:41:07 CDT 2013
Author: davidk
Date: 2013-08-05 14:41:07 -0500 (Mon, 05 Aug 2013)
New Revision: 6762
Added:
SwiftTutorials/ATPESC_2013-08-06/modis/modis06/apps
SwiftTutorials/ATPESC_2013-08-06/modis/modis06/clean.sh
SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift
SwiftTutorials/ATPESC_2013-08-06/modis/modis06/sites.xml
Modified:
SwiftTutorials/ATPESC_2013-08-06/modis/bin/assemble.sh
SwiftTutorials/ATPESC_2013-08-06/modis/bin/colormodis.sh
SwiftTutorials/ATPESC_2013-08-06/modis/bin/montage.pl
Log:
Modis06
Use new montage.pl for assemble step
Decrease downscale res for smaller/quicker map.png generation
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/bin/assemble.sh
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/bin/assemble.sh 2013-08-05 18:32:53 UTC (rev 6761)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/bin/assemble.sh 2013-08-05 19:41:07 UTC (rev 6762)
@@ -3,21 +3,11 @@
output=$(cd $(dirname $1); echo $PWD/$(basename $1)) # Full pathname of output file
selected=$(cd $(dirname $2); echo $PWD/$(basename $2)) # Full pathname of input text file "selected"
indir=$(cd $(dirname $3); echo $PWD/$(basename $3)) # Full pathname of image input dir
-webdir=$4
echo output=$output
echo selected=$selected
echo indir=$indir
-echo webdir=$webdir
-if [ ! -d $webdir ]; then
- mkdir -p $webdir
- if [ $? -ne 0 ]; then
- echo Unable to create $webdir, quitting
- exit 1
- fi
-fi
-
tmpdir=$( eval mktemp -d $PWD/modis.assemble.XXXX )
bindir=$(cd $(dirname $0); pwd)
graytile=$bindir/gray.rgb
@@ -47,11 +37,12 @@
# convert $tmp/t.png -bordercolor red -border 5x5 $tmpdir/$vh.png
else
# $bindir/rgb_downscale.pl $indir/$hv.color.rgb 2400 2400 8 $tmpdir/$vh.rgb
- mv $indir/$hv.color.rgb $tmpdir/$vh.rgb
+ cp $indir/$hv.color.rgb $tmpdir/$vh.rgb
fi
done
done
-montage.pl 36 18 300 300 v*
+$bindir/montage.pl 36 18 100 100 $tmpdir/v*
+$bindir/rgb_to_png.py map.rgb 3600 1800 ../map.png
exit 0
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/bin/colormodis.sh
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/bin/colormodis.sh 2013-08-05 18:32:53 UTC (rev 6761)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/bin/colormodis.sh 2013-08-05 19:41:07 UTC (rev 6762)
@@ -34,5 +34,5 @@
$BINDIR/rgb_adjust_color.pl $infile translate.txt $outfile
mv $outfile $outfile.tmp
-$BINDIR/rgb_downscale.pl $outfile.tmp 2400 2400 8 $outfile
+$BINDIR/rgb_downscale.pl $outfile.tmp 2400 2400 24 $outfile
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/bin/montage.pl
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/bin/montage.pl 2013-08-05 18:32:53 UTC (rev 6761)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/bin/montage.pl 2013-08-05 19:41:07 UTC (rev 6762)
@@ -11,7 +11,7 @@
my $xres=shift;
my $yres=shift;
-open(OUTFILE, ">output.rgb") || die "Unable to open output.rgb";
+open(OUTFILE, ">map.rgb") || die "Unable to open output.rgb";
while(@ARGV) {
Added: SwiftTutorials/ATPESC_2013-08-06/modis/modis06/apps
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis06/apps (rev 0)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis06/apps 2013-08-05 19:41:07 UTC (rev 6762)
@@ -0,0 +1,5 @@
+tukey getlanduse /projects/ATPESC2013/workflow/modis/bin/getlanduse.sh
+tukey analyzelanduse /projects/ATPESC2013/workflow/modis/bin/analyzelanduse.sh
+tukey markmap /projects/ATPESC2013/workflow/modis/bin/markmap.sh
+tukey colormodis /projects/ATPESC2013/workflow/modis/bin/colormodis.sh
+tukey assemble /projects/ATPESC2013/workflow/modis/bin/assemble.sh
Added: SwiftTutorials/ATPESC_2013-08-06/modis/modis06/clean.sh
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis06/clean.sh (rev 0)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis06/clean.sh 2013-08-05 19:41:07 UTC (rev 6762)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+rm -rf map.png logs gridmap.png colorImages selectedtiles.txt topselected.txt *.log *.rlog *.d *.kml _concurrent *.swiftx landuse
+
Property changes on: SwiftTutorials/ATPESC_2013-08-06/modis/modis06/clean.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift (rev 0)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift 2013-08-05 19:41:07 UTC (rev 6762)
@@ -0,0 +1,67 @@
+type file;
+type imagefile;
+type landuse;
+
+app (landuse output) getLandUse (imagefile input)
+{
+ getlanduse @filename(input) stdout=@filename(output);
+}
+
+app (file output, file tilelist) analyzeLandUse (landuse input[], string usetype, int maxnum)
+{
+ analyzelanduse @output @tilelist usetype maxnum @input;
+}
+
+app (imagefile grid) markMap (file tilelist)
+{
+ markmap @tilelist @grid;
+}
+
+app (imagefile output) colorModis (imagefile input)
+{
+ colormodis @input @output;
+}
+
+app (imagefile mon, file o, file e) assemble (file tiles, imagefile images[], string data_dir)
+{
+ assemble @filename(o) @filename(tiles) data_dir stdout=@filename(o) stderr=@filename(e);
+}
+
+# Constants and command line arguments
+int nFiles = @toInt(@arg("nfiles", "1000"));
+int nSelect = @toInt(@arg("nselect", "10"));
+string landType = @arg("landtype", "urban");
+string MODISdir = @arg("modisdir", "data/global");
+
+# 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);
+}
+
+# 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 <"gridmap.png">;
+gridmap = markMap(topSelected);
+
+# Create multi-color images for all tiles
+imagefile colorImage[] <structured_regexp_mapper; source=geos, match="(h..v..)", transform=@strcat("colorImages/\\1.color.rgb")>;
+
+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">;
+(montage, assemble_olog, assemble_elog) = assemble(selectedTiles, colorImage, "colorImages");
+
Added: SwiftTutorials/ATPESC_2013-08-06/modis/modis06/sites.xml
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis06/sites.xml (rev 0)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis06/sites.xml 2013-08-05 19:41:07 UTC (rev 6762)
@@ -0,0 +1,15 @@
+<config>
+ <pool handle="tukey">
+ <filesystem provider="local" />
+ <execution provider="coaster" jobmanager="local:cobalt"/>
+ <profile namespace="karajan" key="jobthrottle">5.11</profile>
+ <profile namespace="karajan" key="initialScore">10000</profile>
+ <profile namespace="globus" key="jobsPerNode">8</profile>
+ <profile namespace="globus" key="slots">1</profile>
+ <profile namespace="globus" key="maxNodes">1</profile>
+ <profile namespace="globus" key="nodeGranularity">1</profile>
+ <profile namespace="globus" key="maxTime">900</profile>
+ <profile namespace="globus" key="queue">R.ATPESC2013</profile>
+ <workdirectory>/home/{env.USER}/swiftwork</workdirectory>
+ </pool>
+</config>
More information about the Swift-commit
mailing list