From fbda5ad0ae888b9c0e6d6d98360b71a3c23099b6 Mon Sep 17 00:00:00 2001
From: PStar User Account <pstar@192.168.122.1>
Date: Mon, 17 Feb 2020 02:57:05 +0000
Subject: [PATCH] allow calibrations to be passed through uhdas_03 to
 quick_adcp.py

 Committer: PStar User Account <pstar@192.168.122.1>

 On branch dy113
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

	modified:   cruisedir_setup_scripts/conf_script_dy113
	modified:   ctd_linkscript
	modified:   lad_linkscript_ix
	modified:   mexec_cruise_backup
	modified:   modsal_unix
	modified:   uhdas_00_linkmerge
	modified:   uhdas_01_syncraw
	modified:   uhdas_02_sync_postprocessing_from_raw
	modified:   uhdas_03_copy_asclog_for_editing
---
 cruisedir_setup_scripts/conf_script_dy113 |  1 +
 ctd_linkscript                            | 50 ++++++++++++-----------
 lad_linkscript_ix                         | 39 ++++++++++++++----
 mexec_cruise_backup                       |  4 +-
 modsal_unix                               | 10 +----
 uhdas_00_linkmerge                        |  2 +-
 uhdas_01_syncraw                          |  6 +--
 uhdas_02_sync_postprocessing_from_raw     |  5 ++-
 uhdas_03_copy_asclog_for_editing          | 10 ++++-
 9 files changed, 77 insertions(+), 50 deletions(-)

diff --git a/cruisedir_setup_scripts/conf_script_dy113 b/cruisedir_setup_scripts/conf_script_dy113
index a13ab40..ea8d1c0 100755
--- a/cruisedir_setup_scripts/conf_script_dy113
+++ b/cruisedir_setup_scripts/conf_script_dy113
@@ -71,4 +71,5 @@ mkdir netcdf_files_rawdir_local
 mkdir techsas_link_logs
 cd ..
 ln -s /local/users/pstar/mounts/public public
+mkdir other_backups
 #other directories (for processed underway data) are generated by running m_setup
diff --git a/ctd_linkscript b/ctd_linkscript
index 34beede..ecb37d0 100755
--- a/ctd_linkscript
+++ b/ctd_linkscript
@@ -3,40 +3,41 @@
 #copy the raw and SBE-processed CTD files from the ship machine
 #then make links to the files to be ingested by mexec using the expected name format
 
-cd /local/users/pstar/cruise/data #mexecloc is replaced with $mexecloc by conf_script_cruise
+cd /local/users/pstar/cruise/data
 
-set cpre = DY113
+set cpre = DY113_CTD
 set cruise = dy113
 set ctdloc = /mnt/CTD/CTD/Data/
 
-rsync -av ${ctdloc}/CTDProData/*.cnv ctd/ASCII_FILES/
-rsync -av ${ctdloc}/CTDRawData/*.bl ctd/ASCII_FILES/
-rsync -av ${ctdloc}/CTDProData/*.ros ctd/ASCII_FILES/
-rsync -av ${ctdloc}/CTDRawData/*.hex ctd/RAW_CTD_FILES/
-rsync -av ${ctdloc}/CTDRawData/*.XMLCON ctd/RAW_CTD_FILES/
-rsync -av ${ctdloc}/CTDRawData/*.hdr ctd/RAW_CTD_FILES/
-rsync -av ${ctdloc}/CTDProData/*.btl ctd/ASCII_FILES/
+rsync -auv ${ctdloc}/CTD_Pro_Data/*.cnv ctd/ASCII_FILES/
+rsync -auv ${ctdloc}/CTD_Raw_Data/*.bl ctd/ASCII_FILES/
+rsync -auv ${ctdloc}/CTD_Pro_Data/*.ros ctd/ASCII_FILES/
+rsync -auv ${ctdloc}/CTD_Raw_Data/*.hex ctd/RAW_CTD_FILES/
+rsync -auv ${ctdloc}/CTD_Raw_Data/*.XMLCON ctd/RAW_CTD_FILES/
+rsync -auv ${ctdloc}/CTD_Raw_Data/*.hdr ctd/RAW_CTD_FILES/
+rsync -auv ${ctdloc}/CTD_Pro_Data/*.btl ctd/ASCII_FILES/
+rsync -auv ${ctdloc}/SBE35/*.asc ctd/ASCII_FILES/SBE35/
 
 cd ctd/ASCII_FILES
-foreach i (`ls ${cpre}_???_align_ctm.cnv`)
+foreach i (`ls ${cpre}???_align_ctm.cnv`)
    set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,"_align")-3,3)}'`
-   set linkfile = ctd_${cpre}_${num}_align_ctm.cnv
+   set linkfile = ctd_${cruise}_${num}_align_ctm.cnv
    if (! -e $linkfile) then
       echo Making link $linkfile for raw file $i
       ln -s $i $linkfile
    endif
 end
 #below could be commented out if T spikes aren't a problem
-#foreach i (`ls ${cpre}_???_align.cnv`)
+#foreach i (`ls ${cpre}???_align.cnv`)
 #   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,"_align")-3,3)}'`
-#   set linkfile = ctd_${cpre}_${num}_align_noctm.cnv
+#   set linkfile = ctd_${cruise}_${num}_align_noctm.cnv
 #   if (! -e $linkfile) then
 #      echo Making link $linkfile for raw file
 #      ln -s $i $linkfile
 #   endif
 #end
 
-foreach i (`ls ${cpre}_???.bl`)
+foreach i (`ls ${cpre}???.bl`)
    set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".bl")-3,3)}'`
    set linkfile = ctd_${cruise}_${num}.bl
    if (! -e $linkfile) then
@@ -45,15 +46,16 @@ foreach i (`ls ${cpre}_???.bl`)
    endif
 end
 
-#compress files we probably won't need to use
-foreach i (`ls ${cpre}_???_align.cnv`)
-   gzip -f $i
-end
-foreach i (`ls ${cpre}_???.cnv`)
-   gzip -f $i
-end
-
-cd ../RAW_CTD_FILES
-gzip -f *.hex
+##compress files we probably won't need to use
+##or don't because then it will sync them again
+#foreach i (`ls ${cpre}???_align.cnv`)
+#   gzip -f $i
+#end
+#foreach i (`ls ${cpre}???.cnv`)
+#   gzip -f $i
+#end
+#
+#cd ../RAW_CTD_FILES
+#gzip -f *.hex
 
 cd ../..
diff --git a/lad_linkscript_ix b/lad_linkscript_ix
index 0753aae..2d94214 100755
--- a/lad_linkscript_ix
+++ b/lad_linkscript_ix
@@ -4,22 +4,43 @@
 
 cd /local/users/pstar/cruise/data/ladcp/rawdata
 
-rsync -av /mnt/data/jcr/current/ladcp/* . 
+cd DL
+rsync -av /mnt/CTD/LADCP/DY113/Data/Master/*.* .
+cd ../UL
+rsync -av /mnt/CTD/LADCP/DY113/Data/Slave/*.* .
 
 #make links for IX
-foreach i (`ls JR18002_*.000`)
-   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".000")-3,3)}'`
+cd /local/users/pstar/cruise/data/ladcp/rawdata/DL
+foreach i (`ls DY113_CTD*M.000`)
+   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".000")-4,3)}'`
    set linkfile = ${num}DL000.000
-   if(! -e ../ix/raw/$num) then
+   cd /local/users/pstar/cruise/data/ladcp/ix/raw
+   if(! -e $num) then
       echo Making directory $num for raw file $i
-      mkdir -p ../ix/raw/$num
+      mkdir -p $num
    endif
-   cd ../ix/raw/$num
+   cd $num
    if (! -e $linkfile) then
       echo Making link $linkfile for raw file $i
-      ln -s ../../../rawdata/$i $linkfile
+      ln -s ../../../rawdata/DL/$i $linkfile
    endif
-   cd ../../../rawdata
 end
 
-cd ../..
+cd /local/users/pstar/cruise/data/ladcp/rawdata/UL
+foreach i (`ls DY113_CTD*S.000`)
+   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".000")-4,3)}'`
+   set linkfile = ${num}UL000.000
+   cd /local/users/pstar/cruise/data/ladcp/ix/raw
+   if(! -e $num) then
+      echo Making directory $num for raw file $i
+      mkdir -p $num
+   endif
+   cd $num
+   if (! -e $linkfile) then
+      echo Making link $linkfile for raw file $i
+      ln -s ../../../rawdata/UL/$i $linkfile
+   endif
+end
+
+cd /local/users/pstar/cruise/data
+
diff --git a/mexec_cruise_backup b/mexec_cruise_backup
index 3272cf1..97037f0 100755
--- a/mexec_cruise_backup
+++ b/mexec_cruise_backup
@@ -63,13 +63,13 @@ echo -------------        >> $backuplog
 echo Date `date`          >> $backuplog
 echo done copying mexec software, shell scripts, scripts >> $backuplog
 
-# backup everything in data
+# backup everything in data except public drive
 echo -------------        >> $backuplog
 echo Date `date`          >> $backuplog
 echo start copy to disk of data   >> $backuplog
 echo ------               >> $backuplog
 cd $root
-rsync -aL --exclude legwork --exclude scs_raw --exclude jcrfs --exclude netcdf_files_rawdir_ship --exclude from_public data ${backupdir}
+rsync -aL --exclude legwork --exclude scs_raw --exclude jcrfs --exclude netcdf_files_rawdir_ship --exclude from_public --exclude public data ${backupdir}
 echo -------------        >> $backuplog
 echo Date `date`          >> $backuplog
 echo done copy to disk of data   >> $backuplog
diff --git a/modsal_unix b/modsal_unix
index 10920bf..54dd941 100755
--- a/modsal_unix
+++ b/modsal_unix
@@ -6,23 +6,17 @@
 #cd data
 #cd ctd
 
-set cruise = 'jc159'
+set cruise = dy113
 
 cd ctd
 cd BOTTLE_SAL
-foreach i (`ls /local/users/pstar/cruise/data/ctd/BOTTLE_SAL/sal_${cruise}_???.csv`)
+foreach i (`ls /local/users/pstar/cruise/data/ctd/BOTTLE_SAL/sal_${cruise}_??_??.csv`)
 
 mac2unix -n $i ${i}_linux
 echo " " >> ${i}_linux
 echo " " >> ${i}_linux # extra newline added by bak for dy040; may not be needed
 end
 
-foreach i (`ls /local/users/pstar/cruise/data/ctd/BOTTLE_SAL/tsg_${cruise}_???.csv`)
-mac2unix -n $i ${i}_linux
-echo " " >> ${i}_linux
-echo " " >> ${i}_linux
-end
-
 touch sal_${cruise}_01.csv
 /bin/rm sal_${cruise}_01.csv
 cat *linux >>! sal_${cruise}_01.csv
diff --git a/uhdas_00_linkmerge b/uhdas_00_linkmerge
index 1b202d2..cd9a1e6 100755
--- a/uhdas_00_linkmerge
+++ b/uhdas_00_linkmerge
@@ -15,7 +15,7 @@
 
 cd /local/users/pstar/cruise/data/vmadcp/spprocessing
 
-foreach i (`cat ~/cruise/data/vmadcp/cruise_segments`)
+foreach i (`cat /local/users/pstar/cruise/data/vmadcp/cruise_segments`)
 echo linking ${i} to $1
 link_uhdaslegs.py ../atsea/${i} $1
 end
diff --git a/uhdas_01_syncraw b/uhdas_01_syncraw
index a024b98..1c734d7 100755
--- a/uhdas_01_syncraw
+++ b/uhdas_01_syncraw
@@ -16,13 +16,13 @@
 # List of cruise segments to be processed is found in
 # ~/cruise/data/vmadcp/cruise_segments
 
-set rdir = ~/mounts/uhdas_data
-set ldir = ~/cruise/data/vmadcp
+set rdir = /local/users/pstar/mounts/uhdas_data
+set ldir = /local/users/pstar/cruise/data/vmadcp
 
 mkdir -p ${ldir}/atsea
 mkdir -p ${ldir}/postprocessing
 
-foreach i (`cat ~/cruise/data/vmadcp/cruise_segments`)
+foreach i (`cat ${ldir}/cruise_segments`)
 echo syncing ${i} to ${ldir}
 rsync -auv ${rdir}/${i} ${ldir}/atsea/
 
diff --git a/uhdas_02_sync_postprocessing_from_raw b/uhdas_02_sync_postprocessing_from_raw
index 7e299f3..4a1dedf 100755
--- a/uhdas_02_sync_postprocessing_from_raw
+++ b/uhdas_02_sync_postprocessing_from_raw
@@ -14,11 +14,12 @@
 #
 # List of cruise segments to be processed is found in
 # ~/cruise/data/vmadcp/cruise_segments
+#
 
-set ldir = ~/cruise/data/vmadcp
+set ldir = /local/users/pstar/cruise/data/vmadcp
 
 
-foreach i (`cat ~/cruise/data/vmadcp/cruise_segments`)
+foreach i (`cat ${ldir}/cruise_segments`)
 echo
 echo
 echo syncing 
diff --git a/uhdas_03_copy_asclog_for_editing b/uhdas_03_copy_asclog_for_editing
index ef5af41..827a228 100755
--- a/uhdas_03_copy_asclog_for_editing
+++ b/uhdas_03_copy_asclog_for_editing
@@ -15,6 +15,9 @@
 # List of cruise segments to be processed is found in
 # ~/cruise/data/vmadcp/cruise_segments
 #
+# ylf dy113 edited so you can specify additional calibrations to apply as 
+# input argument, in single quotes, e.g.
+# uhdas_03 '--rotate_angle 0.59 --xducer_dx 4'
 
 # make sure the bash environment is set up
 source ~/.bashrc
@@ -61,8 +64,13 @@ done
 thisdir=`pwd`
 echo quick_adcp.py in ${thisdir}
 which quick_adcp.py
-quick_adcp.py --steps2rerun apply_edit:navsteps:calib --auto
+#quick_adcp.py --steps2rerun apply_edit:navsteps:calib --auto
+echo applying calibrations ${1}
+echo unless you removed proc_editing/${pingtype} directory before running uhdas_02
+echo any calibrations will be double applied to first part of series
+quick_adcp.py --steps2rerun rotate:apply_edit:navsteps:calib ${1} --auto #***
 
+echo now edit or apply additional calibrations
 
 popd
 fi
-- 
GitLab