Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Contributing.md #23

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 30 additions & 16 deletions 01-welcome-to-easi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,49 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Formatting for basic plots\n",
"%matplotlib inline\n",
"%config InlineBackend.rc = {}\n",
"\n",
"# Data tools\n",
"import numpy as np\n",
"import xarray as xr\n",
"import pandas as pd\n",
"from datetime import datetime\n",
"import matplotlib.pyplot as plt\n",
"# plt.rcParams['figure.figsize'] = [12, 8]\n",
"\n",
"# Formatting pandas table output\n",
"import pandas\n",
"pandas.set_option(\"display.max_rows\", None)\n",
"# Formatting options\n",
"pd.set_option(\"display.max_rows\", None)\n",
"# plt.rcParams['figure.figsize'] = [12, 8]\n",
"\n",
"# Datacube\n",
"import datacube\n",
"from datacube.utils import masking # https://github.com/opendatacube/datacube-core/blob/develop/datacube/utils/masking.py\n",
"from odc.algo import enum_to_bool # https://github.com/opendatacube/odc-tools/blob/develop/libs/algo/odc/algo/_masking.py\n",
"from datacube.utils.rio import configure_s3_access\n",
"from datacube.utils.aws import configure_s3_access\n",
"\n",
"# Notebook helper tools (in dea_tools or in this repo)\n",
"import sys\n",
"from os import environ\n",
"repo = f'{environ[\"HOME\"]}/eocsi-hackathon-2022' # No easy way to get repo directory\n",
"if repo not in sys.path: sys.path.append(repo)\n",
"from tools.notebook_utils import xarray_object_size\n",
"try:\n",
" from dea_tools.plotting import display_map, rgb\n",
"except ImportError:\n",
" # Local copy of selected dea_tools\n",
" if 'tools/' not in sys.path:\n",
" sys.path.append('tools/')\n",
" from datacube_utils import display_map\n",
" from tools.datacube_utils import display_map\n",
" rgb = None # Not copied or adapted yet"
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"## Connect to the OpenDataCube\n",
"\n",
Expand All @@ -88,12 +97,16 @@
"metadata": {},
"outputs": [],
"source": [
"# Initialise a datacube connection\n",
"dc = datacube.Datacube()\n",
"\n",
"# Optional: Access AWS \"requester-pays\" buckets\n",
"# This is necessary for Landsat (\"landsatN_c2l2_*\") and Sentinel-2 (\"s2_l2a\") products\n",
"from datacube.utils.aws import configure_s3_access\n",
"configure_s3_access(aws_unsigned=False, requester_pays=True);"
"# Access AWS \"requester-pays\" buckets\n",
"configure_s3_access(aws_unsigned=False, requester_pays=True)\n",
"\n",
"# Use EASI caching-proxy (applies to selected source buckets)\n",
"environ[\"AWS_HTTPS\"] = \"NO\"\n",
"environ[\"GDAL_HTTP_PROXY\"] = \"easi-caching-proxy.caching-proxy:80\"\n",
"print(f'Will use caching proxy at: {environ.get(\"GDAL_HTTP_PROXY\")}')"
]
},
{
Expand Down Expand Up @@ -200,6 +213,7 @@
" group_by='solar_day', # Group by time method\n",
")\n",
"\n",
"display(xarray_object_size(data))\n",
"display(data)"
]
},
Expand Down
Loading