Strabon
changeset 468:2e3c729225e5
fixed hardcoded values for satellite and sensor. Now these values are taken from the hotspot filename to be processed.
author | Babis Nikolaou <charnik@di.uoa.gr> |
---|---|
date | Thu Jul 19 20:55:17 2012 +0300 (2012-07-19) |
parents | 88b4d2c21fb0 |
children | 920ebd41a1a3 |
files | scripts/v2.2/runNoaRefinementChain.sh |
line diff
1.1 --- a/scripts/v2.2/runNoaRefinementChain.sh Thu Jul 19 20:33:14 2012 +0300 1.2 +++ b/scripts/v2.2/runNoaRefinementChain.sh Thu Jul 19 20:55:17 2012 +0300 1.3 @@ -3,28 +3,11 @@ 1.4 1.5 ENDPOINT="http://localhost:8080/endpoint" 1.6 DB="endpoint" 1.7 -#GRIDURL="http://kk.di.uoa.gr/grid_4.nt" 1.8 -GRIDURL="http://jose.di.uoa.gr/rdf/coastline/grid_4.nt" 1.9 -#INIT="http://jose.di.uoa.gr/rdf/Kallikratis-Coastline.ntriples" 1.10 -INIT="../Kalli_coast.sql" 1.11 - 1.12 -#CHECKDIR="/home/konstantina/allhot/" 1.13 -#CHECKDIR="${HOME}/teleios/nkua/Hotspots/" 1.14 - 1.15 -POSTGISTEMPLATE="postgistemplate" 1.16 -#POSTGISTEMPLATE="template_postgis" 1.17 - 1.18 -#dataDir="http://localhost/noa-teleios/out_triples/" 1.19 -#dataDir="http://kk.di.uoa.gr/out_triples/" 1.20 -#dataDir="http://godel.di.uoa.gr/allhot/" 1.21 -dataDir="http://jose.di.uoa.gr/rdf/hotspots/20" 1.22 1.23 #HOTSPOTS_URL="http://jose.di.uoa.gr/rdf/hotspots" 1.24 HOTSPOTS_URL="http://jose.di.uoa.gr/rdf/hotspots/msg1" 1.25 1.26 logFile="chain.log" 1.27 -#countWTime="/usr/bin/time -p %e" 1.28 -#echo > ${logFile} 1.29 1.30 function timer() 1.31 { 1.32 @@ -64,7 +47,7 @@ 1.33 elif test -s /etc/lsb-release ; then # Ubuntu 1.34 tomcat=$(ls -1 /etc/init.d/| grep tomcat | head -1) 1.35 elif test -s /etc/debian_version ; then 1.36 - tomcat="tomcat" 1.37 + tomcat="tomcat" 1.38 fi 1.39 1.40 # check for service availability 1.41 @@ -110,40 +93,55 @@ 1.42 if test -z "${tomcat}"; then 1.43 # work-around for babis (standalone tomcat, with start_tomcat.sh and stop_tomcat.sh scripts) 1.44 start_tomcat.sh 1.45 + sleep 2 1.46 else 1.47 sudo service ${tomcat} start 1.48 fi 1.49 1.50 echo "initializing database" 1.51 -echo "S M D IF R TP" >stderr.txt 1.52 +echo "Timestamp Store Municipalities DeleteInSea InvalidForFires RefineInCoast TimePersistence" > stderr.txt 1.53 1.54 1.55 #./scripts/endpoint query ${ENDPOINT} "SELECT (COUNT(*) AS ?C) WHERE {?s ?p ?o}" 1.56 #sudo -u postgres psql -d endpoint -c 'CREATE INDEX datetime_values_idx_value ON datetime_values USING btree(value)'; 1.57 #sudo -u postgres psql -d endpoint -c 'VACUUM ANALYZE;'; 1.58 1.59 -#echo "Continue?" 1.60 -#read a 1.61 - 1.62 #for y in 2007 2008 2010 2011 ;do 1.63 -for y in 2012 ;do 1.64 +for y in 2012; do 1.65 # get hotpost URLS 1.66 for hot in $(curl -s ${HOTSPOTS_URL}/${y}/ | grep -o '>HMSG.*\.nt' | colrm 1 1); do 1.67 file="${HOTSPOTS_URL}/${y}/${hot}" 1.68 1.69 time_status=$(echo ${hot} | egrep -o '[[:digit:]]{6}_[[:digit:]]{4}') 1.70 + 1.71 + # get sensor 1.72 + SENSOR=$(echo ${hot} | grep -o 'MSG.') 1.73 1.74 - # get time information for acquisition 1.75 + # get satellite 1.76 + if test "${SENSOR}" = "MSG2"; then 1.77 + SAT="METEOSAT9" 1.78 + else 1.79 + SAT="METEOSAT8" 1.80 + SENSOR="MSG1_RSS" 1.81 + fi 1.82 + 1.83 + # get time information for acquisition and construct timestamp 1.84 year="20$(expr substr ${time_status} 1 2)" 1.85 month=$(expr substr ${time_status} 3 2) 1.86 day=$(expr substr ${time_status} 5 2) 1.87 time2=$(expr substr ${time_status} 8 2) 1.88 time2="${time2}:$(expr substr ${time_status} 10 2)" 1.89 1.90 + # construct timestamp 1.91 + TIMESTAMP="${year}-${month}-${day}T${time2}:00" 1.92 + 1.93 # store file 1.94 echo -n "storing " $file; echo; echo; 1.95 # ${countTime} ./strabon -db endpoint store $file 1.96 1.97 + # print timestamp 1.98 + echo -n "${TIMESTAMP} " >> stderr.txt 1.99 + 1.100 tmr1=$(timer) 1.101 ../endpoint store ${ENDPOINT} N-Triples -u ${file} 1.102 tmr2=$(timer) 1.103 @@ -162,19 +160,19 @@ 1.104 1.105 query=`echo "${insertMunicipalities}" | sed "s/TIMESTAMP/${year}-${month}-${day}T${time2}:00/g" | \ 1.106 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 1.107 - sed "s/SENSOR/MSG2/g"` 1.108 + sed "s/SENSOR/${SENSOR}/g"` 1.109 1.110 ../endpoint update ${ENDPOINT} "${query}" 1.111 1.112 tmr2=$(timer) 1.113 -printf '%s ' $((tmr2-tmr1)) >>stderr.txt 1.114 + printf '%s ' $((tmr2-tmr1)) >>stderr.txt 1.115 echo;echo;echo;echo "File ${file} inserted Municipalities!" 1.116 1.117 # deleteSeaHotspots 1.118 echo -n "Going to deleteSeaHotspots ${year}-${month}-${day}T${time2}:00 " ;echo; echo; echo; 1.119 query=`echo "${deleteSeaHotspots}" | sed "s/TIMESTAMP/${year}-${month}-${day}T${time2}:00/g" | \ 1.120 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 1.121 - sed "s/SENSOR/MSG2/g"` 1.122 + sed "s/SENSOR/${SENSOR}/g"` 1.123 # ${countTime} ./strabon -db endpoint update "${query}" 1.124 1.125 tmr1=$(timer) 1.126 @@ -190,8 +188,8 @@ 1.127 echo -n "invalidForFires ${year}-${month}-${day}T${time2}:00 " ; echo; echo ; echo; 1.128 query=`echo "${invalidForFires}" | sed "s/TIMESTAMP/${year}-${month}-${day}T${time2}:00/g" | \ 1.129 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 1.130 - sed "s/SENSOR/MSG2/g" |\ 1.131 - sed "s/SAT/METEOSAT9/g"` 1.132 + sed "s/SENSOR/${SENSOR}/g" |\ 1.133 + sed "s/SAT/${SAT}/g"` 1.134 # ${countTime} ./strabon -db endpoint update "${query}" 1.135 tmr1=$(timer) 1.136 ../endpoint update ${ENDPOINT} "${query}" 1.137 @@ -203,8 +201,8 @@ 1.138 echo -n "refinePartialSeaHotspots ${year}-${month}-${day}T${time2}:00 " ; echo; echo ; echo; 1.139 query=`echo "${refinePartialSeaHotspots}" | sed "s/TIMESTAMP/${year}-${month}-${day}T${time2}:00/g" | \ 1.140 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 1.141 - sed "s/SENSOR/MSG2/g" |\ 1.142 - sed "s/SAT/METEOSAT9/g"` 1.143 + sed "s/SENSOR/${SENSOR}/g" |\ 1.144 + sed "s/SAT/${SAT}/g"` 1.145 # ${countTime} ./strabon -db endpoint update "${query}" 1.146 tmr1=$(timer) 1.147 ../endpoint update ${ENDPOINT} "${query}" 1.148 @@ -220,10 +218,10 @@ 1.149 min_acquisition_time=`date --date="${year}-${month}-${day} ${time2}:00 EEST -30 minutes" +%Y-%m-%dT%H:%m:00` 1.150 query=`echo "${refineTimePersistence}" | sed "s/TIMESTAMP/${year}-${month}-${day}T${time2}:00/g" | \ 1.151 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 1.152 - sed "s/SENSOR/MSG2/g" | \ 1.153 + sed "s/SENSOR/${SENSOR}/g" | \ 1.154 sed "s/ACQUISITIONS_IN_HALF_AN_HOUR/3.0/g" | \ 1.155 sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g" |\ 1.156 - sed "s/SAT/METEOSAT9/g"` 1.157 + sed "s/SAT/${SAT}/g"` 1.158 1.159 #sudo -u postgres psql -d ${DB} -c 'VACUUM ANALYZE;'; 1.160 1.161 @@ -242,7 +240,7 @@ 1.162 max_acquisition_time=`date --date="${year}-${month}-${day} 23:59 EEST" +%Y-%m-%dT%H:%m:00` 1.163 query=`echo "${discover}" | \ 1.164 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 1.165 - sed "s/SENSOR/MSG2/g" | \ 1.166 + sed "s/SENSOR/${SENSOR}/g" | \ 1.167 sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g" |\ 1.168 sed "s/MAX_ACQUISITION_TIME/${max_acquisition_time}/g"` 1.169