diff --git a/devel_test/README.md b/devel_test/README.md new file mode 100644 index 0000000..28724f6 --- /dev/null +++ b/devel_test/README.md @@ -0,0 +1 @@ +This directory is for interim tests during the development process. diff --git a/devel_test/temporal_average_daily.ipynb b/devel_test/temporal_average_daily.ipynb new file mode 100644 index 0000000..71a78a9 --- /dev/null +++ b/devel_test/temporal_average_daily.ipynb @@ -0,0 +1,3721 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "ab1d3dea-b953-4e53-a94d-ab9a2d1ab39c", + "metadata": {}, + "source": [ + "# Temporal Average Testing\n", + "\n", + "Test procedure:\n", + "- XCDAT is source-installed from branch `feature/201-temporal-mean`\n", + "- PR: https://github.com/xCDAT/xcdat/pull/236\n", + "\n", + "## Load test data -- daily, 6 yr dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "ac226d47-9fdc-4f9c-b2ff-d9542b23c5f2", + "metadata": {}, + "outputs": [], + "source": [ + "import os" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a0ba4da0-603f-4437-ab82-7b3fa9a7c2d2", + "metadata": {}, + "outputs": [], + "source": [ + "demo_data_dir = '../tutorials/demo_data/CMIP5_demo_timeseries/historical/atmos/day/pr'\n", + "demo_filename = 'pr_day_GISS-E2-H_historical_r6i1p1_20000101-20051231.nc'\n", + "demo_file = os.path.join(demo_data_dir, demo_filename)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "8a67df64-9f0b-4515-8fdc-2122a2eddd1c", + "metadata": {}, + "outputs": [], + "source": [ + "import xcdat" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "c20b0719-f1a3-4781-a8af-465c05cf4240", + "metadata": {}, + "outputs": [], + "source": [ + "ds = xcdat.open_dataset(demo_file)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "d965ac21-d875-4951-bb2d-70a6dedade3a", + "metadata": {}, + "outputs": [], + "source": [ + "pr = ds.pr" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "1b9227cd-3c9a-4135-8228-b3b17eabe81c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
<xarray.DataArray 'pr' (time: 2190, lat: 90, lon: 144)>\n", + "[28382400 values with dtype=float32]\n", + "Coordinates:\n", + " * time (time) object 2000-01-01 12:00:00 ... 2005-12-31 12:00:00\n", + " * lat (lat) float64 -89.0 -87.0 -85.0 -83.0 -81.0 ... 83.0 85.0 87.0 89.0\n", + " * lon (lon) float64 1.25 3.75 6.25 8.75 11.25 ... 351.2 353.8 356.2 358.8\n", + "Attributes:\n", + " standard_name: precipitation_flux\n", + " long_name: Precipitation\n", + " comment: at surface; includes both liquid and solid phases from...\n", + " units: kg m-2 s-1\n", + " original_name: dummy\n", + " cell_methods: time: mean\n", + " cell_measures: area: areacella\n", + " history: 2013-04-18T19:18:11Z altered by CMOR: replaced missing...\n", + " associated_files: baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation...
<xarray.Dataset>\n", + "Dimensions: (lat: 90, bnds: 2, lon: 144)\n", + "Coordinates:\n", + " * lat (lat) float64 -89.0 -87.0 -85.0 -83.0 ... 83.0 85.0 87.0 89.0\n", + " * lon (lon) float64 1.25 3.75 6.25 8.75 ... 351.2 353.8 356.2 358.8\n", + "Dimensions without coordinates: bnds\n", + "Data variables:\n", + " lat_bnds (lat, bnds) float64 -90.0 -88.0 -88.0 -86.0 ... 88.0 88.0 90.0\n", + " lon_bnds (lon, bnds) float64 0.0 2.5 2.5 5.0 ... 355.0 357.5 357.5 360.0\n", + " pr (lat, lon) float64 7.904e-07 7.904e-07 ... 3.448e-06 3.448e-06\n", + "Attributes: (12/27)\n", + " institution: NASA/GISS (Goddard Institute for Space Studies) N...\n", + " institute_id: NASA-GISS\n", + " experiment_id: historical\n", + " source: GISS-E2-H-Eh135f9f Atmosphere: GISS-E2; Ocean: H\n", + " model_id: GISS-E2-H\n", + " forcing: GHG, LU, Sl, Vl, BC, OC, SA, Oz (also includes BC...\n", + " ... ...\n", + " table_id: Table day (27 April 2011) 86d1558d99b6ed1e7a886ab...\n", + " title: GISS-E2-H model output prepared for CMIP5 historical\n", + " parent_experiment: pre-industrial control\n", + " modeling_realm: atmos\n", + " realization: 6\n", + " cmor_version: 2.5.7