Create an oce file by copying the first n
data chunks of another such file.
This can be useful in supplying small sample files for bug reports. Only
a few file types (as inferred with oceMagic()
) are permitted.
oceFileTrim(infile, n = 100L, outfile, debug = getOption("oceDebug"))
oceFileTrim()
returns the name of the output file, either provided
in the outfile
parameter or constructed by this function.
name of an AD2CP source file.
integer indicating the number of data chunks to keep. The default is to keep 100 chunks, a common good choice for sample files.
optional name of the new file to be created. If this is not
supplied, a default is used, by adding _trimmed
to the base filename, e.g.
for an AD2CP file named "a.ad2cp"
, the constructed value of outfile
will
be a_trimmed.ad2cp
.
an integer value indicating the level of debugging. If this is 1L, then a brief indication is given of the processing steps. If it is > 1L, then information is given about each data chunk, which can yield very extensive output.
# Can only be run by the developer, since it uses a private file.
f <- "~/Dropbox/oce_secret_data/ad2cp/byg_trimmed.ad2cp"
if (file.exists(f)) {
oceFileTrim(f, 10L) # this file holds 100 data segments
}
Dan Kelley
Other functions that trim data files:
adpAd2cpFileTrim()
,
adpRdiFileTrim()
,
advSontekAdrFileTrim()