Radial currents from WERA and CODAR systems are combined together on a grid to provide total currents approximately every hour. The processing is conducted on the WERA server (ssh wera@132.215.11.14) and the resulting hourly currents are exported to .csv files to be displayed on he OGSL website (http://ogsl.ca/observations/).
All the matlab scripts are located in ~/projets/hfr_data_processing/hfr_processing.
A crontab runs the analysis (crontab).
The processing runs as follows:
1- Download the last available data at each WERA sites (radial currents - ascii format)
For PAO, data is available at HH+00 and HH+30.
For PAB, data is available at HH+15 et HH+45.
Every 10 min the crontab tries to download data via a shell script:
5,15,25,35,45,50 * * * * /home/wera/projets/hfr-data-processing/hfr_process/download_wera_rt.sh
The data is located in: /home/wera/codar_wera_ogsl/archives/data
2- Download the last available data at each CODAR sites (.ruv)
For PAP and STF, data is available at HH+00
Every 5 minutes, the crontab tries to download data via a shell script:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/wera/projets/hfr-data-processing/hfr_process/download_codar_rt.sh
The data is located in: /home/wera/codar_wera_ogsl/archives/data
3- at H+55min the crontab runs to combine currents for the last hour via a shell script:
55 * * * * /home/wera/projets/hfr-data-processing/hfr_process/ogsl_hfr_treatment.sh
What does the shell do?
- copy the .ruv and ascii files located in /home/wera/codar_wera_ogsl/archives/data in the working directory /home/wera/codar_wera_ogsl/travail
- unzip .gz files
- convert .ruv to .mat format (ruv2mat.m)
- convert ascii to .mat format (ascii2mat.m)
- generate (combine) total currents (rad2tot.m)
At this stage a .mat file is generated (i.e. HFR_LSLE_20150817T170000Z.mat) for each hour.
- the routine currentsHfrWithAverageExport.m computes the 25-hour current average and exports the hourly currents into a .csv file to be displayed on the OGSL website.
- the .csv files are moved to the webserver (/srv/www/htdocs/wera/hfrdata) and the .mat are moved in archives (/home/wera/codar_wera_ogsl/archives/matfiles and /srv/www/htdocs/wera/hfrmat) and logs are kept in /home/wera/codar_wera_ogsl/logs (download_codar_rt.log, download_wera_rt.log, ogsl_hfr_treatment.log, reprocess_ogsl_hfr_treatment.log)