# Splits /dimv9p_enc/data/radrev/2005/179 into smaller subdirectories 
# of about 450-500 MB each.
#
# 2006-10-12, sam:  Ran this script in the /n/diraid02/data/lien/data/ 
# area which has not been touched since the data were copied to 
# /n/pdsraid01/archive/, then moved the tars to /n/pdsraid01/archive/.
#

cd /n/diraid02/data/lien/dimv9p_enc/data/radrev/2005/

mkdir 179a
mkdir 179b
mkdir 179c


# Use the exposure ID in the file names to move data from
# the daily directory to the 'part' directories

mv 179/*_80001*   179a/
mv 179/*_80002*   179a/
mv 179/*_810000*  179a/
mv 179/*_810001*  179a/

mv 179/*_810002* 179b/
mv 179/*_810003* 179b/
mv 179/*_810004* 179b/
mv 179/*_810005* 179b/
mv 179/*_810006* 179b/
mv 179/*_810007* 179b/
mv 179/*_810008* 179b/

mv 179/*_810009* 179c/
mv 179/*_81001*  179c/
mv 179/*_81001*  179c/

# Make sure 179 directory is empty

find 179/

cd /n/diraid02/data/lien/dimv9p_enc/

tar cvf DOWNLOAD/2005179a.tar data/radrev/2005/179a
tar cvf DOWNLOAD/2005179b.tar data/radrev/2005/179b

mv DOWNLOAD/2005179a.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/
mv DOWNLOAD/2005179b.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/

# Move data back from 'part' directories back to the original DOY directory

cd /n/diraid02/data/lien/dimv9p_enc/data/radrev/2005/

mv 179a/* 179/
mv 179b/* 179/