#-----------------------------------------------------------------------
# Make VOLUME images first -- Can comment when finished so
# this script can be easily rerun if needed.
#-----------------------------------------------------------------------
#cd /n/diraid02/data/lien/dihvnv_rawenc/
#mkdir VOLUME
#mkdir VOLUME/dihvnv_2001
#cd VOLUME/dihvnv_2001
#ln -s ../../aareadme.txt aareadme.txt
#ln -s ../../voldesc.cat voldesc.cat
#ln -s ../../catalog catalog
#ln -s ../../data data
#ln -s ../../document document
#ln -s ../../index index

#-----------------------------------------------------------------------
#  Make MD5 checksums for this volume
#-----------------------------------------------------------------------
cd /n/diraid02/data/lien/dihvnv_rawenc/
mkpdssum -f -l -x CODE -x dataset.html -x DOWNLOAD -x NOTES -x VOLUME
ls -l index/

#-----------------------------------------------------------------------
#  Make DOWNLOAD files for these but first temporarily rename 
#  the top-level directory to the volume ID to make "nice"
#  download files.
#-----------------------------------------------------------------------
cd /n/diraid02/data/lien/dihvnv_rawenc/DOWNLOAD
rm dihvnv_2001.zip dihvnv_2001.iso MD5SUM
cd /n/diraid02/data/lien/
mv dihvnv_rawenc dihvnv_2001
zip -r dihvnv_2001/DOWNLOAD/dihvnv_2001.zip \
       dihvnv_2001/aareadme.txt \
       dihvnv_2001/catalog \
       dihvnv_2001/document \
       dihvnv_2001/index \
       dihvnv_2001/voldesc.cat
##tar -cvf dihvnv_2001/DOWNLOAD/dihvnv_2001_data.tar dihvnv_2001/data
mv dihvnv_2001 dihvnv_rawenc 

#-----------------------------------------------------------------------
#  Make VOLUME/ and an ISO image of it
#-----------------------------------------------------------------------
cd /n/diraid02/data/lien/dihvnv_rawenc/VOLUME
mkisofs -iso-level 2 \
        -follow-links \
        -publisher "PDS Small Bodies Node, Comet Subnode" \
        -volset "DEEP IMPACT ENCOUNTER RAW HRIV NAV IMAGES" \
        -V "DIHVNV_2001" \
        -o /n/diraid02/data/lien/dihvnv_rawenc/DOWNLOAD/dihvnv_2001.iso \
        dihvnv_2001

#-----------------------------------------------------------------------
# Make checksum.md5 for all files in DOWNLOAD/, and rename the
# top-level directory
#-----------------------------------------------------------------------
cd /n/diraid02/data/lien/dihvnv_rawenc/DOWNLOAD
mkpdssum -p -x checksum .
mv checksum.tab MD5SUM
cd /n/diraid02/data/lien/