Skip to content

Commit 9e9f493

Browse files
committed
deploy: be841c6
0 parents  commit 9e9f493

File tree

509 files changed

+162434
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

509 files changed

+162434
-0
lines changed

.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: d7d86ede779b247490775542358c2482
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

.doctrees/api.doctree

60.1 KB
Binary file not shown.

.doctrees/contributing.doctree

81.1 KB
Binary file not shown.

.doctrees/demo-notebooks.doctree

8.45 KB
Binary file not shown.

.doctrees/environment.pickle

490 KB
Binary file not shown.
17.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
48.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
72.6 KB
Binary file not shown.
569 KB
Binary file not shown.
Binary file not shown.
867 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
64.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

.doctrees/index.doctree

20.2 KB
Binary file not shown.

.doctrees/install.doctree

22.8 KB
Binary file not shown.

.doctrees/metrics.doctree

5.04 KB
Binary file not shown.

.doctrees/metrics_enso.doctree

11.1 KB
Binary file not shown.

.doctrees/metrics_ext.doctree

38.6 KB
Binary file not shown.

.doctrees/metrics_mean-clim.doctree

29.8 KB
Binary file not shown.

.doctrees/metrics_mjo.doctree

16.5 KB
Binary file not shown.

.doctrees/metrics_monsoon.doctree

7.37 KB
Binary file not shown.

.doctrees/metrics_mov.doctree

10.1 KB
Binary file not shown.
16.6 KB
Binary file not shown.
22.2 KB
Binary file not shown.

.doctrees/metrics_sea_ice.doctree

27.5 KB
Binary file not shown.
11.3 KB
Binary file not shown.
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 0. Prepare Demos\n",
8+
"\n",
9+
"Download sample data and set up parameter files\n",
10+
"\n",
11+
"This Notebook sets up the data for the other demos. It is recommended that you run this and other demos in a conda environment with **xcdat** and **pcmdi_metrics** installed."
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": 1,
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"# Lets get the file containing the data needed for this demo\n",
21+
"import requests\n",
22+
"r = requests.get(\"https://pcmdiweb.llnl.gov/pss/pmpdata/pmp_tutorial_files.v20240201.txt\")\n",
23+
"with open(\"data_files.txt\",\"wb\") as f:\n",
24+
" f.write(r.content)"
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"metadata": {},
30+
"source": [
31+
"Now let's retrieve these sample files locally. Please edit the following to match a good location on your system:\n",
32+
"\n",
33+
"`demo_data_directory` is a path where you would like to download our demo data \n",
34+
"`demo_output_directory` is a path where you would like the demos output to be dumped. \n",
35+
" \n",
36+
"The last cell in this notebook automatically sets up the parameter files for the other demos to use your chosen demo_data and demo_output directories."
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": 2,
42+
"metadata": {},
43+
"outputs": [],
44+
"source": [
45+
"# This is where you will be downloading the sample_data\n",
46+
"demo_data_directory = \"demo_data_tmp\"\n",
47+
"# this line is where your output will be stored\n",
48+
"demo_output_directory = \"demo_output_tmp\""
49+
]
50+
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"In below cell, you are going to download sample input files from PCMDI server. The total size of dataset is about 2 GB, and so please be aware that downloading will take some time to complete. List of downloading files can be found in [`data_files.txt`](https://pcmdiweb.llnl.gov/pss/pmpdata/pmp_tutorial_files.v20240201.txt) file."
56+
]
57+
},
58+
{
59+
"cell_type": "code",
60+
"execution_count": 3,
61+
"metadata": {},
62+
"outputs": [
63+
{
64+
"name": "stdout",
65+
"output_type": "stream",
66+
"text": [
67+
"All files downloaded\n"
68+
]
69+
}
70+
],
71+
"source": [
72+
"# Let's download the files\n",
73+
"from pcmdi_metrics.io.base import download_sample_data_files\n",
74+
"try:\n",
75+
" download_sample_data_files(\"data_files.txt\", demo_data_directory)\n",
76+
" print(\"All files downloaded\")\n",
77+
"except Exception:\n",
78+
" print(\"Download failed\")"
79+
]
80+
},
81+
{
82+
"cell_type": "markdown",
83+
"metadata": {},
84+
"source": [
85+
"The final step is to generate parameter files from templates, using the demo_data_directory and demo_output_directory variables set above."
86+
]
87+
},
88+
{
89+
"cell_type": "code",
90+
"execution_count": 4,
91+
"metadata": {},
92+
"outputs": [
93+
{
94+
"name": "stdout",
95+
"output_type": "stream",
96+
"text": [
97+
"Preparing parameter file: basic_mjo_param.py\n",
98+
"Preparing parameter file: basic_mov_param_sst.py\n",
99+
"Preparing parameter file: basic_diurnal_composite.py\n",
100+
"Preparing parameter file: basic_param.py\n",
101+
"Preparing parameter file: basic_diurnal_compute_daily_mean.py\n",
102+
"Preparing parameter file: basic_monsoon_sperber_param.py\n",
103+
"Preparing parameter file: basic_diurnal_std_daily_mean.py\n",
104+
"Preparing parameter file: basic_monsoon_wang_param.py\n",
105+
"Preparing parameter file: basic_diurnal_fourier.py\n",
106+
"Preparing parameter file: basic_enso_param.py\n",
107+
"Preparing parameter file: basic_annual_cycle_param.py\n",
108+
"Preparing parameter file: basic_extremes_param.py\n",
109+
"Preparing parameter file: basic_diurnal_std_hourly_mean.py\n",
110+
"Preparing parameter file: basic_diurnal_fourierAllGrid.py\n",
111+
"Preparing parameter file: basic_mov_param.py\n",
112+
"Preparing parameter file: basic_precip_variability_param.py\n",
113+
"Saving User Choices\n"
114+
]
115+
}
116+
],
117+
"source": [
118+
"from download_sample_data import generate_parameter_files\n",
119+
"generate_parameter_files(demo_data_directory, demo_output_directory)"
120+
]
121+
},
122+
{
123+
"cell_type": "markdown",
124+
"metadata": {},
125+
"source": [
126+
"You're done!\n",
127+
"Please proceed to the next tutorial"
128+
]
129+
}
130+
],
131+
"metadata": {
132+
"kernelspec": {
133+
"display_name": "pmp_devel_20241106_xcdat0.7.3",
134+
"language": "python",
135+
"name": "python3"
136+
},
137+
"language_info": {
138+
"codemirror_mode": {
139+
"name": "ipython",
140+
"version": 3
141+
},
142+
"file_extension": ".py",
143+
"mimetype": "text/x-python",
144+
"name": "python",
145+
"nbconvert_exporter": "python",
146+
"pygments_lexer": "ipython3",
147+
"version": "3.10.10"
148+
},
149+
"selected_variables": [],
150+
"vcdat_file_path": "",
151+
"vcdat_loaded_variables": [],
152+
"vcdat_variable_info": {}
153+
},
154+
"nbformat": 4,
155+
"nbformat_minor": 4
156+
}

0 commit comments

Comments
 (0)