Comments (3)
Continuing to think about this issue, I currently think the following would be best:
- Store times in an archive as UTC.
- Include station timezone information in an archive. I'm not sure yet exactly what form this will take, but it might include a standard time UTC offset, an indication of whether or not DST is observed, and if so, the DST start and end times for each year for which there are data in the archive. This might be accomplished with two tables, a TimeZone table and a DST table. The TimeZone table might have columns for time zone name (e.g. US Eastern), UTC offset, and DST name (e.g. US). The DST table might have columns for DST name (e.g. US), year, start time, and end time.
Tools like the NFC Wrangler that add clips to an archive will need to be able to convert local times to UTC as needed. Tools like the NFC Viewer that present clips from an archive should allow the user to choose whether displayed times are UTC, local standard time, or local daylight time.
from vesper.
In an NFC archive:
- Each clip has a UTC start time.
- Each clip is assigned to a night, which is the local start date of the night on which the clip was recorded.
- Each station has an associated time zone. As far as I am aware, the Olsen time zone database includes all of the time zones that we might need.
In our implementation of this:
- The start time of a clip will be represented in Python as an aware (i.e. with an appropriate UTC
tzinfo
)datetime
object. Note that adatetime
can easily be converted to a local time using thedatetime.astimezone
function. I believe we can usepytz
time zones for all the stations of which I am aware. - As in the current implementation, the night of a clip will be represented in the database as a 7-digit integer of the form YYYYMMDD, but in Python code as a
date
object. We might consider changing the database implementation to a date, however, unless that's a lot slower. It's also not clear to me that we really need to store nights at all. Would it suffice to define a night as a certain UTC time interval (e.g. noon to noon local time) and use that interval for queries? We currently use nights to help accelerate queries that return clip counts, but I suspect that we may just want to store the clip counts directly (adding some redundancy to archives, but facilitating certain kinds of analyses), which might reduce the need for storing nights. - The time zone of a station will be represented in the database by its Olson name (e.g. "US/Eastern"), and in Python code as an appropriate
timezone
instance obtained frompytz
. If it turns out that at some point we need time zones that are not in the Olson database, we can use non-Olson names for them and provide some fallback mechanism for obtaining whatever information is needed from the names.
from vesper.
The archive now requires that clip times be specified (to the add_clip
method) with the pytz.utc
time zone, and also yields them (via the get_clips
method) in that form. Each station has a time zone, stored persistently as an Olson time zone name. The viewer displays clip times in the local time zone.
from vesper.
Related Issues (20)
- Recordings cannot have capitalized file-endings HOT 2
- European classifiers HOT 2
- Migration froze HOT 4
- Tracking analysis of recordings HOT 2
- Some automatically-created annotations do not include creating job or creating processor. HOT 2
- Add command to repair archives affected by bug of issue #211.
- Allow multiple clips with same detector, recording channel, and start time.
- Shortcut for switching classifiers HOT 4
- Audio import shows wrong date HOT 4
- Review and improve recording file name parsing. HOT 2
- Vesper 0.4.13 installation fails on Apple Silicon Macs. HOT 1
- Add constant value clip measurement.
- Alert users to logged warnings.
- Running Nighthawk in Docker/Compose HOT 2
- Issue importing recordings HOT 2
- Attempt to read audio file metadata failed with message: unknown format: 3 HOT 3
- Could not find recorder for recording file when importing HOT 3
- Unclear how to cite Vesper HOT 2
- Vesper server does not handle nonexistent clip calendar detector well.
- Clip calendar raises exception if classification annotation has no annotation constraint. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vesper.