Skip to content

Commit

Permalink
remove fluff
Browse files Browse the repository at this point in the history
  • Loading branch information
egagli committed Apr 2, 2024
1 parent 33749b0 commit 26486e3
Showing 1 changed file with 43 additions and 166 deletions.
209 changes: 43 additions & 166 deletions docs/examples/remote_sensing_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12445,173 +12445,50 @@
"metadata": {},
"outputs": [],
"source": [
"list(bbox_gdf.total_bounds)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install --upgrade xee"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import xee"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!earthengine authenticate --quiet"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import ee\n",
"# list(bbox_gdf.total_bounds)\n",
"\n",
"ee.Initialize(opt_url=\"https://earthengine-highvolume.googleapis.com\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bbox_ee = ee.Geometry.Rectangle(153.0, -43.0, 154.0, -42.0)\n",
"bbox_ee = ee.Geometry.Rectangle(*list(bbox_gdf.total_bounds))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bbox_ee = ee.Geometry.BBox(*list(bbox_gdf.total_bounds))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bbox_ee.Polygon()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ic.first().select(0).projection()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ic = ee.ImageCollection(\"JAXA/ALOS/PALSAR-2/Level2_2/ScanSAR\").filterDate(\n",
" \"2022-07-01\", \"2022-07-31\"\n",
")\n",
"ds = xr.open_dataset(\n",
" ic,\n",
" geometry=bbox_ee,\n",
" projection=ic.first().select(0).projection(),\n",
" crs=\"EPSG:4326\",\n",
" engine=\"ee\",\n",
" scale=0.01,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds[\"HH\"].isel(time=1).plot()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def dn_to_db(dn):\n",
" db = 10 * np.log10(dn**2) - 83\n",
" return db"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds[\"HH\"].map_blocks(dn_to_db)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds[\"HH\"].isel(time=0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds.time.values[0:10]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# auth: planetary computer, google earth engine, earthdata, etc. and save?"
"# !pip install --upgrade xee\n",
"\n",
"# import xee\n",
"\n",
"# !earthengine authenticate --quiet\n",
"\n",
"# import ee\n",
"\n",
"# ee.Initialize(opt_url=\"https://earthengine-highvolume.googleapis.com\")\n",
"\n",
"# bbox_ee = ee.Geometry.Rectangle(153.0, -43.0, 154.0, -42.0)\n",
"# bbox_ee = ee.Geometry.Rectangle(*list(bbox_gdf.total_bounds))\n",
"\n",
"# bbox_ee = ee.Geometry.BBox(*list(bbox_gdf.total_bounds))\n",
"\n",
"# bbox_ee.Polygon()\n",
"\n",
"# ic.first().select(0).projection()\n",
"\n",
"# ic = ee.ImageCollection(\"JAXA/ALOS/PALSAR-2/Level2_2/ScanSAR\").filterDate(\n",
"# \"2022-07-01\", \"2022-07-31\"\n",
"# )\n",
"# ds = xr.open_dataset(\n",
"# ic,\n",
"# geometry=bbox_ee,\n",
"# projection=ic.first().select(0).projection(),\n",
"# crs=\"EPSG:4326\",\n",
"# engine=\"ee\",\n",
"# scale=0.01,\n",
"# )\n",
"\n",
"# ds\n",
"\n",
"# ds[\"HH\"].isel(time=1).plot()\n",
"\n",
"# def dn_to_db(dn):\n",
"# db = 10 * np.log10(dn**2) - 83\n",
"# return db\n",
"\n",
"# ds[\"HH\"].map_blocks(dn_to_db)\n",
"# ds[\"HH\"].isel(time=0)\n",
"# ds.time.values[0:10]"
]
}
],
Expand Down

0 comments on commit 26486e3

Please sign in to comment.