dcc-lab / projetneige Goto Github PK
View Code? Open in Web Editor NEWprojetNeige
projetNeige
Runs 10h everyday from 6h56 to 16h56 before time change. 7h56 to 17h56 after time change (seen from outside).
((tm.Hour>=7) && (tm.Hour<=17))
which implies 7am to 6pm. This is WRONG. Looking thoroughly at the data AND the server backprop correction algorithm which considers 10h uptime, the Arduino code was probably updated locally before deployment to ((tm.Hour>=7) && (tm.Hour<=16))
, which means 7am to 5pm.t_i = T - (57s * (N-i))
t_i
falls back earlier than 7am (up to 6pm* ), the timestamp is shifted back by 14 hours.* this 6pm condition is weird I know but should almost never happen anyway. But that's already a potential error for large data packets.
Server-side code backtrack algorithm
def backTrackTime(filePath, index=0, delta=1):
timeObject = datetime.fromtimestamp(pathlib.Path(filePath).stat().st_ctime)
correctTime = timeObject - timedelta(seconds=57 * delta * index)
shiftTime = correctTime + timedelta(minutes=4) # opens at 6h56, not 7
if shiftTime.hour < 7 or shiftTime.hour > 17:
correctTime = correctTime - timedelta(hours=14)
return correctTime
Because data packets are sent with no timestamps, if the data packet is large (covers lets say 8 hours of data), there is a chance that the hardware did NOT actually worked at all for lets say 30 minutes during that 8.5 hours of "uptime". The backtracking algorithm has no idea when the system skipped measurements, so this 8 hours of data is uniformly distributed in the past 8 hours / 8.5 hours. So if this data packet is received at 17h, it will backtrack to 9am only and there will be NO logged data between 8h30 to 9h.
Other 2 interesting cases when data packet has to be backtracked to the previous day:
Before time change (correct) [measurements are done from 7am to 5pm]:
If the packet is received at noon, it will first evenly backtrack up to 4am. The data from 4am to 7am will be shifted back by 14 hours and land the previous day from to 14h to 17h.
After time change (incorrect) [meaasurements are done from 8am to 6pm] :
Same thing initially: "If the packet is received at noon, it will first evenly backtrack up to 4am. The data from 4am to 7am will be shifted back by 14 hours and land the previous day from to 14h to 17h. "
However, the data from 7am to 8am will be left there (BAD) instead of being moved to the previous day from 17h to 18h. This requires attention / correction.
Another intersecting case (that probably never happened though) related to the 6pm condition above.
If the data packet contains 20 hours of data and is received at noon. The data is first evenly backtracked back up to 16h the previous day. The overnight data from 6pm to 7am is shifted back by 14 hours, landing between 4am and 5pm the previous day. The data that landed between 4am and 7am would unfortunately stay there instead of being shifted back again by 14 hours. And the initial backtracked data from 4pm to 6pm will also stay there instead of being shifted back by 2*14 hours ...
Im not so sure about that since I think I remember backtracking multiple days in a single packet correctly... Hard to tell, but lets forget about this rare case for now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.