Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/src/post_processing/utils/matlab_utils/pgmatlab/
/src/disclose/utils/matlab/pgmatlab/
__pycache__/
/.idea/
/dist/
/.venv/
/.venv/
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "OSmOSE_post_processing"
copyright = "2025, Mathieu Dupont"
author = "Mathieu Dupont"
project = "disclOSE"
copyright = "OSmOSE"
author = "OSmOSE"
release = "0.0.1"

# -- General configuration ---------------------------------------------------
Expand All @@ -26,7 +26,7 @@

html_theme = "sphinx_book_theme"
html_logo = "../logo/osekit_small.png"
html_title = "post_processing"
html_title = "disclose"

html_theme_options = {
"repository_url": "https://github.com/mathieudpnt/OSmOSE_post_processing",
Expand Down
61 changes: 51 additions & 10 deletions docs/source/example_APOCADO.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"cell_type": "code",
"execution_count": null,
"id": "6ea41f4ba78fb69f",
"metadata": {},
"metadata": {
"jupyter": {
"is_executing": true
}
},
"outputs": [],
"source": [
"from __future__ import annotations\n",
Expand All @@ -15,14 +19,16 @@
"from pandas import Timedelta\n",
"from pandas.tseries import frequencies\n",
"\n",
"from post_processing.dataclass.data_aplose import DataAplose"
"from disclose.dataclass.data_aplose import DataAplose"
]
},
{
"cell_type": "markdown",
"id": "4b10aaa427d1da6e",
"metadata": {},
"source": "### Load data"
"source": [
"### Load data"
]
},
{
"cell_type": "code",
Expand All @@ -31,8 +37,21 @@
"metadata": {},
"outputs": [],
"source": [
"yaml_file = Path(r\"resource/APOCADO_yaml.yml\")\n",
"data = DataAplose.from_yaml(file=yaml_file)\n",
"config = {\n",
" \"detection_file\": Path(r\"../../user_case/resource/APOCADO_results.csv\"),\n",
" \"timebin_new\": Timedelta(\"60s\"),\n",
" \"filename_format\": \"%Y-%m-%dT%H-%M-%S\",\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "923a565737b4a05a",
"metadata": {},
"outputs": [],
"source": [
"data = DataAplose.from_dict(config)\n",
"data.lat = 47\n",
"data.lon = -5"
]
Expand All @@ -41,7 +60,9 @@
"cell_type": "markdown",
"id": "e17cf669b1d31019",
"metadata": {},
"source": "### Overview"
"source": [
"### Overview"
]
},
{
"cell_type": "code",
Expand All @@ -59,7 +80,9 @@
"cell_type": "markdown",
"id": "29bb29560f971722",
"metadata": {},
"source": "### Single barplot"
"source": [
"### Single barplot"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -91,7 +114,9 @@
"cell_type": "markdown",
"id": "2dd2f7611b2d5d73",
"metadata": {},
"source": "### Multi-barplot"
"source": [
"### Multi-barplot"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -130,7 +155,9 @@
"cell_type": "markdown",
"id": "5d82f65b7966fa04",
"metadata": {},
"source": "### Detection performances"
"source": [
"### Detection performances"
]
},
{
"cell_type": "code",
Expand All @@ -149,7 +176,9 @@
"cell_type": "markdown",
"id": "fdca3535add2d488",
"metadata": {},
"source": "### Agreement"
"source": [
"### Agreement"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -194,6 +223,18 @@
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.3"
}
},
"nbformat": 4,
Expand Down
62 changes: 41 additions & 21 deletions docs/source/example_OHAGEODAMS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
"cell_type": "code",
"execution_count": null,
"id": "initial_id",
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from pathlib import Path\n",
"\n",
"import matplotlib.pyplot as plt\n",
"from osekit.utils.timestamp_utils import strptime_from_text\n",
"from osekit.utils.timestamp import strptime_from_text\n",
"from pandas import Timedelta, Timestamp, read_csv\n",
"\n",
"from post_processing.utils.glider_utils import (\n",
"from disclose.utils.filtering import read_dataframe\n",
"from disclose.utils.glider import (\n",
" compute_acoustic_diversity,\n",
" export_gpx,\n",
" load_glider_nav,\n",
Expand All @@ -27,7 +26,9 @@
"cell_type": "markdown",
"id": "429edfb71ec618a",
"metadata": {},
"source": "### Load data"
"source": [
"### Load data"
]
},
{
"cell_type": "code",
Expand All @@ -36,17 +37,19 @@
"metadata": {},
"outputs": [],
"source": [
"input_dir = Path(r\"resource\\OHAGEODAMS_nav\")\n",
"input_dir = Path(r\"../../user_case/resource/OHAGEODAMS_nav\")\n",
"nav = load_glider_nav(input_dir)\n",
"nav = nav[nav[\"Timestamp\"] > Timestamp(\"2024-02-21\", tz=\"UTC\")]\n",
"df = read_csv(Path(r\"resource\\OHAGEODAMS_results.csv\"), parse_dates=[\"start_datetime\", \"end_datetime\"]).dropna(subset=[\"annotation\"]).reset_index(drop=True)"
"df = read_dataframe(Path(r\"../../user_case/resource/OHAGEODAMS_results.csv\"))"
]
},
{
"cell_type": "markdown",
"id": "303cd23d5b4d12dd",
"metadata": {},
"source": "### Plot detection with nav data"
"source": [
"### Plot detection with nav data"
]
},
{
"cell_type": "code",
Expand All @@ -58,7 +61,12 @@
"ticks = Timedelta(\"1d\")\n",
"\n",
"# plot specific labels\n",
"plot_detections_with_nav_data(df=df[df[\"annotation\"].isin([\"Sperm_Whale\", \"Delphinids clics\"])], nav=nav, criterion=\"Depth\", ticks=ticks)\n",
"plot_detections_with_nav_data(\n",
" df=df[df[\"annotation\"].isin([\"Sperm_Whale\", \"Delphinids clics\"])],\n",
" nav=nav,\n",
" criterion=\"Depth\",\n",
" ticks=ticks,\n",
")\n",
"plt.show()\n",
"\n",
"# plot all labels\n",
Expand All @@ -70,7 +78,9 @@
"cell_type": "markdown",
"id": "798518fc43a69afc",
"metadata": {},
"source": "### Compute acoustic diversity"
"source": [
"### Compute acoustic diversity"
]
},
{
"cell_type": "code",
Expand All @@ -79,19 +89,27 @@
"metadata": {},
"outputs": [],
"source": [
"task_status_filenames = read_csv(r\"resource\\OHAGEODAMS_status.csv\")[\"filename\"]\n",
"time_vector = [strptime_from_text(f, \"%Y_%m_%d_%H_%M_%S\").tz_localize(\"UTC\") for f in task_status_filenames]\n",
"task_status_filenames = read_csv(\n",
" Path(r\"../../user_case/resource/OHAGEODAMS_results.csv\")\n",
")[\"filename\"]\n",
"time_vector = [\n",
" strptime_from_text(f, \"%Y_%m_%d_%H_%M_%S\").tz_localize(\"UTC\")\n",
" for f in task_status_filenames\n",
"]\n",
"\n",
"df_acoustic_div = compute_acoustic_diversity(df=df, nav=nav, time_vector=time_vector)\n",
"\n",
"# df_acoustic_div.to_csv(Path(r'\\output\\path\\acoustic_diversity.csv'), index=False)"
"df_acoustic_div.to_csv(\n",
" Path(r\"../../user_case/output/acoustic_diversity.csv\"), index=False\n",
")"
]
},
{
"cell_type": "markdown",
"id": "aa6d95c921329545",
"metadata": {},
"source": "### Export navigation data to GPX"
"source": [
"### Export navigation data to GPX"
]
},
{
"cell_type": "code",
Expand All @@ -100,27 +118,29 @@
"metadata": {},
"outputs": [],
"source": [
"export_gpx(nav=nav, output_dir=Path(r\"\\output\\path\"), output_file=\"test_trace\")"
"export_gpx(\n",
" nav=nav, output_dir=Path(r\"../../user_case/output\"), output_file=\"test_trace\"\n",
")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"pygments_lexer": "ipython3",
"version": "3.13.3"
}
},
"nbformat": 4,
Expand Down
Loading