rfcx / arbimon

Ecoacoustic analysis platform empowering conservationists to analyze acoustic data and to derive insights about the ecosystem at scale
https://arbimon.org
Apache License 2.0
0 stars 1 forks source link

Create playlists with specific time #2045

Closed koonchaya closed 2 weeks ago

koonchaya commented 2 weeks ago

Original post: https://rfcx.slack.com/archives/C03FD1WD02J/p1718121011400169 @carlybatist

Create the following two playlists :

  1. Daytime Playlist:
    • Time Frame: From 5 AM to 7 PM.
    • Recording Interval: One minute of recording every five minutes.
  2. Nighttime Playlist:
    • Time Frame: From 6 PM to 6 AM.
    • Recording Interval: One minute of recording every five minutes.

Project https://arbimon.org/p/tnc-rfcx-biodiversity-in-parque-nacional-braulio-carrillo-and-la-selva-oet/overview

antonyharfield commented 2 weeks ago

I'm working on this now @rassokhina-e as Carly has asked for it urgently

antonyharfield commented 2 weeks ago

Some of the queries used

select project_id from projects where url = 'tnc-rfcx-biodiversity-in-parque-nacional-braulio-carrillo-and-la-selva-oet';
select * from playlists where project_id = 5853;
select count(1) from recordings where site_id in (select site_id from sites where project_id = 5853) and hour(datetime) between 5 and 18 and minute(datetime) mod 5 = 0; -- returned 203605
select count(1) from recordings where site_id in (select site_id from sites where project_id = 5853) and (hour(datetime) < 6 or hour(datetime) >= 18) and minute(datetime) mod 5 = 0; -- returned 175115
insert into playlist_recordings select 34815 playlist_id, recording_id from recordings where site_id in (select site_id from sites where project_id = 5853) and hour(datetime) between 5 and 18 and minute(datetime) mod 5 = 0;
insert into playlist_recordings select 34816 playlist_id, recording_id from recordings where site_id in (select site_id from sites where project_id = 5853) and (hour(datetime) < 6 or hour(datetime) >= 18) and minute(datetime) mod 5 = 0;