{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Time Semantics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Preamble" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Goals\n", "- load timeseries data using Pandas\n", "- create a Pandas Series with desired time intervals\n", "- create Pyleoclim Series with desired time intervals\n", "- Plot Pyleoclim Series \n", "- Plot spectral analysis with Pyleoclim\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Keywords" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Pre-requisites\n", "None. This tutorial assumes basic knowledge of Python. If you are not familiar with this coding language, check out this tutorial: http://linked.earth/LeapFROGS/." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Relevant Packages\n", "Pyleoclim, Pandas" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data Description\n", "Data provided by @bdamir5. \"The data are my own measurements of CO2 concentration in the urban area of city Zagreb. They are sampled at a two-second frequency with the common low-cost CO2 sensor Senseair K30 and saved in .txt or .log files. Then I did some Python gymnastics to load all those log files to Pandas dataframe and extract whole-hour measurements. I exported the data to Excel to have them in one place when uploading here.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Demonstration\n", "\n", "First import all necessary packages" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd \n", "import matplotlib.pyplot as plt\n", "from matplotlib import dates as mdates\n", "from matplotlib.ticker import FuncFormatter\n", "import os \n", "import pyleoclim as pyleo\n", "import datetime" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load dataset \n", "Load dataset (excel file) as Pandas dataframe and print contents to see format." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Time | \n", "CO2 Value [ppm] | \n", "
---|---|---|
0 | \n", "2022-08-21 20:00:00 | \n", "406 | \n", "
1 | \n", "2022-08-21 21:00:00 | \n", "412 | \n", "
2 | \n", "2022-08-21 22:00:00 | \n", "420 | \n", "
3 | \n", "2022-08-21 23:00:00 | \n", "439 | \n", "
4 | \n", "2022-08-22 00:00:00 | \n", "437 | \n", "