% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/def.grp.trnc.actv.R
\name{def.grp.trnc.actv}
\alias{def.grp.trnc.actv}
\title{Truncate active periods in group file to date-time range of interest}
\usage{
def.grp.trnc.actv(
  NameFileIn,
  NameFileOut = NULL,
  TimeBgn,
  TimeEnd = NULL,
  log = NULL
)
}
\arguments{
\item{NameFileIn}{Filename (including relative or absolute path). Must be json format.}

\item{NameFileOut}{Filename (including relative or absolute path). Must be json format. Defaults to
NULL, in which case only the filtered json will be returned in list format}

\item{TimeBgn}{POSIX timestamp of the start time (inclusive)}

\item{TimeEnd}{POSIX timestamp of the end time (non-inclusive). Defaults to NULL, in which case the
group information will be filtered for the exact time of TimeBgn}
}
\value{
The file in list format with truncated active dates. If NameFileOut is specified, 
the truncated information will also be writted to file in the same json format of NameFileIn. 
If an active period is empty or becomes empty during truncation (completely outside the range of interest), the 
entire group is removed. If no active groups remain, no file is written.
}
\description{
Definition function. Read in a group JSON file and truncate the active periods to the date-time range of interest. 
NOTE: This function does not include error checking of the input json, since this function is often run 
in a large loop after the input json has already been checked for conformance to the expected schema. 
If error checking of the input json is desired, use a function like NEONprocIS.base::def.loc.meta prior
to executing this function.
}
\examples{
TimeBgn <- base::as.POSIXct('2018-01-01',tz='GMT)
TimeEnd <- base::as.POSIXct('2018-01-02',tz='GMT)
NameFileIn <- 'groups.json'
NameFileOut <- 'filtered_groups.json'
listFile <- def.grp.trnc.actv(NameFileIn,NameFileOut,TimeBgn,TimeEnd)
}
\references{
License: (example) GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
}
\seealso{
Currently none
}
\author{
Cove Sturtevant \email{csturtevant@battelleecology.org}
}
\keyword{Currently}
\keyword{none}
