-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d5794f
commit 2185eb2
Showing
1 changed file
with
60 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,19 +115,21 @@ | |
" 'type': 'application/json',\n", | ||
" 'href': 'https://staging-stac.delta-backend.com/collections/no2-monthly'}],\n", | ||
" 'title': 'NO₂',\n", | ||
" 'assets': None,\n", | ||
" 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]},\n", | ||
" 'temporal': {'interval': [['2015-12-31 17:00:00-07',\n", | ||
" '2022-04-30 18:00:00-06']]}},\n", | ||
" 'temporal': {'interval': [['2016-01-01 00:00:00+00',\n", | ||
" '2023-09-30 00:00:00+00']]}},\n", | ||
" 'license': 'MIT',\n", | ||
" 'summaries': {'datetime': ['2016-01-01T00:00:00Z', '2022-05-01T00:00:00Z'],\n", | ||
" 'cog_default': {'max': 50064805976866816, 'min': -6618294421291008}},\n", | ||
" 'keywords': None,\n", | ||
" 'providers': None,\n", | ||
" 'summaries': {'datetime': ['2016-01-01T00:00:00Z', '2023-09-30T00:00:00Z']},\n", | ||
" 'description': 'Darker colors indicate higher nitrogen dioxide (NO₂) levels and more activity. Lighter colors indicate lower levels of NO₂ and less activity. Missing pixels indicate areas of no data most likely associated with cloud cover or snow.',\n", | ||
" 'item_assets': {'cog_default': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized',\n", | ||
" 'roles': ['data', 'layer'],\n", | ||
" 'title': 'Default COG Layer',\n", | ||
" 'description': 'Cloud optimized default layer to display on map'}},\n", | ||
" 'stac_version': '1.0.0',\n", | ||
" 'stac_extensions': ['https://stac-extensions.github.io/item-assets/v1.0.0/schema.json'],\n", | ||
" 'stac_extensions': None,\n", | ||
" 'dashboard:is_periodic': True,\n", | ||
" 'dashboard:time_density': 'month'}" | ||
] | ||
|
@@ -142,28 +144,6 @@ | |
"collection" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "7bc42fff", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"{'max': 50064805976866816, 'min': -6618294421291008}" | ||
] | ||
}, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"rescale_values = collection[\"summaries\"][\"cog_default\"]\n", | ||
"rescale_values" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "aea3352d-6a38-41c7-9dc9-f2c010b3a85b", | ||
|
@@ -176,7 +156,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"execution_count": 6, | ||
"id": "b5eb7467", | ||
"metadata": {}, | ||
"outputs": [ | ||
|
@@ -186,7 +166,7 @@ | |
"1" | ||
] | ||
}, | ||
"execution_count": 5, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
|
@@ -214,7 +194,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"execution_count": 7, | ||
"id": "79a63492-b9be-4278-85f8-5464fcd9d142", | ||
"metadata": { | ||
"tags": [] | ||
|
@@ -290,7 +270,7 @@ | |
" 'https://stac-extensions.github.io/raster/v1.1.0/schema.json']}" | ||
] | ||
}, | ||
"execution_count": 6, | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
|
@@ -300,6 +280,17 @@ | |
"item" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"id": "7bc42fff", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"item_stats = item['assets']['cog_default']['raster:bands'][0]['statistics']\n", | ||
"rescale_values = item_stats['minimum'], item_stats['maximum']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "c9b60ad7-ed96-42b2-9263-f7ddaa6ea7fe", | ||
|
@@ -312,7 +303,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"execution_count": 10, | ||
"id": "71acb916", | ||
"metadata": {}, | ||
"outputs": [ | ||
|
@@ -322,14 +313,14 @@ | |
"{'tilejson': '2.2.0',\n", | ||
" 'version': '1.0.0',\n", | ||
" 'scheme': 'xyz',\n", | ||
" 'tiles': ['https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly&item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc&assets=cog_default&color_formula=gamma+r+1.05&colormap_name=rdbu_r&rescale=-6618294421291008%2C50064805976866816'],\n", | ||
" 'tiles': ['https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly&item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc&assets=cog_default&color_formula=gamma+r+1.05&colormap_name=rdbu_r&rescale=-4107596126486528.0%2C35781585143857150'],\n", | ||
" 'minzoom': 0,\n", | ||
" 'maxzoom': 24,\n", | ||
" 'bounds': [-180.0, -90.0, 180.0, 90.0],\n", | ||
" 'center': [0.0, 0.0, 0]}" | ||
] | ||
}, | ||
"execution_count": 7, | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
|
@@ -339,7 +330,7 @@ | |
" f\"{RASTER_API_URL}/stac/tilejson.json?collection={item['collection']}&item={item['id']}\"\n", | ||
" \"&assets=cog_default\"\n", | ||
" \"&color_formula=gamma+r+1.05&colormap_name=rdbu_r\"\n", | ||
" f\"&rescale={rescale_values['min']},{rescale_values['max']}\",\n", | ||
" f\"&rescale={rescale_values[0]},{rescale_values[1]}\",\n", | ||
").json()\n", | ||
"tiles" | ||
] | ||
|
@@ -354,15 +345,17 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"execution_count": 11, | ||
"id": "b4792eed", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", | ||
"<head> \n", | ||
"<html>\n", | ||
"<head>\n", | ||
" \n", | ||
" <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", | ||
" \n", | ||
" <script>\n", | ||
|
@@ -372,41 +365,44 @@ | |
" \n", | ||
" <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", | ||
" <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", | ||
" <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", | ||
" <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", | ||
" <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", | ||
" <script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>\n", | ||
" <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>\n", | ||
" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>\n", | ||
" <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", | ||
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", | ||
" <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", | ||
" <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", | ||
" <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", | ||
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>\n", | ||
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>\n", | ||
" <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>\n", | ||
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>\n", | ||
" <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", | ||
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", | ||
" \n", | ||
" <meta name="viewport" content="width=device-width,\n", | ||
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", | ||
" <style>\n", | ||
" #map_53c3ccf28112c91094ab0e61813af94b {\n", | ||
" #map_b760f5d56c6e116deffd4c09b180e7c2 {\n", | ||
" position: relative;\n", | ||
" width: 100.0%;\n", | ||
" height: 100.0%;\n", | ||
" left: 0.0%;\n", | ||
" top: 0.0%;\n", | ||
" }\n", | ||
" .leaflet-container { font-size: 1rem; }\n", | ||
" </style>\n", | ||
" \n", | ||
"</head>\n", | ||
"<body> \n", | ||
"<body>\n", | ||
" \n", | ||
" <div class="folium-map" id="map_53c3ccf28112c91094ab0e61813af94b" ></div>\n", | ||
" \n", | ||
" <div class="folium-map" id="map_b760f5d56c6e116deffd4c09b180e7c2" ></div>\n", | ||
" \n", | ||
"</body>\n", | ||
"<script> \n", | ||
"<script>\n", | ||
" \n", | ||
" \n", | ||
" var map_53c3ccf28112c91094ab0e61813af94b = L.map(\n", | ||
" "map_53c3ccf28112c91094ab0e61813af94b",\n", | ||
" var map_b760f5d56c6e116deffd4c09b180e7c2 = L.map(\n", | ||
" "map_b760f5d56c6e116deffd4c09b180e7c2",\n", | ||
" {\n", | ||
" center: [0, 0],\n", | ||
" center: [0.0, 0.0],\n", | ||
" crs: L.CRS.EPSG3857,\n", | ||
" zoom: 1,\n", | ||
" zoomControl: true,\n", | ||
|
@@ -418,18 +414,22 @@ | |
"\n", | ||
" \n", | ||
" \n", | ||
" var tile_layer_b857ce32e1cc437e1998c6d0926b2f21 = L.tileLayer(\n", | ||
" "https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly\\u0026item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc\\u0026assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=rdbu_r\\u0026rescale=-6618294421291008%2C50064805976866816",\n", | ||
" var tile_layer_8bcaf12e8a9ebcbfd6f653010cb98f18 = L.tileLayer(\n", | ||
" "https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly\\u0026item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc\\u0026assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=rdbu_r\\u0026rescale=-4107596126486528.0%2C35781585143857150",\n", | ||
" {"attribution": "VEDA", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", | ||
" ).addTo(map_53c3ccf28112c91094ab0e61813af94b);\n", | ||
" );\n", | ||
" \n", | ||
" \n", | ||
" tile_layer_8bcaf12e8a9ebcbfd6f653010cb98f18.addTo(map_b760f5d56c6e116deffd4c09b180e7c2);\n", | ||
" \n", | ||
"</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" | ||
"</script>\n", | ||
"</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" | ||
], | ||
"text/plain": [ | ||
"<folium.folium.Map at 0x7f63906c6af0>" | ||
"<folium.folium.Map at 0x7fcac62cb650>" | ||
] | ||
}, | ||
"execution_count": 8, | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
|
@@ -444,9 +444,9 @@ | |
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python [conda env:notebook] *", | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "conda-env-notebook-py" | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
|
@@ -458,7 +458,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
"version": "3.11.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
|