% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/def.loc.trnc.actv.R
\name{def.loc.trnc.actv}
\alias{def.loc.trnc.actv}
\title{Truncate active periods in location-based location file to date-time range of interest}
\usage{
def.loc.trnc.actv(
  NameFileIn,
  NameFileOut = NULL,
  TimeBgn,
  TimeEnd = NULL,
  Prop = "all",
  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
location information will be filtered for the exact time of TimeBgn}

\item{Prop}{character vector of the properties in the location file to retain. Defaults to 'all', 
in which all properties of the original file are retained. Include here the names of properties embedded
at the top level of each location install entry (e.g. "HOR","VER","Data Rate") as well as within the 
"properties" list of each location install entry (e.g. "context","IS Default Processing Start Date",
"name","site","domain"). Note that 'active_periods' are always retained. Also note that omission of
some properties may limit the downstream modules that are able to be run (such as regularization if 
'Data Rate' is not retained)}
}
\value{
A list of location information with truncated active dates. If NameFileOut is specified, 
the truncated location information will also be writted to file in the same json format of NameFileIn
}
\description{
Definition function. Read in a location JSON file for a particular named location
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.
}
\examples{
TimeBgn <- base::as.POSIXct('2018-01-01',tz='GMT)
TimeEnd <- base::as.POSIXct('2018-01-02',tz='GMT)
NameFileIn <- 'locations.json'
NameFileOut <- 'filtered_locations.json'
loc <- def.loc.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}
