Replies: 4 comments 1 reply
-
How does BirdNET do with nocturnal migration calls? Is the new model any different? My current microphone set up doesn't really lend itself well to gathering flight calls, but I'm interested! I might set up another Pi or perhaps add another microphone and work on figuring out how to switch from a day microphone to a night microphone after sunset. |
Beta Was this translation helpful? Give feedback.
-
Hey, I'm all for little improvements and customizations like this! Though I want to make sure I fully understand the feature. So you're saying that basically everything in the UI would stay the same, except we'd only be querying the database for detections during the time frame you specified? |
Beta Was this translation helpful? Give feedback.
-
Yep, that's exactly what I had in mind, creating a time-based "window" into
the detections without having to delete anything.
I've come up with a quick hack in python to find the "NocMic" times based
on lat and long from birdnet.conf, please forgive my poor python skills,
for some reason it always turns out looking like (ugly) perl :-)
It requries the "astral" python package from pypy.
All the best,
Uwe
```python
import datetime, time
from astral.sun import sun
from astral import LocationInfo
DEBUG=True
BIRDNET_CONFIG="birdnet.conf"
#BIRDNET_CONFIG="/etc/birdnet/birdnet.conf"
config = {}
with open(BIRDNET_CONFIG) as f:
for l in f.readlines():
if l.find("#") == 0 or len(l)<2: # skip empty & comment lines
continue
(arg, val) = l[:-1].split("=") # split & remove newlines
config[arg] = val
print ("Configuration read from %s:", BIRDNET_CONFIG)
for k in config.keys():
if len(config[k]) >0:
print(k, config[k])
LOCAL_TZ=datetime.datetime.utcnow().astimezone().tzinfo
print ("System timezone: ", LOCAL_TZ)
city = LocationInfo("MyPlace",
"MyCountry",
LOCAL_TZ,
config["LATITUDE"],
config["LONGITUDE"])
print((
f"Information for {city.name}/{city.region}\n"
f"Timezone: {city.timezone}\n"
f"Latitude: {city.latitude:.02f}; Longitude: {city.longitude:.02f}\n"))
# calculate NocMic's start and end time
# (dusk of the previous day until dawn of today)
s_yesterday = sun(city.observer, date=datetime.date.today() -
datetime.timedelta(days=1))
s_today = sun(city.observer, date=datetime.date.today())
night = s_yesterday["dusk"]
morning = s_today["dawn"]
print((
f'NocMic Start: {night}\n'
f'NocMic End : {morning}\n'
))
```
|
Beta Was this translation helpful? Give feedback.
-
Very cool, thanks for your consideration! It would be great if one could configure a buffer time of sorts (say, an hour before sunrise and an hour after sunset) to adapt the "window" to your own preferences. |
Beta Was this translation helpful? Give feedback.
-
Hi folks,
first of all thanks again for your work on this project! It's a fascinating pastime to be sure and it has added a lot of species to my "garden list" which I would not have expected otherwise, esp. at night. So here's a feature I'd like to see and possibly help test / implement: What would you think of a "NocMic View" that lists only detections (a subset of the 24x7 db) from the period beginning one hour after sunset and ending one hour before sunrise? These times could be calculated dynamically from the user's location and the current date (with the "before" and "after" times maybe configurable via the options / birdnet.conf).
I'm sorry in advance if this is already possible by using some clever query language, and it'd be nice to have this view available with a single click in the UI nonetheless :-)
Thanks for your consideration & all the best,
Uwe
Beta Was this translation helpful? Give feedback.
All reactions