Next Previous Contents

9. Mapping

9.1 prepare Mapping

After the SOM run mapping is applied. Because SOMLib and GHSOM do not use the same output format apply the following script:

#!/bin/bash
# gh 2 mapping - first step
#

GHNAME=$1
NEWNAME=$2
SEDFILES=~/sedfiles

sed -f $SEDFILES/wgt.sed $GHNAME.wgt >$NEWNAME.wgt
sed -f $SEDFILES/unit.sed $GHNAME.unit >$NEWNAME.unit.node
sed -f $SEDFILES/descr.sed $GHNAME.mapdescr >$NEWNAME.mapdescr.map
echo now edit mapdescriptionfile

With following three sed scripts:

descr.sed

s/TOPOLOGY/TYPE/g
s/NODE/UNIT/g
s/NEIGHBOURHOOD/NEIGHBORHOOD/g
s/node/unit/g
s/\$GHSOM/#\$GHSOM/g

unit.sed

s/TOPOLOGY/TYPE/g
s/POSX/POS_X/g
s/POSY/POS_Y/g
s/NODE_ID/UNIT_ID/g
s/\$QUANTERROR/#\$QUANTERROR/g
s/\$NR_SOMS_MA/#\$NR_SOMS_MA/g
s/\$NR_VEC_/#\$NR_VEC_/g
s/\$MAPPED_VECS/#\$MAPPED_VECS/g

wgt.sed

s/TOPOLOGY/TYPE/g

9.2 Mapping

After adjusting the mapdescription-file mapping can be made by using SOMLib.

#!/bin/bash
# does a mapping
#
SOMLIBDIR=/SOM/somlib
NAME=$1
LOGFILE=./$NAME.map.log
VERBOSITY=2

ln -s $SOMLIBDIR somlib

java -Xmx10000m somlib.som.Mapping -m $NAME.mapdescr -i ./$NAME.vector -p som/$NAME.err -n som/$NAME.mapping -v $VERBOSITY >>$LOGFILE  2>>$LOGFILE

rm somlib

There are two special (undocumented) programs which one can use to generate spreadsheets out of a mappingfile: SJBchart, SJBsheet


Next Previous Contents