{ "cells": [ { "cell_type": "markdown", "id": "997afb15", "metadata": {}, "source": [ "# Preprocessing iNaturalist data" ] }, { "cell_type": "markdown", "id": "e0592dd2", "metadata": {}, "source": [ "This section covers:\n", "\n", "- Download iNaturalist 'research-grade' vasuclar plant observations\n", "- iNaturalist global observation density \n", "- Observation growth over the years\n", "- Frequency of observations per species" ] }, { "cell_type": "markdown", "id": "94292637", "metadata": {}, "source": [ "## Packages" ] }, { "cell_type": "code", "execution_count": null, "id": "58d1a044", "metadata": {}, "outputs": [], "source": [ "import pandas as pd # for handling dataframes in python\n", "import numpy as np # array handling\n", "import os # operating system interfaces\n", "\n", "# packages needed for plotting:\n", "import matplotlib.pyplot as plt # main Python plotting library \n", "import seaborn as sns # pretty plots\n", "from matplotlib.colors import LogNorm, Normalize, BoundaryNorm\n", "import cartopy.crs as ccrs # maps \n", "from matplotlib.ticker import MaxNLocator\n", "from mpl_toolkits.axes_grid1 import make_axes_locatable" ] }, { "cell_type": "markdown", "id": "1df68a12", "metadata": {}, "source": [ "## Download iNaturalist observation data\n" ] }, { "cell_type": "markdown", "id": "5bbfafbf", "metadata": {}, "source": [ "For this study we used the following download: GBIF.org (4 January 2022) GBIF Occurrence Download https://doi.org/10.15468/dl.34tjre\n", "\n", "If you would like to use the most recent data: Follow the above link and click **'Rerun Query'** and proceed to download. For this analysis the 'simple' version is sufficient." ] }, { "cell_type": "markdown", "id": "0fcc8a61", "metadata": {}, "source": [ "### Load observations as data frame\n", "\n" ] }, { "cell_type": "code", "execution_count": 23, "id": "f675f0dc", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/net/home/swolf/.conda/envs/cartopy/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3172: DtypeWarning: Columns (46) have mixed types.Specify dtype option on import or set low_memory=False.\n", " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n" ] } ], "source": [ "iNat = pd.read_csv('/net/data/iNaturalist/Tracheophyta/0091819-210914110416597.csv', sep='\\t')" ] }, { "cell_type": "code", "execution_count": 4, "id": "1b235940", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | gbifID | \n", "datasetKey | \n", "occurrenceID | \n", "kingdom | \n", "phylum | \n", "class | \n", "order | \n", "family | \n", "genus | \n", "species | \n", "... | \n", "identifiedBy | \n", "dateIdentified | \n", "license | \n", "rightsHolder | \n", "recordedBy | \n", "typeStatus | \n", "establishmentMeans | \n", "lastInterpreted | \n", "mediaType | \n", "issue | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1229615436 | \n", "50c9509d-22c7-4a22-a47d-8c48425ef4a7 | \n", "http://www.inaturalist.org/observations/324100 | \n", "Plantae | \n", "Tracheophyta | \n", "Liliopsida | \n", "Commelinales | \n", "Commelinaceae | \n", "Commelina | \n", "Commelina communis | \n", "... | \n", "Suzanne Cadwell | \n", "2013-07-07T20:33:11 | \n", "CC_BY_NC_4_0 | \n", "Suzanne Cadwell | \n", "Suzanne Cadwell | \n", "NaN | \n", "NaN | \n", "2021-12-08T05:44:16.778Z | \n", "StillImage | \n", "NaN | \n", "
1 | \n", "1802610589 | \n", "50c9509d-22c7-4a22-a47d-8c48425ef4a7 | \n", "http://www.inaturalist.org/observations/381341 | \n", "Plantae | \n", "Tracheophyta | \n", "Magnoliopsida | \n", "Caryophyllales | \n", "Amaranthaceae | \n", "Blitum | \n", "Blitum capitatum | \n", "... | \n", "Kurt Herrmann | \n", "2019-09-02T01:11:54 | \n", "CC_BY_NC_4_0 | \n", "Kurt Herrmann | \n", "Kurt Herrmann | \n", "NaN | \n", "NaN | \n", "2021-12-08T04:57:17.866Z | \n", "StillImage;StillImage | \n", "NaN | \n", "
2 | \n", "1212005116 | \n", "50c9509d-22c7-4a22-a47d-8c48425ef4a7 | \n", "http://conabio.inaturalist.org/observations/57... | \n", "Plantae | \n", "Tracheophyta | \n", "Magnoliopsida | \n", "Malpighiales | \n", "Passifloraceae | \n", "Passiflora | \n", "Passiflora vitifolia | \n", "... | \n", "Alexis López Hernández | \n", "2017-02-23T17:24:07 | \n", "CC_BY_4_0 | \n", "Francisco Farriols Sarabia | \n", "Francisco Farriols Sarabia | \n", "NaN | \n", "NaN | \n", "2021-12-08T05:44:36.176Z | \n", "StillImage | \n", "NaN | \n", "
3 | \n", "911497199 | \n", "50c9509d-22c7-4a22-a47d-8c48425ef4a7 | \n", "http://www.inaturalist.org/observations/696216 | \n", "Plantae | \n", "Tracheophyta | \n", "Magnoliopsida | \n", "Lamiales | \n", "Plantaginaceae | \n", "Cymbalaria | \n", "Cymbalaria muralis | \n", "... | \n", "Jeff | \n", "2014-05-24T15:42:54 | \n", "CC_BY_NC_4_0 | \n", "Todd Plummer | \n", "Todd Plummer | \n", "NaN | \n", "NaN | \n", "2021-12-08T05:44:36.371Z | \n", "StillImage | \n", "NaN | \n", "
4 | \n", "1038333063 | \n", "50c9509d-22c7-4a22-a47d-8c48425ef4a7 | \n", "http://www.inaturalist.org/observations/1018638 | \n", "Plantae | \n", "Tracheophyta | \n", "Magnoliopsida | \n", "Asterales | \n", "Asteraceae | \n", "Xanthium | \n", "Xanthium spinosum | \n", "... | \n", "Ken-ichi Ueda | \n", "2014-10-14T07:24:41 | \n", "CC0_1_0 | \n", "Ken-ichi Ueda | \n", "Ken-ichi Ueda | \n", "NaN | \n", "NaN | \n", "2021-12-08T05:44:34.461Z | \n", "StillImage | \n", "NaN | \n", "
5 rows × 50 columns
\n", "\n", " | gbifID | \n", "scientificName | \n", "decimalLatitude | \n", "decimalLongitude | \n", "eventDate | \n", "dateIdentified | \n", "
---|---|---|---|---|---|---|
0 | \n", "1229615436 | \n", "Commelina communis | \n", "35.987483 | \n", "-79.057546 | \n", "2013-07-07T00:00:00 | \n", "2013-07-07T20:33:11 | \n", "
1 | \n", "1802610589 | \n", "Blitum capitatum | \n", "40.320259 | \n", "-105.604856 | \n", "2013-08-24T13:30:00 | \n", "2019-09-02T01:11:54 | \n", "
2 | \n", "1212005116 | \n", "Passiflora vitifolia | \n", "23.189257 | \n", "-106.404924 | \n", "2014-03-18T12:49:37 | \n", "2017-02-23T17:24:07 | \n", "
3 | \n", "911497199 | \n", "Cymbalaria muralis | \n", "37.996569 | \n", "-123.018465 | \n", "2014-05-23T08:58:53 | \n", "2014-05-24T15:42:54 | \n", "
4 | \n", "1038333063 | \n", "Xanthium spinosum | \n", "37.934966 | \n", "-122.148014 | \n", "2014-10-13T18:00:04 | \n", "2014-10-14T07:24:41 | \n", "