Skip to content

Commit

Permalink
added results from field excercise and historical values
Browse files Browse the repository at this point in the history
  • Loading branch information
hammerdirt committed Sep 27, 2024
1 parent 508b1de commit 6e2a279
Show file tree
Hide file tree
Showing 12 changed files with 744 additions and 31 deletions.
Binary file modified _build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified _build/.doctrees/excercise_2024.doctree
Binary file not shown.
Binary file modified _build/.doctrees/plastic_shotgun_wadding.doctree
Binary file not shown.
139 changes: 135 additions & 4 deletions _build/jupyter_execute/plastic_shotgun_wadding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 26,
"id": "60d29688-34ea-4727-8c83-d1e52de7c808",
"metadata": {
"editable": true,
Expand Down Expand Up @@ -65,6 +65,140 @@
"shotgun = work_data[work_data.code == 'G70'].copy()"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "f2de3eb2-1cc2-43ba-a301-616aee1d9fed",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['parc-des-pierrettes', 'plage-de-dorigny', 'plage-de-st-sulpice',\n",
" 'saint-sulpice', 'tiger-duck-beach'], dtype=object)"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"work_data[(work_data.city == 'Saint-Sulpice (VD)')].location.unique()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "b420f011-d0d6-4b46-8b2a-6caeb8e75e19",
"metadata": {},
"outputs": [],
"source": [
"codesx = ['G70', 'G96', 'G112', 'G89', 'G95', 'G91', 'G35', 'G100']"
]
},
{
"cell_type": "code",
"execution_count": 56,
"id": "aca6f768-f389-4371-ae59-68af51478a53",
"metadata": {},
"outputs": [],
"source": [
"t = work_data[(work_data.location.isin(['parc-des-pierrettes', 'plage-de-st-sulpice' ]))&(work_data.code.isin(codesx))].copy()"
]
},
{
"cell_type": "code",
"execution_count": 82,
"id": "dca6f010-eee5-41a9-8393-1dd4af9fab3d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'| | object | quantity | found | sample_id |\\n|---:|:----------------------------------------------------|-----------:|--------:|------------:|\\n| 0 | Biomass holder | 14 | 0 | 8 |\\n| 1 | Cotton bud/swab sticks | 368 | 0 | 8 |\\n| 2 | Industrial pellets (nurdles) | 22 | 0 | 8 |\\n| 3 | Medical; containers/tubes/ packaging | 133 | 0 | 8 |\\n| 4 | Plastic construction waste | 110 | 0 | 7 |\\n| 5 | Sanitary pads /panty liners/tampons and applicators | 31 | 0 | 8 |\\n| 6 | Shotgun cartridges | 23 | 0 | 8 |\\n| 7 | Straws and stirrers | 29 | 0 | 8 |'"
]
},
"execution_count": 82,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"codes = pd.read_csv('resources/data/u_codes.csv')\n",
"codes.set_index('code', inplace=True)\n",
"t['object'] = t.code.map(lambda x: codes.loc[x, 'description'])\n",
"t['found'] = 0\n",
"t[['object', 'quantity', 'found', 'sample_id']].groupby('object', as_index=False).agg({'quantity':'sum', 'found':'sum', 'sample_id':'nunique'}).to_markdown()"
]
},
{
"cell_type": "code",
"execution_count": 77,
"id": "043bdac8-cf93-4e8a-a76c-11ce617d887e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'| | object | greater than 1 | greater than 2 | greater than 3 | greater than 4 | greater than 10 |\\n|---:|:----------------------------------------------------|-----------------:|-----------------:|-----------------:|-----------------:|------------------:|\\n| 0 | Biomass holder | 0.5 | 0.38 | 0.38 | 0 | 0 |\\n| 1 | Cotton bud/swab sticks | 0.88 | 0.88 | 0.88 | 0.88 | 0.88 |\\n| 2 | Industrial pellets (nurdles) | 0.25 | 0.25 | 0.25 | 0.25 | 0.12 |\\n| 3 | Medical; containers/tubes/ packaging | 0.88 | 0.88 | 0.75 | 0.75 | 0.62 |\\n| 4 | Plastic construction waste | 0.86 | 0.86 | 0.86 | 0.71 | 0.43 |\\n| 5 | Sanitary pads /panty liners/tampons and applicators | 0.62 | 0.5 | 0.5 | 0.38 | 0 |\\n| 6 | Shotgun cartridges | 0.75 | 0.38 | 0.38 | 0.25 | 0 |\\n| 7 | Straws and stirrers | 0.62 | 0.5 | 0.5 | 0.38 | 0.12 |'"
]
},
"execution_count": 77,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"grouped = t.groupby(['object'])\n",
"# Step 2: Count samples per location and code\n",
"counts = grouped.size().reset_index(name='total_samples')\n",
"\n",
"# Step 3: Apply conditions and count how many times quantity > 1, 2, 3, and 4\n",
"conditions = t.assign(\n",
" greater_than_1=t['quantity'] > 1,\n",
" greater_than_2=t['quantity'] > 2,\n",
" greater_than_3=t['quantity'] > 3,\n",
" greater_than_4=t['quantity'] > 4\n",
").groupby(['location', 'code']).agg(\n",
" greater_than_1=('greater_than_1', 'sum'),\n",
" greater_than_2=('greater_than_2', 'sum'),\n",
" greater_than_3=('greater_than_3', 'sum'),\n",
" greater_than_4=('greater_than_4', 'sum')\n",
").reset_index()\n",
"\n",
"grouped = t.groupby(['object'])\n",
"# Step 2: Count samples per location and code\n",
"counts = grouped.size().reset_index(name='total_samples')\n",
"\n",
"# Step 3: Apply conditions and count how many times quantity > 1, 2, 3, and 4\n",
"conditions = t.assign(\n",
" greater_than_1=t['quantity'] > 1,\n",
" greater_than_2=t['quantity'] > 2,\n",
" greater_than_3=t['quantity'] > 3,\n",
" greater_than_4=t['quantity'] > 4,\n",
" greater_than_10=t['quantity'] > 10\n",
").groupby(['object']).agg(\n",
" greater_than_1=('greater_than_1', 'sum'),\n",
" greater_than_2=('greater_than_2', 'sum'),\n",
" greater_than_3=('greater_than_3', 'sum'),\n",
" greater_than_4=('greater_than_4', 'sum'),\n",
" greater_than_10=('greater_than_10', 'sum')\n",
").reset_index()\n",
"\n",
"\n",
"# Step 4: Merge the total sample count with the conditions\n",
"merged = pd.merge(counts, conditions, on=['object'])\n",
"# Step 5: Calculate the ratio of each condition to the total number of samples\n",
"merged['greater than 1'] = merged['greater_than_1'] / merged['total_samples']\n",
"merged['greater than 2'] = merged['greater_than_2'] / merged['total_samples']\n",
"merged['greater than 3'] = merged['greater_than_3'] / merged['total_samples']\n",
"merged['greater than 4'] = merged['greater_than_4'] / merged['total_samples']\n",
"merged['greater than 10'] = merged['greater_than_10'] / merged['total_samples']\n",
"\n",
"merged[['object', 'greater than 1', 'greater than 2', 'greater than 3', 'greater than 4', 'greater than 10']].round(2).to_markdown()"
]
},
{
"cell_type": "markdown",
"id": "39f7bb8a-8472-46b6-a820-7986da6ae8d0",
Expand Down Expand Up @@ -174,9 +308,6 @@
"id": "530dc284-919d-47b4-a2f1-f4fe75ab1f13",
"metadata": {
"editable": true,
"jupyter": {
"source_hidden": true
},
"slideshow": {
"slide_type": ""
},
Expand Down
3 changes: 3 additions & 0 deletions data_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,9 @@
"execution_count": 23,
"metadata": {
"editable": true,
"jupyter": {
"source_hidden": true
},
"pycharm": {
"name": "#%%\n"
},
Expand Down
44 changes: 42 additions & 2 deletions docs/_sources/excercise_2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ and snack wrappers (8% of the total). We find also objects that are not associat
industrial plastic pellets (6% of the total), cotton swabs (4% of the total) plastic construction materials (3% of the total) and shotgun cartridges (1% of the total).

All the previous items mentioned are found in similar proportions in the marine environment in the european space, [EEA data viewer](https://www.eea.europa.eu/en/analysis/maps-and-charts/marine-litterwatch-data-viewer-marine-litterwatch-data-viewer).
The federal report of 2021, [IQAASL](https://www.bafu.admin.ch/bafu/en/home/topics/waste/state/data-and-indicators/indicators/indicators-on-waste-and-resources.html), report included medical containers, straws and stirrers and toys as common objects on the beaches of lake Geneva.
The federal report of 2021, [IQAASL](https://hammerdirt-analyst.github.io/IQAASL-End-0f-Sampling-2021/), included medical containers, straws and stirrers and toys as common objects on the beaches of lake Geneva.

## First encounters

__Objective: In the field identify and count specific beach litter items.__
**Objective : in the field identify and count specific beach litter items.**

*Survey locations:*

<iframe src="https://map.geo.admin.ch/#/embed?lang=fr&center=2533348.46,1151997.25&z=7.291&bgLayer=ch.swisstopo.pixelkarte-farbe&topic=ech&layers=ch.swisstopo.zeitreihen@year=1864,f;ch.bfs.gebaeude_wohnungs_register,f;ch.bav.haltestellen-oev,f;ch.swisstopo.swisstlm3d-wanderwege,f;ch.astra.wanderland-sperrungen_umleitungen,f;KML%7Chttps://public.geo.admin.ch/api/kml/files/zpNHEP7CTeKPUqy56qCwpg&featureInfo=bottomPanel" style="border: 0;width: 600px;height: 450px;max-width: 100%;max-height: 100%;" allow="geolocation"></iframe>

### Items of interest

The guide for monitoring beach litter, [MLW Guide](https://publications.jrc.ec.europa.eu/repository/handle/JRC83985), lists 200 items that can be found on the beach. The OSPAR
commission has a similar list of 150 items [OSPAR](https://www.ospar.org/documents?v=44122). Today we are going to focus on identifying and counting 7 items:
Expand Down Expand Up @@ -56,6 +62,40 @@ Record the number of each item found and the name of the beach where it was foun
4. What are the possible pathways for the object to reach the beach?
5. What are the possible prevention measures?

## Results

_Legend :_ The cumulative results are the total number found on visits to the two beaches since 2016 up to the day before of the excercise.


| object | cumulative | found sep 26 |
|:----------------------------------------------------|-----------:|--------:|
| Biomass holder | 14 | 2 |
| Cotton bud/swab sticks | 368 | 8 |
| Industrial pellets (nurdles) | 22 | 9 |
| Medical; containers/tubes/ packaging | 133 | 7 |
| Plastic construction waste | 110 | 15|
| Sanitary pads /panty liners/tampons and applicators | 31 | 2 |
| Shotgun cartridges | 23 | 0 |
| Straws and stirrers | 29 | 2 |


### Probability of finding an amount

_Legend :_ The historical probabilities (prior to field excercise) of finding a given quantity at the beaches surveyed (results combined):


| object | at least 1 | at least 2 | at least 3 | at least 4 | at least 10|
|:----------------------------------------------------|-----------------:|-----------------:|-----------------:|-----------------:|------------------:|
| Biomass holder | 0.5 | 0.38 | 0.38 | 0 | 0 |
| Cotton bud/swab sticks | 0.88 | 0.88 | 0.88 | 0.88 | 0.88 |
| Industrial pellets (nurdles) | 0.25 | 0.25 | 0.25 | 0.25 | 0.12 |
| Medical; containers/tubes/ packaging | 0.88 | 0.88 | 0.75 | 0.75 | 0.62 |
| Plastic construction waste | 0.86 | 0.86 | 0.86 | 0.71 | 0.43 |
| Sanitary pads /panty liners/tampons and applicators | 0.62 | 0.5 | 0.5 | 0.38 | 0 |
| Shotgun cartridges | 0.75 | 0.38 | 0.38 | 0.25 | 0 |
| Straws and stirrers | 0.62 | 0.5 | 0.5 | 0.38 | 0.12 |


## Semester project: pathways

You can choose to make your video project on the potential pathways to the beach of a specific item. Your video project should also include
Expand Down
Loading

0 comments on commit 6e2a279

Please sign in to comment.