Skip to content
Closed
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
32 changes: 8 additions & 24 deletions notebooks/ch4_realtimeData.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"# Packages required to request and open data from AWS S3\n",
"import s3fs\n",
Expand Down Expand Up @@ -125,10 +123,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"# Initialize the S3 filesystem as anonymous\n",
"aws = s3fs.S3FileSystem(anon=True)"
Expand Down Expand Up @@ -193,10 +189,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"# Define dropdown options -- region and product from the AWS structure\n",
"region_options = [\n",
Expand Down Expand Up @@ -239,10 +233,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"# Retrieve the user selection from 'Region' \n",
"region = region_choice.value\n",
Expand All @@ -267,10 +259,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"# Retrieve the current datetime in UTC to know which bucket to query\n",
"now = datetime.datetime.now(datetime.UTC)\n",
Expand All @@ -285,10 +275,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"# Query the S3 bucket for the available files that meet the criteria\n",
"try:\n",
Expand All @@ -306,10 +294,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"if data_files:\n",
" # Choose the last file from S3 for the most recent data\n",
Expand Down Expand Up @@ -355,10 +341,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "raw",
"metadata": {},
"outputs": [],
"source": [
"# Mask data for neater visualization\n",
"data = data.where(data > 0, np.nan)\n",
Expand Down
Loading