areas program modified to print EDEX XML markup for satellite.mcidas decoder

Former-commit-id: ee0ee4bafa [formerly fc6cf1f4ce]
Former-commit-id: 0e6077aba0
This commit is contained in:
mjames-upc 2015-05-11 16:10:47 -06:00
parent b61e7ff4ec
commit eacf8deccf

View file

@ -20,22 +20,34 @@ dirs=$(find ${1} -type f)
#dirs=$(cat areadirs.txt)
for dir in $dirs
do
#areafile=$(find $dir -type f| tail -1)
areafile=$dir
#echo $areafile
imgtype=$(arinfo -i $areafile | sed 's/Image Type =//g' | tr -d ' ')
band=$(arinfo -b $areafile | sed 's/Band Number =//g' | tr -d ' ')
bandLog=`echo 'l('$band')/l(2)' | bc -l`
bandNum=`echo ""$bandLog"/1" |bc `
if [[ $bandNum -lt 10 ]]; then
bandNum=`expr $bandNum + 1`
fi
satID=$(arinfo -a $areafile |grep --text "Sensor source number" | cut -d":" -f2 | tr -d ' ')
areaNum=$(arinfo -a $areafile |grep --text "Area file number" | cut -d":" -f2 | tr -d ' ')
#echo "insert into mcidas_image_type (imagetype, imagetypenumber, satelliteid) values ('$imgtype',$band,$satID);"
#echo $(arinfo -i $areafile)
#echo $(arinfo -n $areafile)
#echo $(arinfo -a $areafile | grep --text "Area file number"| cut -d":" -f2| tr -d " \t\n\r")
filename=`echo $areafile | cut -d "/" -f 9`
echo $filename $(arinfo -binrs $areafile) "Sensor source number="$satID "Area num="$areaNum
#echo "insert into awips.mcidas_area_names VALUES ($arenum,'');"
filename=`echo $areafile | cut -d "/" -f 9`
binrs=$(arinfo -binrs $areafile)
name=$(arinfo -s $areafile | sed 's/Satellite Name is //'| sed 's/[ \t]*$//')
echo $filename $binrs Sensor source number=$satID Area num=$areaNum
xmlLines=$xmlLines"<entry><key ss=\"$satID\" band=\"$bandNum\"/><value name=\"$imgtype\" /></entry>"$'\n'
areaLines=$areaLines"<entry><key>$areaNum</key><value>$name</value></entry>"$'\n'
done
echo ''
echo ' ** entries for com.raytheon.uf.edex.plugin.satellite.mcidas -- physicalElements.xml'
echo ''
xmlSorted=`echo "$xmlLines" | sort | uniq`
printf "%s\n" "$xmlSorted"
echo ''
echo ' ** entries for com.raytheon.uf.edex.plugin.satellite.mcidas -- areaNames.xml'
echo ''
areaSorted=`echo "$areaLines" | sort | uniq | sed 's/GOES13 13.3/GOES-East/g' |sed 's/GOES15 13.3/GOES-West/g' |sed 's/SOUNDER/GOES-Sounder/g' |sed 's/ANTARCTICA/Antarctica/g' | sed 's/ARCTIC 11.0/Arctic/g'`
printf "%s\n" "$areaSorted"
exit 1