Support script. The current script is maintained in ~/Dropbox/Dawn-shape/scripts-limited-copy.

This will do the things needed to get a specific tiling sequence ready to be run. It figures out which landmarks and maplets are needed, copies them into the working directory, builds the and does a make_script.e

Generated by

Used by


# Dec 11st, 2011 - Eric E. Palmer
# Version 1.2
# This sets up a run, copying over only the files that are needed.
# You must change which to match the bigmap you are using
# If you want a different set of locations, then you need to change the
#        right, left, top, bottom

# Usage:  You start the script in the directory that you are going to do work in
# It requires a virtual directory that is basically just sybmolic links to 
#     the Dropbox/Dawn-Shape/Vesta (or work_generic) directory.  However, it
#     will generate files that get copied into the working directory

# Working Directory
#     The working directory has symbolic links to needed files (established by
#        using  All other needed files are copied by this 
#        script

# Master Directory
#     This has a full set of files needed so we can generate bigmaps and a 
#     place to copy things from.  It is created by using and then

dropPath=~/Dropbox/Dawn-shape          # path to dropbox - 
localMain=/Volumes/Media/run-master    # path to master directory

# Ensure bigmap is given as a commandline argument
   if [ -z $1 ]; then
      echo "Usage: <bigmap_name>";
      echo "Example: ZS0216";

# Set variables
   which=$1    # first argument is set to which bigmap we are doing to do
   left=50     # Makescript left boundaries
   right=950   # Makescript right boundaries
   top=200     # Makescript top boundaries
   bottom=800  # Makescript bottom boundaries

   date > current.log

   echo "--We are building $which from $left to $right, and $top to $bottom"
   echo "--We are building $which from $left to $right, and $top to $bottom" >> current.log

# Setup some links and files that are needed in the local directory
   $dropPath/work_generic/ >> current.log
   if [ ! -e 'SUMFILES' ]; then ln -s $localMain/SUMFILES SUMFILES; fi

#### Local
   # clean up old
   #     An error with the rm is not a problem, it just means 
   #        nothing has been done previously
   echo "--Cleaning up previous in $currPath"
   echo "--Cleaning up previous in $currPath" >> current.log

   # rather than deleting all the old run logfiles, keep it for one more run
   if [ -e '001.INN' ]; then
      list=`ls *INN *OOT`;
      for i in $list
         echo $i;
         mv $i old/;
   if [ -e 'LMRKLIST.TXT' ]; then mv LMRKLIST.TXT old/; fi # SPECIAL NEEDS

   sh rem_script.b      # std
   rm -f TESTFILES/*       # std
   rm -f TESTFILES1/*      # std

   if [ -e 'NEW_FILES/LMKFILES' ]; then rmdir NEW_FILES/LMKFILES ; fi
   if [ -e 'NEW_FILES/MAPFILES' ]; then rmdir NEW_FILES/MAPFILES ; fi
   rm -f LMKFILES/*
   if [ -e 'LMKFILES' ]; then rmdir LMKFILES ; fi
   rm -f MAPFILES/*
   if [ -e 'MAPFILES' ]; then rmdir MAPFILES ; fi

   if [ -e 'LMKRLIST1.TXT' ]; then  # test for a big mistake
      echo "#### LMRKLIST1.TXT was found.  You need to delete it by hand";
      echo "#### Be sure that sh EXPORT.TXT has been run"

#### Master
   # Deal with run-master directory
   cd $localMain
   echo "--Running in $localMain"
   echo "--Running in $localMain" >> current.log
   ./ >> current.log

   echo "--Cleaning up previous in $localMain" >> current.log
   echo "--Cleaning up previous in $localMain" 

   # Get ready for new
   # Figure out landmarks that fall in overlap
   echo "--Running bigmap on $str"
   echo "--Running bigmap on $str" >> current.log
   ~/bin/bigmap < $str >> current.log

   # Cheat the system so that export.e thinks the overlap files are the
   #     finished product of a run that need to be exported

   # Build the export script and execute it (makes a tar ball of needed files)
   echo "--Exporting" >> current.log
   echo "--Exporting" 

   # Copy files to working directory
   echo "--move/extract NEW_FILES.tar at $currPath"
   echo "--move/extract NEW_FILES.tar at $currPath" >> current.log
   mv NEW_FILES.tar $currPath
   cd $currPath
   tar xf NEW_FILES.tar
   mv NEW_FILES/* .
   cp $localMain/MAPFILES/$which.MAP MAPFILES/ # This must be done after the tar and mv

   if [ ! -e 'TESTFILES' ]; then mkdir TESTFILES; fi
   if [ ! -e 'TESTFILES1' ]; then mkdir TESTFILES1; fi
   if [ ! -e 'NEWFILES' ]; then mkdir NEWFILES; fi
   if [ ! -e 'NEWFILES/LMKFILES' ]; then mkdir NEWFILES/LMKFILES; fi
   if [ ! -e 'NEWFILES/MAPFILES' ]; then mkdir NEWFILES/MAPFILES; fi

   echo "--Building" >> current.log
   echo "--Building" 

   # Backup the old, just in case
   if [ -e '' ]; then mv old/ ; fi

   # Set headers
   echo "& cp MAPFILES/$which.MAP MAPFILES/XXXXXX.MAP" >
   echo "XXXXXX" >>
   echo "XXX050.SEED" >>

   # Loop to build the locations of the landmarks
   while [ $x -le $right ]; do
      while [ $y -le $bottom ]; do
         echo "$x,   $y" >>
         let y=y+50
      let x=x+50

   echo "END" >>

   # Build the script and prepare it to be run
   chmod a+x run_script.b

   echo ""
   echo "Now you can run it by using:"
   echo "./run_script.b &"
   echo ""

   # All done
   echo "Done with" >> current.log
   date >> current.log