You are not logged in. Log in
|
|
Rawarch pluginFrom $1Table of contentsThis plugin serves to record raw data along with some of the parameters describing it. It is intended Format of a raw archiveThe rawarch plugin uses radR's biglist and bigframe packages to save data as a big R list in a file. > library("bigframe", lib.loc="/path/to/radR") ## load the bigframe package > library("biglist", lib.loc="/path/to/radR") ## load the biglist package > bl <- biglist("mybigfile.raw") ## open an existing rawarch file
After loading them, you can use ?bigframe and ?biglist to learn more about these packages. 1. The header (item 1)The first item in the biglist is a table of contents for the archive, because the raw archive > bl[[1]]
Timestamps should be relative to universal time, and can be converted to date times as so: > structure(bl[[1]]$start.time, class="POSIXct") [1] "2006-03-06 14:41:31 EST" "2006-03-06 15:35:52 EST" Note that the total number of scans in this raw archive is given by: > sum(bl[[1]]$num.scans) 2. The scan parameters (items 2, 4, 6, ...)The even numbered items in the biglist are the parameters for scans 1, 2, 3, and so on. Scans parameters are stored in the order dictated by the table of contents. For the file in the example, the parameter sets for the 711 scans from the first run are in biglist items 2, 4, 6, ..., 1422; these are followed by parameter sets for the 261 scans from the second run in biglist items 1424, 1426, 1428, ..., 1944; and so on. For example, the parameters for the first scan are: > bl[[2]] $bits.per.sample ## the bit resolution of each sample $timestamp $time.offset ## for more precise timing, this is the $duration $sample.dist ## distance covered by one sample, in metres $first.sample.dist ## distance from the radar of the first sample $bearing ## degrees clockwise from north of the first pulse $orientation ## radar rotation direction: +1 = clockwise, -1=counterclockwise $latitude ## geographic location of the radar antenna(optional) $longitude 3. The raw scan data (items 3, 5, 7, ...)The odd numbered items in the biglist (except for item 1) are string vectors with single elements containing the raw scan data in binary form. Scans are stored in the order dictated by the table of contents. For the file in the example, the 711 scans from the first run are in biglist items 3, 5, 7, ..., 1423; these are followed by the 261 scans from the second run in biglist items 1425, 1427, 1429, ..., 1945; and so on. Unlike in C, strings in R can have embedded NULL (0x00) characters . The only reason we don't use an R raw vector is that (surprisingly) R handles raw vectors much less efficiently than character vectors when reading/writing them from/to files. Samples are packed as tightly as possible into the R string. Samples occupying more than one byte have their data stored in order from least significant to most significant (i.e. little-endian), as is standard for i386-family computers.
> class(bl[[3]]) > length(bl[[3]]) > nchar(bl[[3]]) > charToRaw(substr(bl[[3]],1,16)) The the nibble-packing order for 12-bit data is as follows: i.e. two 12 bit words: 0x0CBA, 0x0FED <--> 0xAB, 0xCD, 0xEF (3 bytes)
Was this page helpful?
Tags: (Edit tags)
|
Powered by MindTouch Core |