Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time handling and assumptions #82

Open
bpbond opened this issue Jun 17, 2022 · 0 comments
Open

Time handling and assumptions #82

bpbond opened this issue Jun 17, 2022 · 0 comments

Comments

@bpbond
Copy link
Member

bpbond commented Jun 17, 2022

Currently before process_teros() returns data, it filters to the last five days:

teros_primitive %>%
        mutate(diff = difftime(Sys.time(), TIMESTAMP, units = "days")) %>%
        filter(diff < 5)

Conversely, process_sapflow() doesn't do any filtering at all.

The dashboard graphs display the last X hours of data in the dataset, not (contrary to what the comment below says) from the current system time:

# TODO: back from present? Or back from latest timestamp in data?
GRAPH_TIME_WINDOW <- 3 * 24   # hours back from present
FLAG_TIME_WINDOW <- 1         # hours back from present

               + coord_cartesian(xlim = c(latest_ts - GRAPH_TIME_WINDOW * 60 * 60, latest_ts)) ->

The out-of-limits computation for the sapflow badge also uses last X hours from last timestamp, not present:

        sapflow %>%
            filter(Timestamp > (max(Timestamp) - FLAG_TIME_WINDOW * 60 * 60)) %>%
            summarise(flag_sensors(Value, limits = SAPFLOW_RANGE)) ->
            sapflow_bdg

So we have a fair amount of inconsistency. Flagging this for discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant