-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed project to package. Folder structure overhauled, roxygen comm…
…ents added, very little content changed.
- Loading branch information
1 parent
f19e85a
commit 27e5c87
Showing
65 changed files
with
1,026 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^devel/* | ||
^Misc/* | ||
^MatlabBinaryFiles/* | ||
^TestFiles/* | ||
^README\.Rmd$ | ||
^README-.*\.png$ | ||
^NEWS\.Rmd$ | ||
^NEWS\.md$ | ||
tar.gz$ | ||
.gitignore | ||
^\.travis\.yml$ | ||
^appveyor\.yml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Package: PamBinaries | ||
Title: Loads Pamguard Binary Data | ||
Version: 1.0 | ||
Authors@R: person("Taiki", "Sakai", email = "taiki.sakai@noaa.gov", role = c("aut", "cre")) | ||
Description: Loads binary file output from Pamguard into R. This is a translation of Matlab | ||
code written by Michael Oswald. | ||
Depends: R (>= 3.4.0) | ||
License: GNU General Public License | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.0.1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(loadPamguardBinaryFile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 4 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: XeLaTeX | ||
|
||
BuildType: Package | ||
PackageUseDevtools: Yes | ||
PackageInstallArgs: --no-multiarch --with-keep.source | ||
PackageRoxygenize: rd,collate,namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#' @title Count Number of Active Channels | ||
#' | ||
#' @description Counts the number of active channels | ||
#' given a channel mapping | ||
#' | ||
#' @param channelMap Mapping of channels as a binary number | ||
#' | ||
#' @return The number of active channels (number of ones) | ||
#' | ||
#' @author Taiki Sakai \email{taiki.sakai@noaa.gov} | ||
#' | ||
#' @note Altered from original script to loop through 30 instead | ||
#' 32 because R stores only 32 bit integers. Should not ever have | ||
#' enough channels for this to matter. | ||
#' | ||
countChannels <- function(channelMap) { | ||
nC <- 0 | ||
j <- 1 | ||
for(i in 1:30) { | ||
if(bitwAnd(channelMap, j) != 0) { | ||
nC <- nC + 1 | ||
} | ||
j <- j * 2 | ||
} | ||
return(nC) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#' @title Convert Date Number to Milliseconds | ||
#' | ||
#' @description Converts numeric date to millisecond date. | ||
#' | ||
#' @param datenum Numeric value of a date. | ||
#' | ||
#' @return Date as milliseconds | ||
#' | ||
#' @author Taiki Sakai \email{taiki.sakai@noaa.gov} | ||
#' | ||
#' @note Conversion to milliseconds to match how Java stores | ||
#' dates. Doesn't appear to ever be used. | ||
#' | ||
dateNumToMillis <- function(datenum) { | ||
datenum * 1000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#' @title Convert Java Millisecond Time to R | ||
#' | ||
#' @description Converts Java millisecond time into numeric | ||
#' time that R uses. | ||
#' | ||
#' @param millis Millisecond time from Java | ||
#' | ||
#' @return Numeric time used by R. | ||
#' | ||
#' @author Taiki Sakai \email{taiki.sakai@noaa.gov} | ||
#' | ||
#' @note Original function was more relevant as Matlab and Java | ||
#' use different time origins. Java & R both use 1970-01-01, | ||
#' but Java stores as milliseconds vs seconds in R. | ||
#' | ||
millisToDateNum <- function(millis) { | ||
millis / 1000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#' @title Read Click Footer | ||
#' | ||
#' @description Reads module footer information for the Click Detector module. | ||
#' Note that sometimes there is no additional footer information, so check | ||
#' first whether or not the binaryLength variable is 0. | ||
#' | ||
#' @param file binary file to be read | ||
#' | ||
#' @return footer information for Click Detector module | ||
#' | ||
#' @author Taiki Sakai \email{taiki.sakai@noaa.gov} | ||
#' | ||
readClickFooter <- function(file) { | ||
footer <- readStdModuleFooter(file) | ||
if(footer$binaryLength != 0) { | ||
footer$typesCountLength <- pamBinRead(file, 'int16', n=1) | ||
footer$typesCount <- pamBinRead(file, 'int32', n=footer$typesCountLength) | ||
} | ||
return(footer) | ||
} |
Oops, something went wrong.