% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/def.srf.filt.R
\name{def.srf.filt}
\alias{def.srf.filt}
\title{Filter Science Review Flag file}
\usage{
def.srf.filt(srf, NameFileOut = NULL, TimeBgn, TimeEnd = NULL, log = NULL)
}
\arguments{
\item{srf}{Data frame of science review flags, as read from NEONprocIS.pub::def.read.srf}

\item{NameFileOut}{Optional. Filename (including relative or absolute path) to write the filtered output.
Defaults to NULL, in which case only the filtered data frame will be returned.}

\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 a the exact time of TimeBgn}

\item{log}{A logger object as produced by NEONprocIS.base::def.log.init to produce structured log
output. Defaults to NULL, in which the logger will be created and used within the function.}
}
\value{
The filtered SRF data frame. If NameFileOut is specified, 
the truncated information will also be written to file in json format (the same json format as the function 
NEONprocIS.pub::def.read.srf expects.
}
\description{
Definition function. Filter a data frame of SRF flags for a particular time range and return information
relevant only to data processing. Any SRF records outside the input time range will be removed from 
the output, and values in user_comment, create_date, and update_date are replaced
with NA (null is written for these fields in the output json file, if an output file is indicated in 
the input parameters). Date-times in the columns start_date and end_date that are outside the time
range of interest will be truncated to the time range of interest. Any start_dates or end_dates that
fall within the time of interest are not modified.  
NOTE: This function does not include error checking of the data frame, since this function is often run 
in a large loop after the input json file has already been checked for conformance to the expected schema. 
If error checking of the srf contents is desired, use a function like NEONprocIS.pub::def.read.srf to 
read in the SRF data fed into this function.
}
\examples{
# NOT RUN
srf <- NEONprocIS.qaqc('/path/to/input/srfs.json')
TimeBgn <- base::as.POSIXct('2018-01-01',tz='GMT)
TimeEnd <- base::as.POSIXct('2018-01-02',tz='GMT)
NameFileOut <- '/path/to/filtered/srfs.json'
srfFilt <- def.srf.filt(srf,NameFileOut,TimeBgn,TimeEnd)
}
\references{
License: (example) GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
}
\seealso{
\link[NEONprocIS.pub]{def.read.srf}
}
\author{
Cove Sturtevant \email{csturtevant@battelleecology.org}
}
\keyword{Currently}
\keyword{none}
