Batch Normalized Cross-Correlation
By TC
Description
The purpose of the batch NCC is to be able to see what areas of the topography are strongest and weakest. In general, this will be performed on the the high resolution maplets that make up the topography in question, but this process will work for any given list of maplets. Following this guide will run mpXcorr.py for each maplet specified in your input list, as well as provide several useful statistics and plots for analysis.
Batch NCC
It is very simple to write a bash script to iteratively run mpXcorr.py (or imXcorr.py for that matter), but batchCorrelation.sh was written specifically for this purpose and handles everything from the PGM image generation, to being able to run this in a directory where you may not have write permissions.
Running:
sh batchCorrelation.sh -h
Will print out the usage header giving brief instructions to remind you of the syntax.
# USAGE: sh batchCorrelation.sh [-option] outpath mapfile(s) truthmap # -o Use this followed by 'outpath' to # specify a unique output destination. # By default the output is sent to the # current working directory. # # -h Use this to print usage directions # to StdOut. (Prints this header) # # -v Use this to only output current # version number and exit. By default # the version will be sent to StdOut # at the beginning of each use. # ########################################################################
A typical invocation of this script is as follows:
sh batchCorrelation.sh /path/to/maplist /path/to/truthmap
This script can be used to run on a single mapfile as well if you would like, simply run the script as above but replace "maplist" with the mapfile full name (including .MAP).
If you do not have write permissions in the directory you wish to run this script, it can be run as:
sh batchCorrelation.sh -o /path/to/output/directory /path/to/maplist /path/to/truthmap
If you do not specify any command line arguments, you will be prompted for the requisite files.
Input single mapfile path/name or list of maplets.
Then,
Input path/name of truth map.
Provided you did everything correctly, there should be a new directory named COROUT and a file named locations.txt wherever the specified output is (either the working directory, or that specified by "-o"). This is all well and good, but there is another python script to help you make sense of your results.
Use transStats.py on the output file from the above script (locations.txt) to get some statistics from the batch NCC. For a more detailed description of this python script, see Translation Statistics.
python transStats.py locations.txt > transOut.txt
Visualizing Output
The output from the batch correlation script (locations.txt) can be plotted very easily in Gnuplot.
gnuplot set term x11 unset key set yrange [*:*] reverse set cbrange [0.2:1] plot 'locations.txt' u 2:3:4:5 w vectors plot 'locations.txt' u 2:3:6 pal pt 5 ps 3