calibration.txt 11.5 KB
**************
Calibrations
**************

.. note:: **Calibrations made in 2014**

######
CODAR
######


**POINTE-AU-PERE:** 
***********************

Please see notes from field work on `2013-02-01`_.

.. _2013-02-01: http://demeter.uqar.ca/submesoscale/index.php/Pap

Starting 2013-02-01: **Change of frequency** due to a misreading in the frequency permits... 

      
   * Up to 2013-02-01 19:50 UTC use the "old" antenna diagram to do the calibration
   * From 2013-02-01 19:50 UTC use the "new" antenna diagram 


We reprocessed all data from CODAR PAP **starting 2012-12-13** date at which the site was operational.
   

.. topic:: from 2012-12-13 to 2013-02-01 19:50 UTC
   
        RadialConfigs_PAP1_20121213_WAPM_MUSIC402002_5Dsmooth
        

Steps to generate new RadialConfigs files:

   * Copy all content of the directory in **RadialConfigs**
   * run SeaSondeRadialSetUp
   * change output: metrics, processing check MUSIC 40 20 02, no smoothing, filtered


To generate the new Antenna diagram:

   * cd Data/Loops/PATT_PAP1_2012_12_15...xlp
        ==> open .patt
        -  Walk APM up to 2013-02-01
        -  Boat APM until now


.. topic:: from 2013-02-01 19:50 UTC to now

        RadialConfigs_PAP1_20130201_BAPM_MUSIC402002_nosmooth
  


**SAINTE-FLAVIE**
*****************

.. topic:: from 2012-12-20 to 2013-02-06 12:00 UTC
      
          RadialConfigs_STF2_20121220_BAPM_MUSIC402002_nosmooth
       

.. topic:: from 2013-02-01 19:50 UTC to now
      
          RadialConfigs_STF2_20130206_BAPM_MUSIC402002_nosmooth
      

#####
WERA
#####

Go to the **"Submesoscale"** `wiki`_ and click on "useful links" under **Outils**, then "WERA HF Radar Software - Fortran Programs Documentation". Here we find which Fortran program we need to use to do what we want.

.. _wiki: http://demeter.uqar.ca/submesoscale/index.php/Accueil


.. topic:: Objectives

        We need to "remove wrong calibration data and apply new ones", so we need to use Modify_WERA_SORT.




1. Steps to generate new calibration phases
*********************************************

  #. loggin to the wera server wera@132.215.11.14
  #. cd etc/

In this folder, we find the original calibration files: 
     - calibration_pab.wera
     - calibration_pao.wera

If we look at what the content of the calibration file:ca
     - cat calibration_pab.wera

the phase is given in the 3rd column.


On 2014-10-29 (PAO) and 2014_10-30 (PAB), calibrations were undertaken in the field.

Calibration data are stored in:
     - /run/media/bandma01/SeagateWireless/MEOPAR/DATA/HFRs/WERAs/PAB/2014303 every minute from 30-Oct-2014 16:53:20 to 30-Oct-2014 18:11:20
     - /run/media/bandma01/SeagateWireless/MEOPAR/DATA/HFRs/WERAs/PAO/2014302 every minute from 29-Oct-2014 17:48:54 to 29-Oct-2014 18:25:54

 
While the calibrations were running, tracks were recorded with an instrument belonging to Helzel (PAO and PAB) as well as with an instrument belonging to Flament (PAB). So for PAB we are going to be able to compare the two. 

The tracks can be found in :
     - /run/media/bandma01/SeagateWireless/MEOPAR/DATA/HFRs/WERAs/PAO/HelzelPAO_Track_29-OCT-14 183138.gpx
     - /run/media/bandma01/SeagateWireless/MEOPAR/DATA/HFRs/WERAs/PAB/HelzelPAB_Track_30-OCT-14 175446.gpx 
     - /run/media/bandma01/SeagateWireless/MEOPAR/DATA/HFRs/WERAs/PAB/FlamentPAB_Track_30-OCT-14 182008.gpx 

We use the routine **GPS_gpx2mat.m** to convert .gpx files into .mat files.

We use the routine **WERA_AntennaCoord_txt2mat.m** to transform the .txt files with antennas'coordinates to .mat files.

We use the routine **WERAphase_txt2mat.m** to convert the .txt files containing phases into .mat files.

The routine **WERAcalibration_2014.m** is available at this `page`_.

.. _page: WERAcalibration_2014.html

All the Matlab routines used for the data processing are located in **~/hfr-data-processing/calibrations/**.


Outputs of **WERAcalibration_2014.m** for PAO site are available here: `calibrationPAO2014`_

.. _calibrationPAO2014: calibPAO2014.html

+---------------------------------------------+
|  PAO - Helzel- Phases in degrees            |
+-------------+-----------------+-------------+
| Antenna nb  | original phase  |  new phase  |
+=============+=================+=============+
|  1          |      0          |     0       |
+-------------+-----------------+-------------+
|  2          |     -0.6181     |    2.2270   |
+-------------+-----------------+-------------+
|  3          |     -19.9027    |   -20.8291  |
+-------------+-----------------+-------------+
|  4          |       1.2299    |     1.2548  |
+-------------+-----------------+-------------+
|  5          |     -21.2304    |   -15.9611  |
+-------------+-----------------+-------------+
|  6          |      10.7207    |    12.7500  |
+-------------+-----------------+-------------+
|  7          |      -5.2161    |     6.0602  |
+-------------+-----------------+-------------+
|  8          |      -14.8695   |   -14.5626  |
+-------------+-----------------+-------------+
|  9          |      -2.5658    |     1.1416  |
+-------------+-----------------+-------------+
|  10         |      -16.1023   |   -14.8303  |
+-------------+-----------------+-------------+
|  11         |      -6.7589    |   -10.0689  |
+-------------+-----------------+-------------+
|  12         |      -9.7778    |   -13.8845  |
+-------------+-----------------+-------------+

The new phase values were saved under **calibration_pao_29OCT2014.wera**.

 
Outputs of WERAcalibration.m for PAB site are available here: `calibrationPAB2014`_

.. _calibrationPAB2014: calibPAB2014.html


+---------------------------------------------+
|  PAB - Helzel - Phases in degrees           |
+-------------+-----------------+-------------+
| Antenna nb  | original phase  |  new phase  |
+=============+=================+=============+
|  1          |      0          |     0       |
+-------------+-----------------+-------------+
|  2          |     1.0514      |   -19.6031  |
+-------------+-----------------+-------------+
|  3          |     8.3719      |    77.3093  |
+-------------+-----------------+-------------+
|  4          |       2.0496    |    -2.8669  |
+-------------+-----------------+-------------+
|  5          |      13.5527    |    29.2102  |
+-------------+-----------------+-------------+
|  6          |      -3.0394    |    -1.9353  |
+-------------+-----------------+-------------+
|  7          |       0.9866    |   -30.6625  |
+-------------+-----------------+-------------+
|  8          |      -2.9561    |    -7.2423  |
+-------------+-----------------+-------------+
|  9          |      -1.5691    |   -28.9055  |
+-------------+-----------------+-------------+
|  10         |       -2.4549   |   -24.0200  |
+-------------+-----------------+-------------+
|  11         |       1.4106    |   -12.9370  |
+-------------+-----------------+-------------+
|  12         |      -2.7529    |    -7.4966  |
+-------------+-----------------+-------------+

The new phase values were saved under **calibration_pab_30OCT2014.wera**.




2. Re-processing of radial currents with new phases
***************************************************

For the all month of September 2013, we are going to generate new radial currents using the new calibration phases. 

Common steps for the post-processing of WERA radial currents is documented `here`_.

.. _here: WERAprocessing.html


For example, let us see what we have to do to generate new radial currents at PAO using the new calibration phases for september 1st, 2013 (Julian day 244):

   - loggin to the wera server

   - go to the folder containing the data:

        . cd  ~/data1/PAO/2013244/
        . the raw currents are located in **2013244/raw/** 
        . the analysis takes the raw currents, apply the calibration phases and save the resulting radial currents in **/2013244/results/** under .SORT and .RFI files using the **do_process_SORT_pol** shell script. This is done using the original calibration phases.
        . the new radial currents using the updated calibration phases will be saved under **/2013244/results/new**.

 

    - First we need to change the original .SORT and .RFI files and save them to .SORT0 and .RFI0 to save them for future reference. This is done with the shell script **changeName.sh** located in **/hfr-data-processing/postprocessing/wera/**.

    - then we need to create a symbolic link to specify with files to use in terms of calibration phases. This file is different for each site. 

     For the example taken here (site = PAO): calibration.wera.apply ---> calibration_pao_29OCT2014.wera  and calibration.wera.remove -----> calibration_pao.wera


    - then we need to run **MODIFY_WERA_SORT** to generate new .SORT and .RFI files using the new calibration phases.

All these steps are done in a shell script **do_postprocess_SORT_newCalib.sh** that calls **wera_new_calibration.sh**.
  

Large data files transfer has been automatized in **do_filetransferssh.sh** that calls **fileTransferSSH.sh**.     
      
All the shell scripts are located on the WERA server under **/home/wera/bin/**. 





COMPARISON OLD/NEW WERA CALIBRATIONS
**************************************

In March 2015, we used data collected in September 2013 to compare old and new calibrations in order to know which ones we should use for the on-going analysis of currents data.

.. figure:: figures/CompaNewcalib_ADCP_WERA_Sept2013_PAO.png
    :width: 500px
    :align: center
    :height: 250px
    
    Hourly radial currents from ADCP bin 2 and HFR WERA at PAO - September 2013

    Superimposed are the 48-h averages

.. figure:: figures/Compa_old-newcalib_ADCP_WERA_Sept2013_PAO.png
    :width: 500px
    :align: center
    :height: 250px

.. figure:: figures/Compa_old-newcalib_ADCP_WERA_Sept2013_PAO_corrcoef.png 
    :width: 500px
    :align: center
    :height: 250px


:ref:`rst_checkWERAposition`



.. note::  **Calibrations made in 2016**


New calibrations were made in Juy 2016 for the WERA sites.

On 2016-07-05  at the PAB site, calibrations were undertaken in the field walking and with a boat.

Calibration data are stored in:
     - wera server: /home/wera/data2/PAB/2016187/cal/
     - /run/media/bandma01/SeagateWireless/MEOPAR/DATA/HFRs/WERAs/PAB/2016187 every minute from 20161870013 to 20161872011 


 While the calibrations were running, tracks were recorded with a gps on the beach (WALK) and on a boat (BOAT). 

The tracks can be found in :
     - wera server: /home/wera/gps4cal/
     - /run/media/bandma01/SeagateWireless/MEOPAR/DATA/HFRs/WERAs/PAB/

Track_05-JUL-16 150101.gpx is the file for the WALK calibrations
Track_12-JUL-16 131906.gpx AT THE BEGGINNING  are the tracks for the boat calibrations from July 6, 2016


We use the routine **GPS_gpx2mat.m** to convert .gpx files into .mat files.

The WALK calibrations were made between 13:53 and 14:58 UTC so I clipped the data so that only good data remained (+/- 10 seconds)
.
The BOAT calibrations were made between 18:20 and 19:18 (first cicle at 64 samples/run) and 19:20 and 20:11 (second circle at 32 samples/run).

The .mat files were saved under: 
		- Track_05-JUL-16 150101.mat for the walk calibrations
		- FirstCircle_BOAT_Track_05-JUL-16 for the boat calibrations (first circle)
		- SecondCircle_BOAT_Track_05-JUL-16 for the boat calibrations (second circle)


Use the routine **WERAphase_txt2mat.m** to convert the .txt files containing phases into .mat files.

Then run the **WERAcalibrations_2016.m**. 
I added an I/Q balence check in he script to reject "bad" values (I/Q > 95 deg and I/Q < 85 deg). 

Results of the new (july 2016) calibrations are here for PAB: `PABcalib2016`_.

.. _PABcalib2016: calibPAB_2016.html