Gbin lesson
------------
::
Notes on the data hierarchy for UHDAS logging:
Data logs under /home/data/cruiseid
/home/adcp/cruiseid is a link to where data is logged.
The link is created when the cruise is started (startcruise) and
removed when the cruise is ended (endcruise). If you choose
a cruiseid that exists, you are told it exists and asked if you
want to continue logging there.
Generally, under
/home/data/cruiseid/ are the following subdirs:
raw/
rbin/
gbin/
proc/
---------------------raw and rbin---------------------------------
------------------------
------------------------
raw data:
nb150 *.raw and os38 *.raw are binary files. The log files and all of the
navigation files are ascii.
log and nav files generally have alternating lines of computer time stamps
and messages.
$UNIXD,peale_time
$NMEA,ascii NMEA message
for instruments that send multiple messages, there should be a Unix time stamp
for every message, e.g., for the Ashtech there should be
$UNIXD,
$PASHR,ATT
$UNIXD,
$PASHR,GGA,
------------------------
------------------------
rbin data:
The raw instrument files are ready to be loaded into matlab using an
overloaded methods read function in your path if you run radcppath.m
(must specify instrument class).
Matlab loadable files for all of the raw ascii nav messages must be
created (raw binary or rbin). Each message is parsed and assigned a
Unix time stamp. There is a 1:1 correspondence between the raw file
name and the rbin file name.
Load in matlab using something like this-
[rdata, rstruct] = read_bin(file);
e.g., for the $GPGGA message, the structure looks like
rstruct:
rstruct.message
rstruct.rows
{'u_dday'
'dday_frac'
'lon'
'lat'
'qual'
'hdop'
}
For an instrument like Ashtech where multiple messages are logged, there is
an rbin file created for each type of data, i.e., one for the position (GGA)
and one for the attitude (ATT) messages.
------------------------
------------------------
Example of the directory structure and naming convention:
raw/ rbin/
nb150/
*.raw (np2004_267_35210.raw)
*.log (np2004_267_35210.raw.log)
*.m (np2004_267_35210.m)
os38/
*.raw
*.log
ashtech/ ashtech/
*.adu (np2004_267_35210.adu) *.adu.rbin (np2004_267_35210.adu.rbin)
*.gps.rbin (np2004_267_35210.gps.rbin)
gpsnav/ gpsnav/
*.gps (np2004_267_35210.gps) *.gps.rbin (np2004_267_35210.gps.rbin)
seapath/ seapath/
*.sea (np2004_267_35210.sea) *.sea.rbin (np2004_267_35210.sea.rbin)
*.gps.rbin (np2004_267_35210.gps.rbin)
gyro/ gyro/
*.hdg (np2004_267_35210.hdg) *.hdg.rbin (np2004_267_35210.hdg.rbin)
sndspd/ sndspd/
*.spd (np2004_267_35210.spd) *.hdg.rbin (np2004_267_35210.spd.rbin)
config/
cruise_cfg.m__
cruise_proc.m__
sensor_cfg.py
os_default.cmd
etc.
------------------------
------------------------
gbin
gbin file name is based on the raw data. The gbin is the gridded binary
(gbin) file where all fields are gridded in time. The times in the
instrument log file (e.g., raw/nb150/*.log) are the times that
determine the grid, i.e., the Unix times of instrument pings. The
Ashtech, GPS, seapath, heading, soundspeed are all interpolated to the
Unix times of the pings and put into gbin files. Now, the best time
must be determined (decisions made to keep time monotonic increasing,
and to track any other time corrections). The results of this go into
the files in the time subdir. *.tim.gbin has 3 rows containing: the
Unix pingtimes, the "best" times, and the pc_sec-UTC difference.
*.best.gbin is the gridded "best" values of position and heading, given
that there are multiple sources for these. The decision whether to use
seapath or Ashtech, for example, or which is the primary navigation
device, is NOT made by the program on the fly, but rather is set
initially at the top of the processing path by raw/config/CR_cfg.m
based on cruise_cfg.m__
gbin/
nb150/
ashtech/
*.adu.gbin (np2004_267_35210.adu.gbin)
gpsnav/
*.gps.gbin (np2004_267_35210.gps.gbin)
gyro/
*.hdg.gbin (np2004_267_35210.hdg.gbin)
seapath/
*.sea.gbin (np2004_267_35210.sea.gbin)
*.gps_sea.gbin (np2004_267_35210.gps_sea.gbin)
sndspd/
*.spd.gbin (np2004_267_35210.spd.gbin)
time/
*.tim.gbin (np2004_267_35210.tim.gbin)
*.best.gbin (np2004_267_35210.best.gbin)T
os38/