This is the primary argos script. It is responsible for identifying buoys which have Argos instruments, checking whether there are new files to be processed, and calling other scripts necessary to process messages, and print and plot the output.
Argos messages will be processed for buoys which have an
Performs a cyclic redundancy check on the 256 bits of binary encoded MET data. It uses the Bradley method (June 1983), converted to MATLAB by Jon Ware 5/15/2000.
It takes two parameters:
This is an experimental script which uses a brute force strategy to attempt to recover MET data which failed the cyclic redundancy check. In theory, all single bit errors should be detectable by a CRC check. Therefore, by flipping one bit at a time, single-bit errors are fixed. It expects a 256 bit binary character string as a parameter, and zero if unsuccessful, or the position of the incorrect bit if successful.
This script is responsible for most of Argos data's quality control. sys is a structure containing one buoy system's MET variables. qc_file is an .xml document which contains information about acceptable values for each variable. mybuoy is a structure which contains all of the meta-data for a specific buoy. It is extracted from /realtime/config/buoys.xml. It also requires a MATLAB "structures" set of routines which is included in /matlabtools/structures/. The modified sys structure is returned upon completion of the script.
For buoys with a deployment date, clean_data trims off all records prior to the deployment. Each variable is tested for values which are beyond the minimum and maximum acceptable values as defined in qc_file. Data which fails the min/max test is replaced with NaN, and will be omitted from plots. Each variable is also tested for stuck values. A threshold is defined in the qc_file using the
Calls argos.m, the main argos script. It is responsible for catching errors, and exiting gracefully back to the shell.
After data has been processed for a deployment, this script will create full and short ts plot of imet argos data. Called by argos.m
Script is located in the MET directory. do_plot_QC creates all of the QCd MET plots. It loads in the QC data from the .mat files located in the deployment directory. The order and format of each plot is set up by calling get_plot_pars() which reads in the info from a .xml file. It calls plot_MET which handles the actual graphics calls. Plot titles and time range are also defined in do_plot_QC.
First, this script tests whether an Argos raw data file contains any records with ptts which match the currently deployed bouy. It then performs a cyclic redundancy check(CRC) on MET data string to ensure data integrity. If successful, this script decodes each variable from binary to integer, and applies appropriate scaling and biasing to the variables as defined in imet_rec.xml. Variables are saved to a .mat file within the buoy's deployment directory with variable names such as A2 AT B2 BP BV C2 CO ...
Print coordinated universal time in number format rounded to nearest day. Used by do_plot_deployment.m. For example, it may return '736430'. UTC is a successor to Greenwich Mean Time. It doesn't observe daylight savings time.
Print coordinated universal time in string format including month,day,year,hour, and minute. For example, it may print 'Apr 14 2016 13:51'. Used by plot_imet_argos.m. UTC is a successor to Greenwich Mean Time. It doesn't observe daylight savings time. get_plot_pars.m
Processes Argos Doppler Position data (rough GPS-like information accurate to about 1000m) for one specific buoy, one specific system by scanning for the appropriate ptt identifier in the Argos raw .mat file. proc_argos_hex() needs to run first in order to generate the raw argos.mat file. The script will append new position data to current position data saved in the sys.mat file located within the buoy's deployment directory.
Process and print out data for one specific instrument:
Defines bit precision, scaling, and offset values necessary to decode each Argos MET variable.
Creates an empty MET structure with a field for each MET variable. This is called the first time a buoy's argos system is processed.
This script will process one specific buoy, one specific system. It translates Argos MET information into an .xml format, performs QC by calling clean_data.m, and sends the output to NDBC via a ftp script. The script also derives dewpoint from ATMP and RH MET variables. Note that NaN values are replaced by -999 per NDBC's request.
This script is located in the MET directory. plot_MET is called by both do_plot_deployment() and do_plot_QC(). It creates a plot of multiple variables (using subplots), from multiple MET systems.
Reads in an argos .dat file, parses out position and MET data into two separate structures, along with some basic meta information. These structures are saved into a .mat file: argos_RAW.mat
Reads in data from raw Argos .mat file, derives a few additional variables (Salinity, wind speed, wind direction, cumulative precipitation), and appends data into sys.mat structure. process_imet() is also responsible for calling ndbc_xml_out() script which forwards information to NDBC. Magnetic wind correction takes place in this script. This function requires GSW MATLab toolkit.
This function calculates the dew point given relative humidity(%) and air temperature(degrees Celsius).
This MATLab script defines the directory structure used by the Argos scripts.