{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"# Overview of Pyleoclim: Efficient & Flexible Timeseries Analysis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"by [Deborah Khider](https://orcid.org/0000-0001-7501-8430), [Julien Emile-Geay](https://orcid.org/0000-0001-5920-4751), [Alexander James](https://orcid.org/0000-0001-8561-3188), [Feng Zhu](https://orcid.org/0000-0002-9969-2953), [Jordan Landers](https://orcid.org/0000-0001-9772-7617)\n",
"\n",
"## Preamble\n",
"\n",
"### Goals:\n",
"\n",
"* Get acquainted with the Pyleoclim package, namely the objects and their associated methods\n",
"* Learn to create a Series object from a csv file\n",
"* Call the default methods for plotting, spectral and wavelet analysis\n",
"* Construct workflows with Pyleoclim\n",
"\n",
"\n",
"**Reading Time:**\n",
"\n",
"10 minutes\n",
"\n",
"### Keywords\n",
"\n",
"Visualization; Signal Processing; Spectral Analysis; Wavelet Analysis; Method Cascading\n",
"\n",
"### Pre-requisites\n",
"\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/](http://linked.earth/LeapFROGS/) \n",
"\n",
"### Relevant Packages\n",
"\n",
"Pandas; Matplotlib\n",
"\n",
"## Data Description\n",
"\n",
"Sea-surface temperature from [Kaplan (1998)](https://psl.noaa.gov/data/gridded/data.kaplan_sst.html) averaged over the NINO3 (5N-5S, 150W-190E)) region.\n",
"\n",
"\n",
"## Demonstration\n",
"\n",
"Let's import the packages needed for this tutorial:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/julieneg/opt/miniconda3/envs/pyleo/lib/python3.11/site-packages/pyproj/__init__.py:89: UserWarning: pyproj unable to set database path.\n",
" _pyproj_global_context_initialize()\n"
]
}
],
"source": [
"%load_ext watermark\n",
"import pyleoclim as pyleo\n",
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 1: Create a `Series` object from a csv file\n",
"\n",
"To do so, we will first read the data from a csv file and load into a [Pandas DataFrame](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html):"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | t | \n", "air | \n", "nino | \n", "
---|---|---|---|
0 | \n", "1871.000000 | \n", "87.36090 | \n", "-0.358250 | \n", "
1 | \n", "1871.083333 | \n", "-21.83460 | \n", "-0.292458 | \n", "
2 | \n", "1871.166667 | \n", "-5.52632 | \n", "-0.143583 | \n", "
3 | \n", "1871.250000 | \n", "75.73680 | \n", "-0.149625 | \n", "
4 | \n", "1871.333333 | \n", "105.82000 | \n", "-0.274250 | \n", "