Skip to content
Merged
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
45 changes: 5 additions & 40 deletions Jupyterhub/extract_eventname_metadata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"HAZARD = None\n",
"LOCATION = None"
"HAZARD = None #Can be a python list or None\n",
"LOCATION = None #Can be a python list or None"
]
},
{
Expand All @@ -83,41 +83,6 @@
"## Import Libraries"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Required Libraries\n",
"\n",
"Before running this notebook, install the required Python libraries:\n",
"\n",
"```bash\n",
"# Install core dependencies\n",
"pip install boto3 rasterio\n",
"\n",
"# Install GDAL (required for COG operations)\n",
"# On macOS with Homebrew:\n",
"brew install gdal\n",
"pip install gdal\n",
"\n",
"# On Ubuntu/Debian:\n",
"sudo apt-get install gdal-bin libgdal-dev\n",
"pip install gdal==$(gdal-config --version)\n",
"\n",
"# On conda:\n",
"conda install -c conda-forge gdal\n",
"\n",
"# Install rio-cogeo for COG validation\n",
"pip install rio-cogeo\n",
"```\n",
"\n",
"**Note:** GDAL can be tricky to install. If you encounter issues, use conda instead of pip for all geospatial libraries:\n",
"\n",
"```bash\n",
"conda install -c conda-forge boto3 rasterio gdal rio-cogeo\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 10,
Expand Down Expand Up @@ -391,8 +356,8 @@
" tags = {\n",
" 'ACTIVATION_EVENT': f\"{event_metadata['year_month']}_{event_metadata['hazard']}_{event_metadata['location']}\",\n",
" 'YEAR_MONTH': event_metadata['year_month'],\n",
" 'HAZARD': HAZARD if HAZARD is not None else event_metadata['hazard'],\n",
" 'LOCATION': LOCATION if LOCATION is not None else event_metadata['location'],\n",
" 'HAZARD': ','.join(HAZARD) if isinstance(HAZARD, list) else (HAZARD or event_metadata['hazard']),\n",
" 'LOCATION': ','.join(LOCATION) if isinstance(LOCATION, list) else (LOCATION or event_metadata['location']),\n",
" 'PROCESSING_DATE': datetime.utcnow().isoformat(),\n",
" 'PROCESSOR': 'S3 GeoTIFF COG Processor v1.0'\n",
" }\n",
Expand Down
Loading