[Swift-commit] r6777 - in SwiftTutorials/ATPESC_2013-08-06/modis: bin modis01 modis02 modis03 modis04 modis05 modis06
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Mon Aug 5 17:47:27 CDT 2013
Author: davidk
Date: 2013-08-05 17:47:27 -0500 (Mon, 05 Aug 2013)
New Revision: 6777
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/modis01/modis01.swift
SwiftTutorials/ATPESC_2013-08-06/modis/modis02/modis02.swift
SwiftTutorials/ATPESC_2013-08-06/modis/modis03/modis03.swift
SwiftTutorials/ATPESC_2013-08-06/modis/modis04/modis04.swift
SwiftTutorials/ATPESC_2013-08-06/modis/modis05/modis05.swift
SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift
Log:
Use a subset of data rather than all global data
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/bin/assemble.sh
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/bin/assemble.sh 2013-08-05 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/bin/assemble.sh 2013-08-05 22:47:27 UTC (rev 6777)
@@ -1,48 +1,25 @@
-#!/bin/bash
+#!/bin/bash -x
-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
-
-echo output=$output
-echo selected=$selected
-echo indir=$indir
-
+output=shift
+output=$(cd $(dirname $output); echo $PWD/$(basename $output)) # Full pathname of output file
tmpdir=$( eval mktemp -d $PWD/modis.assemble.XXXX )
bindir=$(cd $(dirname $0); pwd)
-graytile=$bindir/gray.rgb
# input files are expected to start with hNNvNN.
# we reverse this to form the final image
-cd $indir
-
-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}
- vh=v${v}h${h}
-
- # Use graytile if the expected section is not found
- if [ ! -f $indir/$hv.color.rgb ]; then
- echo $indir/$hv.color.rgb does not exist
- cp $graytile $tmpdir
- mv $tmpdir/gray.rgb $tmpdir/$vh.rgb
-
- # Otherwise, downscale input images
- #elif grep $hv $selected >&/dev/null; then
- # convert $hv.png -resize 290x290 $tmpdir/t.png
- # 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
- cp $indir/$hv.color.rgb $tmpdir/$vh.rgb
- fi
- done
+while [ $# -gt 0 ]
+do
+ file=$1
+ shift
+ h=$( basename $file | cut -c2-3 )
+ v=$( basename $file | cut -c5-6 )
+ vh=v"$v"h"$h"
+ cp $file $tmpdir/$vh.rgb
done
-$bindir/montage.pl 36 18 100 100 $tmpdir/v*
-$bindir/rgb_to_png.py map.rgb 3600 1800 ../map.png
+cd $tmpdir
+$bindir/montage.pl 5 5 200 200 v*
+$bindir/rgb_to_png.py map.rgb 1000 1000 ../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 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/bin/colormodis.sh 2013-08-05 22:47:27 UTC (rev 6777)
@@ -7,7 +7,7 @@
infile=$1
outfile=$2
-scale=${3-24}
+scale=${3-12}
xres=${4-2400}
yres=${5-2400}
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/modis01/modis01.swift
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis01/modis01.swift 2013-08-05 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis01/modis01.swift 2013-08-05 22:47:27 UTC (rev 6777)
@@ -6,6 +6,6 @@
getlanduse @filename(input) stdout=@filename(output);
}
-imagefile modisImage <"data/global/h00v09.rgb">;
-landuse result <"landuse/h00v09.landuse.byfreq">;
+imagefile modisImage <"data/europe/h18v05.rgb">;
+landuse result <"landuse/h18v05.landuse.byfreq">;
result = getLandUse(modisImage);
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/modis02/modis02.swift
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis02/modis02.swift 2013-08-05 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis02/modis02.swift 2013-08-05 22:47:27 UTC (rev 6777)
@@ -8,7 +8,7 @@
# Constants and command line arguments
int nFiles = @toInt(@arg("nfiles", "1000"));
-string MODISdir = @arg("modisdir", "data/global");
+string MODISdir = @arg("modisdir", "data/europe");
# Input Dataset
imagefile geos[] <ext; exec="../bin/modis.mapper", location=MODISdir, suffix=".rgb", n=nFiles>;
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/modis03/modis03.swift
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis03/modis03.swift 2013-08-05 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis03/modis03.swift 2013-08-05 22:47:27 UTC (rev 6777)
@@ -16,7 +16,7 @@
int nFiles = @toInt(@arg("nfiles", "1000"));
int nSelect = @toInt(@arg("nselect", "10"));
string landType = @arg("landtype", "urban");
-string MODISdir = @arg("modisdir", "data/global");
+string MODISdir = @arg("modisdir", "data/europe");
# Input Dataset
imagefile geos[] <ext; exec="../bin/modis.mapper", location=MODISdir, suffix=".rgb", n=nFiles>;
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/modis04/modis04.swift
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis04/modis04.swift 2013-08-05 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis04/modis04.swift 2013-08-05 22:47:27 UTC (rev 6777)
@@ -21,7 +21,7 @@
int nFiles = @toInt(@arg("nfiles", "1000"));
int nSelect = @toInt(@arg("nselect", "10"));
string landType = @arg("landtype", "urban");
-string MODISdir = @arg("modisdir", "data/global");
+string MODISdir = @arg("modisdir", "data/europe");
# Input Dataset
imagefile geos[] <ext; exec="../bin/modis.mapper", location=MODISdir, suffix=".rgb", n=nFiles>;
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/modis05/modis05.swift
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis05/modis05.swift 2013-08-05 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis05/modis05.swift 2013-08-05 22:47:27 UTC (rev 6777)
@@ -26,7 +26,7 @@
int nFiles = @toInt(@arg("nfiles", "1000"));
int nSelect = @toInt(@arg("nselect", "10"));
string landType = @arg("landtype", "urban");
-string MODISdir = @arg("modisdir", "data/global");
+string MODISdir = @arg("modisdir", "data/europe");
# Input Dataset
imagefile geos[] <ext; exec="../bin/modis.mapper", location=MODISdir, suffix=".rgb", n=nFiles>;
Modified: SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift 2013-08-05 22:26:00 UTC (rev 6776)
+++ SwiftTutorials/ATPESC_2013-08-06/modis/modis06/modis06.swift 2013-08-05 22:47:27 UTC (rev 6777)
@@ -22,16 +22,16 @@
colormodis @input @output;
}
-app (imagefile mon, file o, file e) assemble (file tiles, imagefile images[], string data_dir)
+app (imagefile mon) assemble (imagefile images[])
{
- assemble @filename(o) @filename(tiles) data_dir stdout=@filename(o) stderr=@filename(e);
+ assemble @filename(mon) @filenames(images);
}
# 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");
+string MODISdir = @arg("modisdir", "data/europe");
# Input Dataset
imagefile geos[] <ext; exec="../bin/modis.mapper", location=MODISdir, suffix=".rgb", n=nFiles>;
@@ -61,7 +61,5 @@
# 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");
+montage = assemble(colorImage);
More information about the Swift-commit
mailing list