**Acquisition Computer**: Deployment and Recovery =================================================== .. _data_logging_programs: Data Logging Programs ~~~~~~~~~~~~~~~~~~~~~ To communicate with the LADCP, a python acquisition software is used. Each program comes also with a file containing the default parameters of the instrument: * ``ladcp_wh150.py`` and ``wh150.cmd`` Workhorse 150kHz * ``ladcp_wh300.py`` and ``wh300.cmd`` Workhorse 300kHz * ``ladcp_bb150.py`` and ``bb150.cmd`` for the broad-band (BB) instrument * ``wh_dnup.py``, ``wh300_up.cmd`` and ``wh300_dn.cmd`` for two RDI Workhorse All programs are in :: /home/science/current_cruise_logging/ .. The acquisition softwares need to be edited. From the acquisition PC, open them with a text editor. The editing section is near the top and should resemble the following: :: ## edit this section for your cruise ### font_size = 16 # try 12, 14, 16, 18, 20 backup = '/media/AC_backup/current_cruise_logging' # 2nd copy (data and and logs here) ## backup = '' # or set to empty string to disable device_dn = '/dev/ttyUSB0' # comm port comm_baud_dn = 9600 # communication baud rate data_baud_dn = None # download baud rate: # 19200, 38400, 57600, 115200 # or None to use instrument default cmd_filename = 'wh150.cmd' # default command file for WH150 ##### end of section to edit ### * There is at least one back-up disk that should be plugged onto the acquisition PC and the variable ``backup`` above should thus receive the path to that disk. * The variable ``device_dn`` should receive the path to the USB-serial device (see :ref:`serial_ports`). * ``comm_baud_dn`` and ``data_baud_dn`` are the communication and the data baud rate, respectively. To find them for the appropriate instrument, see :ref:`first_time_talking_to_the_instrument`. * The last line gives the file that contains the default parameters for each instrument: + ``ladcp_wh150.py`` should have ``wh150.cmd``. + ``ladcp_wh300.py`` should have ``wh300.cmd`` The files ``wh300.cmd``, ``wh150.cmd``, ``wh300_up.cmd`` and ``wh300_dn.cmd`` contain the list of default parameters for each instrument. For instance, we usually collect data from the wh150 LADCP in beam coordinates with 40x(8m) bins or 20x(16m) bins. The parameters are described in an `annotated command file for wh300 `_ . The annotations come from the manual; it is a good idea to look at the manual and understand the command files you are using. A word on two-LADCP set-up ~~~~~~~~~~~~~~~~~~~~~~~~~~ When two LADCPs are used, one is considered the "master", the other the "slave". The downlooker is arbitrarily chosen to be the "master" LADCP. In ``wh_dnup.py``, the values of the variables ``device_up``, ``comm_baud_up`` and ``data_baud_up`` need to be specified. Communication and data baud rate are usually the same as for the downlooker and the only difference is the name of the USB access ``device_up``. The master and slave configurations are given in ``wh300_up.cmd`` and ``wh300_dn.cmd``. "master" is set by ``SM1``, "slave" by ```SM2``. The command ``SW05000`` in the master command file orders the master LADCP to ping 500 ms after the slave's ping to avoid interference between the two pings. Setup ~~~~~ Proceeding on the **acquisition computer**, in the current cruise logging directory ``/home/science/current_cruise_logging/``: - Start the acquisition program (*e.g.* ``ladcp_wh150.py``) on the command line in the directory you wish to download to: :: ladcp_wh150.py .. Various messages appear in that window, so there's little point in backgrounding the process. Treat the window as a console that catches error and diagnostic messages. - If there are two instruments, the program makes two-window gui with a window on top and bottom for the up-looking and down-looking instruments, respectively. They operate independently in terms of communication to the respective instruments, but share download directory, and have 'up' or 'dn' in the filename. On netbooks, the screen may be so small that the window for the uplooker takes the whole space. Open ``wh_dnup.py`` and changes the height of the respective window in ``R_up.display.Text.configure`` and ``R_dn.display.Text.configure``. .. _software_deployment: Prepare for data recording ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fill out the acquisition logsheet (See :ref:`this example `) while proceeding the following steps: One-LADCP set-up ---------------- 1. LADCP status: - **Check** LADCP communication/power cables are probably plugged in? - **Check** Power supply is off (after previous cast)?. - **Record** station number and nominal position - **Record** power supply amps drawn (per channel), if it was still on. 2. Set the station_cast string (top right corner). 3. **Check PC clock** (verify, if ntp; set clock if no ntp). 4. Run the steps under menu item **Deploy**: * **Deployment initialization**: - Makes a "mark" in the text window and adds a time stamp - Sends a break - Asks the ladcp for its clock time - Lists the instrument recorder * **Set clock** (sets the ladcp to the PC clock. useful if running ntpd) * **List recorder** (information depends on age of instrument) - **Check** Previous station and logsheets agree with expectations? - **Check** Were there multiple file segments? all are downloaded? * **Send setup** (appropriate \*.cmd, in the current directory) - Sends each line to the LADCP - Queries (eg. "W?") are included in the cmd file - Writes everything from the mark (see initialization) to here into a log file named after the station_cast string. (appends, does not overwrite) * **Disconnect** (optional: frees up the lock on the serial port and may prevent accidental sending of a 'BREAK' if lines are jostled; allows use of the serial port for other things) 5. Physically deploy the instrument (see Hardware Section :ref:`hardware_deployment`) Two-LADCP set-up ---------------- Run steps 1 to 4 above **first for the slave (uplooker) in the TOP window and then for the master (downlooker) in the BOTTOM window**. Notice that the slave will start to ping only when the master has. Once the two LADCPs are pinging, deploy physically both instruments. .. _software_recovery: Recover the data ~~~~~~~~~~~~~~~~ One-LADCP set-up ---------------- 1. Run the steps under **Recover**: * **Recovery initialization**: * Same as **Deployment initialization**: make a mark, wake up the, instrument, write PC and ladcp times and list recorder * **Download** * Choose file from the list (consult log sheet) * Initiate download (automatically switches to download baud) * Write dialog to log file (from mark (above) to end of download) * **Record** the time the download starts and finishes * Put instrument to sleep * **Check the data**: in a terminal, type: :: ladcp_rawplot.py --plot scalars --show wh059_01.dat .. If the raw LADCP data filename is ``wh059_01.dat``. It will print information like the following on the screen: :: Raw wh300 data file: wh010_01.dat coords: beam Last ensemble was 19794; 0 were bad zmin: -94.4 at 19021 zmax: 4506.7 at 7893 zend: -94.0 at 19023 number_with_velocity: 16717 first_good_ensemble: 2306 last_good_ensemble: 19023 downcast: 2009/11/24 17:43:09 to 2009/11/24 19:16:15 upcast: 2009/11/24 19:16:17 to 2009/11/24 22:21:45 .. There are several information that need to be checked: * **Depths**: - Are ``zmin`` and ``zend`` near 0? (within 100 m is usually OK) - Is ``zmax`` close to the deepest depth reached by the cast (see CTD group's log sheet)? Note that the values are mostly **positive**. If there are negative, then the downward-looking LADCP thinks is looking upward. :ref:`Contact us`. - Do the times make sense? - **Record** ``zmax`` and ``zend`` on the acquisition log sheet .. NOTE:: Sometimes, depending on the LADCP firmware, a single cast will be split into multiple pieces. Evidence for this is - the fact that there are more files on the data recorder than expected - "zend" does not match "zstart" or "zmax" is not deep enough - the time range for this file is not correct The pieces can be glued abck together (example is station 059 in the LADCP demo) 2. Finalize the instrument recovery (see hardware Section :ref:`hardware_recovery`): once the battery is charged (drawing 0.5A/channel) toggle off power. Two-LADCP set-up ---------------- **Recovery initialization** for the **master (downlooker) first in the BOTTOM window**, then for **slave (uplooker) in the TOP window**. Failure to follow that order will result in an incomplete download of the slave's file. **Download** the data for each instrument. You can start with either the slave or master and you do not have to wait that the first download finishes to start the other one. Then, as above, scan each file and finalize the recovery. More about files and data ^^^^^^^^^^^^^^^^^^^^^^^^^ * Always **remember to update station and cast** before starting a cast. This ensures that the dialog with the instrument is recorded in a log file with the correct station_cast information. * The acquisition programs (``ladcp_wh150.py``, ``ladcp_wh300.py`` or ``ladcp_bb150.py``) download the data from the respective instruments using the name in the instrument's firmware. - temporary filenames: + **WH150**: temporary filenames are something like _RDI_000_000 + **WH300**: temporary filenames are something like _RDI_000_000 + **BB150**: temporary filenames are 8 digits (somehow generated inculding a timestamp) followed by 3 digits (unique to the instrument). The date is wierd, like Jan 1, 1920. - permanent filename: + the default data file name is **SSS_CC** using the values for **SSS = station** and **CC = cast** that were entered into the top right corner of the window before downloading started. + the python program will not overwrite a file that is already on the disk + the python program will let you rename the file to a different name (if you forgot to enter the correct station and cast before starting the download. + the python program will reset the date to 'now' at the end of downloading, so don't delay too long saving the file when download is complete. * **backups**: a copy of each log and data file is made to the backup directory specified in the python program. We're going to standardize on ``/media/AC_backup/ladcp_data_backup`` * reminder of strategy: + while steaming between stations, charge the battery and download the data to the PC + after download, make sure the data file is written on two media (i.e. a copy should be on a different disk or computer) + don't delete any cast from the instrument until it exists in 2 other places (different media) Additional Notes ^^^^^^^^^^^^^^^^ * To quit, use the window-manager "X" to kill the whole window. There is no 'Quit' dialog button under any of the menus * Other things like baud rate, port, etc can be set manually in the menus. * To send a 'BREAK', look under the **Command** window * "Set Time" uses the PC clock. Make sure the PC clock is very close to correct (even if using ntp) before setting the LADCP clock. It's OK if the times are off by 1 second -- that's normal given rounding errors in the instrument. * Disregard the following security warning in the console: :: "RuntimeWarning: tempnam is a potential security risk to your program" .. * On-line documentation for LADCPs is somewhere in ``/home/currents/rdi_docs``