calibration.txt 9.46 KB
**************
Calibrations
**************

######
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_PAP1_20130201_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:
     - 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:
     - /hfr-data-processing/calibrations/PAB/2014303 every minute from 16:53 to 17:55
     - /hfr-data-processing/calibrations/PAO/2014302 every minute from 17:46 to 18:23
 
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 :
     - /hfr-data-processing/calibrations/PAO/HelzelPAO_Track_29-OCT-14 183138.gpx
     - /hfr-data-processing/calibrations/PAB/HelzelPAB_Track_30-OCT-14 175446.gpx 
     - /hfr-data-processing/calibrations/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.m** is available at this `page`_.

.. _page: WERAcalibration.html

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


Outputs of **WERAcalibration.m** for PAO site are available here: `calibrationPAO`_

.. _calibrationPAO: calibPAO.html

+---------------------------------------------+
|  PAO - Helzel- Phases in degrees            |
+-------------+-----------------+-------------+
| Antenna nb  | original phase  |  new phase  |
+=============+=================+=============+
|  1          |      0          |     0       |
+-------------+-----------------+-------------+
|  2          |     -0.6181     |    12.5669  |
+-------------+-----------------+-------------+
|  3          |     -19.9027    |    39.2831  |
+-------------+-----------------+-------------+
|  4          |       1.2299    |    16.4368  |
+-------------+-----------------+-------------+
|  5          |     -21.2304    |    48.6882  |
+-------------+-----------------+-------------+
|  6          |      10.7207    |    32.0365  |
+-------------+-----------------+-------------+
|  7          |      -5.2161    |    46.1277  |
+-------------+-----------------+-------------+
|  8          |      -14.8695   |    86.8683  |
+-------------+-----------------+-------------+
|  9          |      -2.5658    |    82.3474  |
+-------------+-----------------+-------------+
|  10         |      -16.1023   |   112.4072  |
+-------------+-----------------+-------------+
|  11         |      -6.7589    |   132.1750  |
+-------------+-----------------+-------------+
|  12         |      -9.7778    |   153.9098  |
+-------------+-----------------+-------------+

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

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

.. _calibrationPAB: calibPAB.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`