Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c77a46b
Automatic commit by nbgitpuller
Oct 29, 2025
377224b
Merge remote-tracking branch 'origin/main'
Oct 29, 2025
6ed0e3c
Merge remote-tracking branch 'origin/main'
Oct 29, 2025
9594d52
Automatic commit by nbgitpuller
Oct 29, 2025
eb2511c
Merge remote-tracking branch 'origin/main'
Oct 29, 2025
79ed6dd
Automatic commit by nbgitpuller
Oct 29, 2025
9c93101
Merge remote-tracking branch 'origin/main'
Oct 29, 2025
d457ce2
Automatic commit by nbgitpuller
Oct 29, 2025
e061033
Merge remote-tracking branch 'origin/main'
Oct 29, 2025
8a9f4eb
Automatic commit by nbgitpuller
Oct 29, 2025
c47e554
Merge remote-tracking branch 'origin/main'
Oct 31, 2025
30d749b
Merge remote-tracking branch 'origin/main'
Nov 3, 2025
ebf5afe
Merge remote-tracking branch 'origin/main'
Nov 13, 2025
0851ef3
Automatic commit by nbgitpuller
Nov 14, 2025
f706c49
Merge remote-tracking branch 'origin/main'
Nov 14, 2025
9695462
Automatic commit by nbgitpuller
Nov 24, 2025
8b4ec8a
Merge remote-tracking branch 'origin/main'
Nov 24, 2025
37dbda5
Automatic commit by nbgitpuller
Dec 9, 2025
5101862
Merge remote-tracking branch 'origin/main'
Dec 9, 2025
a32845b
Automatic commit by nbgitpuller
Dec 9, 2025
7720b92
Automatic commit by nbgitpuller
Jan 22, 2026
0e678e0
Merge remote-tracking branch 'origin/main'
Jan 28, 2026
af787ae
Merge remote-tracking branch 'origin/main'
Jan 30, 2026
fa157b2
Automatic commit by nbgitpuller
Feb 6, 2026
6c28c28
Automatic commit by nbgitpuller
Feb 9, 2026
54bd8b5
Merge remote-tracking branch 'origin/main'
Feb 9, 2026
986ace7
Automatic commit by nbgitpuller
Mar 17, 2026
fd8a6e6
Merge remote-tracking branch 'origin/main'
Mar 17, 2026
c4961db
update notebook
kyle-lesinger Mar 17, 2026
d960902
update notebook
kyle-lesinger Mar 17, 2026
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
Empty file modified .github/workflows/deploy-with-password.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/preview.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/quarto-publish.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified AWS/AWS_SSO_Remote_Server.qmd
100644 → 100755
Empty file.
Empty file modified AWS/AWS_SSO_Setup_Guide.qmd
100644 → 100755
Empty file.
Empty file modified AWS/aws-mfa-setup.qmd
100644 → 100755
Empty file.
Empty file modified AWS/aws-s3-commands-guide.qmd
100644 → 100755
Empty file.
Empty file modified DataIngestion/stac-collection.ipynb
100644 → 100755
Empty file.
Empty file modified GitHub/commands.qmd
100644 → 100755
Empty file.
Empty file modified GitHub/resources.qmd
100644 → 100755
Empty file.
Empty file modified GitHub/setup.qmd
100644 → 100755
Empty file.
Empty file modified GitHub/veda-preview.qmd
100644 → 100755
Empty file.
20 changes: 18 additions & 2 deletions Jupyterhub/clone_conversion_repo.ipynb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cloning disasters-aws-conversion repository...\n",
"Successfully cloned disasters-aws-conversion\n"
]
}
],
"source": [
"import os\n",
"import subprocess\n",
Expand All @@ -74,6 +83,13 @@
"else:\n",
" print(f\"{repo_name} repository already exists\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
68 changes: 46 additions & 22 deletions Jupyterhub/extract_eventname_metadata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": 77,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -59,6 +59,23 @@
"DELETE_AFTER_MOVE = False # Set to True to delete original files after successful processing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Metadata options"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"HAZARD = None\n",
"LOCATION = None"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -103,7 +120,7 @@
},
{
"cell_type": "code",
"execution_count": 78,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -143,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 79,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -152,8 +169,8 @@
"text": [
"Current AWS Identity:\n",
" Account: 515966502221\n",
" ARN: arn:aws:sts::515966502221:assumed-role/disasters-prod/botocore-session-1773693036\n",
" User ID: AROAXQIQAAVGWA2LHXCPW:botocore-session-1773693036\n",
" ARN: arn:aws:sts::515966502221:assumed-role/disasters-prod/botocore-session-1773760456\n",
" User ID: AROAXQIQAAVGWA2LHXCPW:botocore-session-1773760456\n",
"\n",
"S3 client created successfully\n"
]
Expand Down Expand Up @@ -187,7 +204,7 @@
},
{
"cell_type": "code",
"execution_count": 80,
"execution_count": 21,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -329,7 +346,7 @@
" return False, {'is_cog': False, 'errors': [str(e)], 'warnings': []}\n",
"\n",
"\n",
"def add_metadata_and_create_cog(file_bytes: bytes, event_metadata: Dict[str, str]) -> bytes:\n",
"def add_metadata_and_create_cog(file_bytes: bytes, event_metadata: Dict[str, str], HAZARD: List[str], LOCATION: List[str], ) -> bytes:\n",
" \"\"\"\n",
" Rebuild GeoTIFF as a valid COG with metadata using rio-cogeo library.\n",
" \n",
Expand Down Expand Up @@ -374,11 +391,13 @@
" tags = {\n",
" 'ACTIVATION_EVENT': f\"{event_metadata['year_month']}_{event_metadata['hazard']}_{event_metadata['location']}\",\n",
" 'YEAR_MONTH': event_metadata['year_month'],\n",
" 'HAZARD': event_metadata['hazard'],\n",
" 'LOCATION': event_metadata['location'],\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",
" 'PROCESSING_DATE': datetime.utcnow().isoformat(),\n",
" 'PROCESSOR': 'S3 GeoTIFF COG Processor v1.0'\n",
" }\n",
" print(f'Hazard tag {HAZARD}')\n",
" print(f'Location tag {LOCATION}')\n",
" \n",
" # Create COG profile using original compression settings\n",
" cog_profile = {\n",
Expand Down Expand Up @@ -408,7 +427,7 @@
" dst_path=output_path,\n",
" dst_kwargs=cog_profile,\n",
" add_mask=False,\n",
" overview_level=4,\n",
" overview_level=5,\n",
" overview_resampling='average',\n",
" web_optimized=True,\n",
" additional_cog_metadata=tags,\n",
Expand Down Expand Up @@ -514,7 +533,7 @@
},
{
"cell_type": "code",
"execution_count": 81,
"execution_count": 28,
"metadata": {},
"outputs": [
{
Expand All @@ -523,6 +542,7 @@
"text": [
"Testing pattern detection:\n",
"\n",
"Remainder = Turkey_UNW_2022-04-06_to_2023-02-08_day\n",
"✓ 202302_Earthquake_Turkiye_Turkey_UNW_2022-04-06_to_2023-02-08_day.tif\n",
" Year/Month: 202302\n",
" Location: Turkiye\n",
Expand All @@ -541,6 +561,7 @@
"print(\"Testing pattern detection:\\n\")\n",
"for filename in test_filenames:\n",
" result = detect_activation_event(filename)\n",
" print(f'Remainder = {result[\"remainder\"]}')\n",
" if result:\n",
" print(f\"✓ {filename}\")\n",
" print(f\" Year/Month: {result['year_month']}\")\n",
Expand All @@ -561,7 +582,7 @@
},
{
"cell_type": "code",
"execution_count": 82,
"execution_count": 23,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -603,7 +624,7 @@
},
{
"cell_type": "code",
"execution_count": 83,
"execution_count": 30,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -633,7 +654,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_1272/2684847193.py:178: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).\n",
"/tmp/ipykernel_205/1171966028.py:178: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).\n",
" 'PROCESSING_DATE': datetime.utcnow().isoformat(),\n",
"Reading input: /vsimem/input.tif\n",
"\n"
Expand All @@ -645,7 +666,9 @@
"text": [
" Reading original file settings...\n",
" Original settings: compress=zstd, predictor=None, level=None\n",
" Rebuilding as COG (preserving original compression settings)...\n"
" Rebuilding as COG (preserving original compression settings)...\n",
"Hazard tag None\n",
"Location tag None\n"
]
},
{
Expand All @@ -662,15 +685,15 @@
"output_type": "stream",
"text": [
" COG creation complete with embedded metadata\n",
" Output size: 150,638,215 bytes\n",
" Output size: 150,638,215 bytes\n",
" Size change: -4.8%\n",
" Output size: 150,769,442 bytes\n",
" Output size: 150,769,442 bytes\n",
" Size change: -4.7%\n",
" Validating output COG structure...\n",
" ✓ Output is valid COG\n",
" Compression: ZSTD\n",
" Tile size: [512, 512]\n",
" Overviews: 4 levels\n",
" Uploading to s3://nasa-disasters-dev/ProgramData/Landsat/burnRatio/202501_Fire_CA_LC09_NBR_182831_041036_2025-01-14_day.tif...\n",
" Overviews: 5 levels\n",
" Uploading to s3://nasa-disasters-dev/ProgramData/Landsat/burnRatio/LC09_NBR_182831_041036_2025-01-14_day.tif...\n",
" ✓ Upload successful\n",
"\n",
"================================================================================\n",
Expand All @@ -697,6 +720,7 @@
" \n",
" # Step 1: Detect activation event pattern\n",
" event_metadata = detect_activation_event(filename)\n",
" final_filename = f'{event_metadata[\"remainder\"]}.tif'\n",
" \n",
" if not event_metadata:\n",
" result['message'] = 'No activation event pattern detected - skipping'\n",
Expand Down Expand Up @@ -730,7 +754,7 @@
" \n",
" # Step 3: Add metadata and create/optimize COG\n",
" print(\" Creating COG with metadata and ZSTD compression...\")\n",
" modified_bytes = add_metadata_and_create_cog(file_bytes, event_metadata)\n",
" modified_bytes = add_metadata_and_create_cog(file_bytes, event_metadata, HAZARD, LOCATION)\n",
" print(f\" Output size: {len(modified_bytes):,} bytes\")\n",
" \n",
" size_change = ((len(modified_bytes) - len(file_bytes)) / len(file_bytes)) * 100\n",
Expand All @@ -754,7 +778,7 @@
" result['cog_valid'] = False\n",
" \n",
" # Step 4: Upload to destination\n",
" dest_key = DESTINATION_PREFIX + filename\n",
" dest_key = DESTINATION_PREFIX + final_filename\n",
" print(f\" Uploading to s3://{DESTINATION_BUCKET}/{dest_key}...\")\n",
" \n",
" if upload_to_s3(modified_bytes, DESTINATION_BUCKET, dest_key):\n",
Expand Down
Empty file modified Jupyterhub/jupyterhub-training-guide.qmd
100644 → 100755
Empty file.
Loading
Loading