tidy and efficiency fixes

x <- x[segments, ] is faster
working on a list of input list(datetime, light) is faster, but needs
thought
Merge branch 'Curve' of https://github.com/SWotherspoon/SGAT into Curve