Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f9bc900
add and change functions
Gre51 Sep 5, 2025
e78bfcd
create the usalble case notebook
Gre51 Sep 5, 2025
76d1336
create yaml for CPOD
Gre51 Sep 5, 2025
81a0248
add new functions, correct others
Gre51 Sep 9, 2025
9bb3475
change notebook config
Gre51 Sep 9, 2025
566cffd
change notebook config
Gre51 Sep 26, 2025
15c6677
add new functions
Gre51 Sep 26, 2025
2513363
Merge branch 'main' into notebook_test
Gre51 Sep 26, 2025
a71dd13
ruff changes
Gre51 Sep 26, 2025
c30a9de
add new usages
Gre51 Sep 26, 2025
d89604c
correct some functions
Gre51 Sep 30, 2025
5bddac0
add details
Gre51 Sep 30, 2025
acafaeb
modify functions
Gre51 Oct 14, 2025
5be166a
add comments
Gre51 Oct 14, 2025
9b6fa59
create test sheet
Gre51 Oct 14, 2025
a816a06
create user case notebooks
Gre51 Oct 21, 2025
48ac54f
add new tests
Gre51 Oct 21, 2025
804c848
correct functions
Gre51 Oct 21, 2025
e0bd15f
change path
Gre51 Oct 21, 2025
f5529ac
adapt functions changes
Gre51 Oct 21, 2025
bc3719a
adapt functions changes
Gre51 Oct 24, 2025
c3a0000
simplify functions
Gre51 Oct 24, 2025
87d8cb5
add tests
Gre51 Oct 24, 2025
885b0b5
change some functionalities
Gre51 Oct 24, 2025
211a7d8
add new notebook
Gre51 Oct 24, 2025
ba07b59
add comments and functions to the notebooks
Gre51 Oct 28, 2025
9916c15
simplify some functionalities
Gre51 Oct 28, 2025
8a3a7c7
add comments
Gre51 Oct 28, 2025
cab4f64
add a precision in csv_folder()
Gre51 Nov 5, 2025
1fafdaa
create new functions to process TimeLost
Gre51 Nov 5, 2025
bfe3124
change everything to comment
Gre51 Nov 7, 2025
883640c
notebooks
Gre51 Nov 7, 2025
73bcbb5
add functions to process time lost
Gre51 Nov 7, 2025
dfb68de
notebooks
Gre51 Nov 7, 2025
2e05346
add config files
Gre51 Nov 7, 2025
408ca73
correct some docstrings
Gre51 Nov 12, 2025
8d16c8b
modify feeding buzz processing
Gre51 Nov 12, 2025
570b4c8
remove useless functions
Gre51 Nov 12, 2025
491a36b
correct docstrings
Gre51 Nov 13, 2025
ae4cf23
correct docstrings
Gre51 Nov 13, 2025
d01614e
change feeding_buzz() function
Gre51 Nov 13, 2025
24f209f
reorganise notebooks
Gre51 Nov 13, 2025
a5839ca
merge main
Gre51 Nov 14, 2025
0110061
Merge branch 'main' into notebook_test
Gre51 Nov 14, 2025
7d5dd7b
ruff corrections
Gre51 Nov 14, 2025
0bc968d
update notebooks
Gre51 Nov 19, 2025
1e61fe5
update feeding_buzzes
Gre51 Nov 19, 2025
5989959
Merge branch 'main' into notebook_test
Gre51 Nov 20, 2025
b8b0177
adjust notebook
Gre51 Nov 20, 2025
5f1b56b
correct feeding buzzes function
Gre51 Nov 20, 2025
672d392
add new figures
Gre51 Nov 24, 2025
7ca69e9
correct some functions
Gre51 Nov 24, 2025
8949aea
Merge branch 'main' into notebook_test
Gre51 Nov 25, 2025
87f291e
change colors assignment
Gre51 Jan 20, 2026
e530c60
modify notebook
Gre51 Jan 20, 2026
ca8f250
modify pod2aplose
Gre51 Jan 20, 2026
833c7ec
start fpod_utils tests
Gre51 Jan 20, 2026
9a6b216
test audio_utils
mathieudpnt Nov 25, 2025
a61e2ab
test core_utils
mathieudpnt Nov 25, 2025
5c1bf9b
test core_utils
mathieudpnt Nov 25, 2025
a80b3b2
filtering_utils
mathieudpnt Nov 26, 2025
1a08e23
metric_utils
mathieudpnt Nov 26, 2025
a655ecf
ruff fixes
mathieudpnt Nov 26, 2025
a6926c2
ruff fix
mathieudpnt Nov 26, 2025
2d07f47
plot_utils
mathieudpnt Nov 26, 2025
c9e7042
ruff
mathieudpnt Nov 26, 2025
b3cbc6c
filtering bug and test modification from is_box to type column
mathieudpnt Dec 4, 2025
23d2ba5
add weak detection line
mathieudpnt Dec 5, 2025
f44d886
plot color bug fix
mathieudpnt Dec 9, 2025
a5327f4
fix test
mathieudpnt Dec 9, 2025
741d902
correction of reshape_timebin() wav names
MaelleTtrt Nov 5, 2025
e7a408b
changes related to fix of reshape_timebin
MaelleTtrt Nov 5, 2025
beceeff
fix ruff
MaelleTtrt Nov 5, 2025
1ce567d
add import
Dec 5, 2025
34f2bcb
rebase with new upstream
MaelleTtrt Dec 16, 2025
dfaad02
fix_ruff
MaelleTtrt Dec 16, 2025
8235c53
fix_ruff2
MaelleTtrt Dec 16, 2025
aea8759
find_delimiter func and test improved
mathieudpnt Dec 17, 2025
cdc98d6
filtering_utils docstrings
mathieudpnt Dec 17, 2025
1ee5d7d
recursive pgdf file fix
mathieudpnt Jan 19, 2026
c056a15
DetectionFilter stale arg
mathieudpnt Jan 20, 2026
e505033
Merge branch 'main' of https://github.com/Project-OSmOSE/OSmOSE_post_…
Gre51 Jan 20, 2026
b0bbee6
initiate fpod_utils tests
Gre51 Jan 20, 2026
76f6645
remove sklearn
Gre51 Jan 20, 2026
3e4fff1
remove sklearn
Gre51 Jan 20, 2026
7466a5b
clean tests
Gre51 Jan 20, 2026
466d104
Merge branch 'main' of https://github.com/Project-OSmOSE/OSmOSE_post_…
mathieudpnt Jan 23, 2026
2a5a8c8
refacto
mathieudpnt Jan 26, 2026
f0adf5b
refacto
mathieudpnt Jan 27, 2026
6710812
refacto
mathieudpnt Jan 27, 2026
234fec5
Merge pull request #3 from mathieudpnt/test/elise-br
Gre51 Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/post_processing/dataclass/data_aplose.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,15 @@ def plot(
season = kwargs.get("season", False)
effort = kwargs.get("effort")

return scatter(df=df_filtered,
ax=ax,
time_range=time,
show_rise_set=show_rise_set,
season=season,
coordinates=self.coordinates,
effort=effort,
)
return scatter(
df=df_filtered,
ax=ax,
time_range=time,
show_rise_set=show_rise_set,
season=season,
coordinates=self.coordinates,
effort=effort,
)

if mode == "agreement":
bin_size = kwargs.get("bin_size")
Expand All @@ -452,7 +453,11 @@ def plot(
label,
)

return timeline(df=df_filtered, ax=ax, color=color)
return timeline(
df=df_filtered,
ax=ax,
color=color,
)

msg = f"Unsupported plot mode: {mode}"
raise ValueError(msg)
Expand Down
44 changes: 43 additions & 1 deletion src/post_processing/utils/core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import astral
import easygui
import numpy as np
from astral.sun import sunrise, sunset
from astral import LocationInfo
from astral.sun import sunrise, sunset, sun
from matplotlib import pyplot as plt
from osekit.config import TIMESTAMP_FORMAT_AUDIO_FILE
from osekit.utils.timestamp_utils import strftime_osmose_format, strptime_from_text
Expand Down Expand Up @@ -579,3 +580,44 @@ def timedelta_to_str(td: Timedelta) -> str:
if seconds % 60 == 0:
return f"{seconds // 60}min"
return f"{seconds}s"


def assign_light_regime(
ts: Timestamp,
lat: float | None = None,
lon: float | None = None,
) -> DataFrame:
"""Assign daylight regime to temporal events.

Parameters
----------
ts: Timestamp
Timestamp to assign a light regime to.
lat: float
The latitude of corresponding point.
lon: float
The longitude of corresponding point.

Returns
-------
DataFrame
The same dataframe with the column daytime.

"""
if not all([lat, lon]):
lat, lon = get_coordinates()

# Get sun times for given location
location = LocationInfo(latitude=lat, longitude=lon)
s = sun(location.observer, date=ts.date())

if ts < s['dawn']:
return 'night'
elif ts < s['sunrise']:
return 'dawn'
elif ts < s['sunset']:
return 'day'
elif ts < s['dusk']:
return 'dusk'
else:
return 'night'
13 changes: 7 additions & 6 deletions src/post_processing/utils/filtering_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ def _process_annotator_label_pair(
]
file_vector = [
filename_vector[i] for i, detected in enumerate(detect_vec) if detected
# filename_vector[i + 1] for i, detected in enumerate(detect_vec) if detected
]

if not start_datetime:
Expand All @@ -510,8 +511,8 @@ def reshape_timebin(
timebin_new: Timedelta
The size of the new time bin.
timestamp_audio: list[Timestamp]
A list of Timestamp objects corresponding to the start of each wav
that corresponds to a detection
A list of Timestamp objects corresponding to the shape
in which the data should be reshaped.

Returns
-------
Expand Down Expand Up @@ -572,10 +573,10 @@ def get_filename_timestamps(df: DataFrame, date_parser: str) -> list[Timestamp]:
"""
tz = get_timezone(df)
timestamps = [
strptime_from_text(
ts,
datetime_template=date_parser,
) for ts in df["filename"]
strptime_from_text(
ts,
datetime_template=date_parser,
) for ts in df["filename"]
]

if all(t.tz is None for t in timestamps):
Expand Down
Loading
Loading