LAST CHANGED    : 2013/02/01
CRUISE NAME(S)  : ka1103
CRUISE DATES    : 2011/04/10 to  2011/05/12  
SHIP NAME       : Ka`imimoana
PORTS           : Honolulu, HI to San Diego, CA
CHIEF SCIENTIST : ??
DATABASE NAME   : aship
DATA FILES      : ka2011_099_65660.raw to ka2011_131_50400.raw

STATUS          :  to do                           done
                  ------                       -----------
                  averaged                       [  x   ]
                  loaded                         [  x   ] reprocess

                  NOTE: heading correction instrument exists
                        NOTE: time-dependent heading corrections
                        applied IN the ensembles

                  check heading correction       [  x   ]
                  calibration                    [  x   ]
                  edited                         [  x   ]
                  re-check heading correction    [  x   ]
                  check editing                  [  x   ]
                  figures                        [  x   ]

INSTRUMENT      : os75

ACQUISITION     : 
     PROGRAM    : uhdas
     PROCESSING:    : python

LOGGING         : 

     PARAMETERS : BT : bottom track mode (on or off)
                  SI : sampling interval or averaging period for ensemble (sec)
                  NB : number of bins
                  BL : bin length (m)
                  TD : transducer depth (m)
                  BK : blanking length (m)
                  HO : heading offset applied by DAS (deg)
                  HB : heading bias (deg)
                  CRPH : compensation for roll-pitch-heading, 1:on, 0:off)
                  
                  yy/mm/dd  hh:mm:ss   BT   SI  NB  BL  TD BK     HO     HB CRPH
                  2011/04/10 18:19:22  off  300  70  16   5  8  44.40   0.00 0001

HEADING         : 
     PRIMARY    : gyro
     CORRECTION : posmv

POSITIONS       : gps (specify more detail if available)

CALIBRATION     : check parameters for original heading alignment
                  additional rotation -0.35
                  final transducer angle is:
                       44.4 - (-0.35)  = 44.75
                  original scale factor 1
                  additional scale factor (none)

COMMENTS        : small gaps in POSMV
                  some isolated strong scattering layers 
                  bad weather impacted several transit legs
                  
PROCESSOR       : J.Hummon


--- processing parameters ----------


## (determined from "sonar"): model = os
## (determined from "sonar"): frequency = 75
## (determined from "sonar"): pingtype = nb
## (determined from "sonar"): instname = os75
## ping_headcorr is True
## hcorr_inst is posmv
           beamangle   30
          configtype   python
          cruisename   ka1103
            datatype   uhdas
             ens_len   300
             fixfile   None
               pgmin   50
         proc_engine   python
          ref_method   refsm
               sonar   os75nb
            yearbase   2011


   ==== UHDAS processing from scratch, using python ==============

Process UHDAS data using Python
=============================================

(0) This cruise camein two parts

cd datadir
mkdir ka1103_legs
mv ka_12_01 ka1103_legs
mv ka_12_01a ka1103_legs

mkdir ka1103
link_uhdaslegs.py mv ka1103_legs/ka_11_03 ka1103
link_uhdaslegs.py mv ka1103_legs/ka_11_03a ka1103
link_uhdaslegs.py mv ka1103_legs/ka_11_03b ka1103


(1) # make python config file

mkdir config
cd config
uhdas_proc_gen.py -s ka
mv ka_proc.cfg ka1103_proc.py


    #    Edit the file and add these lines to the top

yearbase = 2011                  # usually year of first data logged
uhdas_dir = '/home/data/ka1103'  # path to uhdas data directory
shipname = 'Ka`imimoana' # for documentation
cruiseid = 'ka1103'              # for titles


(2) now we can use that file.
    Set up the processing directory by typing:


      adcptree.py  os75nb --datatype uhdas --cruisename ka1103

(3) change directories to ADCP processing directory just created

    cd  os75nb

(4) create a quick_adcp.py control file

    unix: this example  is written as a bash "heredoc" for
          cut-and-past ease, but you can create q_py.cnt with
          an editor to have the parts between (or including)
          the comments

cat << EOF > q_py.cnt

    ####----- begin q_py.cnt------------
    ## all lines after the first "#" sign are ignored
      --yearbase    2011
      --cruisename  ka1103   # used to identify configuration files
                              #  *must* match prefix of files in config dir

      --update_gbin   ## NOTE: You must remake gbins for python processing if
                      ## - you are not sure
                      ## - if parameters for averaging changed
                      ## - various other reasons.
                      ## ==> just do it, and put them somewhere else
                      ##     (see next argument)
                      
                      ## delete/move original gbins


      --configtype python  ## <=== USE THE NEW FILE WE CREATED

      --sonar       os75nb
      --dbname      aship
      --datatype    uhdas
      --ens_len     300

      --ping_headcorr        ## applies heading correction.
                             ##     settings found in config files
      --proc_engine python   ## use matlab to do calculations
      --max_search_depth 2000 #do not try to identify the bottom if 
                                   ## topo says it's shallower than this

EOF


----------
(5) run quick_adcp.py:

        quick_adcp.py --cntfile q_py.cnt  --auto

=======================================================

(6) (a) check calibration

   **watertrack**   
------------
Number of edited points:  95 out of 104
   amp   = 1.0012  + -0.0002 (t - 116.0)
   phase =  -0.40  + -0.0169 (t - 116.0)
            median     mean      std
amplitude   1.0020   1.0012   0.0068
phase      -0.3480  -0.3985   0.5304
------------

(b) check heading correction device:

    figview.py cal/rotate/*png

Better patch heading correction:

cd cal/rotate
patch_hcorr.py
        (cleaner; write/exit)

      figview.py *.png

      rotate unrotate.tmp

      rotate rotate_fixed.tmp

      cd ../..
      quick_adcp.py --steps2rerun navsteps:calib --auto



(c) recheck cals

   **watertrack**   
------------
Number of edited points:  95 out of 104
   amp   = 1.0012  + -0.0002 (t - 116.0)
   phase =  -0.40  + -0.0166 (t - 116.0)
            median     mean      std
amplitude   1.0020   1.0012   0.0068
phase      -0.3410  -0.3995   0.5304
------------


(d) check gps offset from transducer (not bad)

guessing ADCP (dx=startboard, dy=fwd) meters from GPS
fixfile is aship.gps
calculation done at 2012/11/27 23:24:02
xducer_dx = 2.760733
xducer_dy = 0.809529
signal = 6077.689975


-------------------
(7)  edit "gautoedit" (go to "edit" directory with command line, 
    type "gautoedit.py"

    # apply editing:


      cd ..
      quick_adcp.py --steps2rerun apply_edit:navsteps:calib --auto

    # check editing -- looks OK

          dataviewer.py


    - check calibrations again

   **watertrack**   
------------
Number of edited points:  90 out of  97
   amp   = 1.0011  + -0.0003 (t - 115.6)
   phase =  -0.38  + -0.0112 (t - 115.6)
            median     mean      std
amplitude   1.0010   1.0011   0.0069
phase      -0.3395  -0.3843   0.5768
------------


apply calibrations:


    quick_adcp.py --steps2rerun rotate:apply_edit:navsteps:calib --rotate_angle -0.35 --auto

   **watertrack**   
------------
Number of edited points:  90 out of  97
   amp   = 1.0012  + -0.0003 (t - 115.6)
   phase =  -0.03  + -0.0109 (t - 115.6)
            median     mean      std
amplitude   1.0010   1.0012   0.0070
phase       0.0130  -0.0320   0.5704
------------



OK, done

make plots:



    quick_web.py --interactive 


    - view with a browser, look at webpy/index.html



done.
OK to submit