Skip to content

Commit

Permalink
Update docs image and add code that produced the image.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrp84 committed Jun 6, 2023
1 parent a3af1d8 commit 6d3e1eb
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 14 deletions.
76 changes: 62 additions & 14 deletions Examples/Complex_SEVIRI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "c715463a",
"metadata": {
"pycharm": {
Expand All @@ -67,7 +67,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "c3c82074",
"metadata": {
"pycharm": {
Expand All @@ -91,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "0f07e2b9",
"metadata": {
"pycharm": {
Expand Down Expand Up @@ -139,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "5e0b928a",
"metadata": {
"pycharm": {
Expand Down Expand Up @@ -208,7 +208,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "351f79c3",
"metadata": {
"pycharm": {
Expand All @@ -224,7 +224,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "fb118cb5",
"metadata": {
"pycharm": {
Expand All @@ -240,7 +240,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "f15954c7",
"metadata": {
"pycharm": {
Expand All @@ -256,7 +256,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "feb04898",
"metadata": {
"pycharm": {
Expand All @@ -273,7 +273,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "122fdbf8",
"metadata": {
"pycharm": {
Expand All @@ -291,7 +291,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "e1c4a155",
"metadata": {
"pycharm": {
Expand All @@ -306,7 +306,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"id": "7cd3640c",
"metadata": {
"pycharm": {
Expand All @@ -321,7 +321,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"id": "bbaa5bf4",
"metadata": {
"pycharm": {
Expand All @@ -336,7 +336,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"id": "3d7343d9",
"metadata": {
"pycharm": {
Expand All @@ -352,7 +352,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"id": "6f2c3cbc",
"metadata": {
"pycharm": {
Expand All @@ -373,6 +373,54 @@
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "e4fd53d4",
"metadata": {},
"source": [
"## Note\n",
"#### The code below produces the example SEVIRI image shown in the `pycoxmunk` documentation.\n",
"\n",
"It applies the land / sea mask to the data, showing SEVIRI data over land and the Cox-Munk reflectance over sea."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9f571cc5",
"metadata": {},
"outputs": [],
"source": [
"# Load the RGB composite for the land component\n",
"pcm.scn.load(['natural_color'])\n",
"land_b1 = pcm.scn['natural_color'].data[0, :, :]\n",
"land_b2 = pcm.scn['natural_color'].data[1, :, :]\n",
"land_b3 = pcm.scn['natural_color'].data[2, :, :]\n",
"\n",
"# The sea component from Cox-Munk\n",
"sea_b1 = pcm.scn['cox_munk_refl_VIS006'].data\n",
"sea_b2 = pcm.scn['cox_munk_refl_VIS008'].data\n",
"sea_b3 = pcm.scn['cox_munk_refl_IR_016'].data\n",
"\n",
"# Apply the land / sea mask\n",
"lsm = pcm.pixmask.mask\n",
"out_b1 = np.where(lsm == 1, land_b1, sea_b1)\n",
"out_b2 = np.where(lsm == 1, land_b2, sea_b2)\n",
"out_b3 = np.where(lsm == 1, land_b3, sea_b3)\n",
"\n",
"# Apply the result to the Scene and save to disk.\n",
"pcm.scn['natural_color'].data = np.moveaxis(np.dstack((out_b3, out_b2, out_b1)), 2, 0)\n",
"pcm.scn.save_dataset('natural_color', base_dir='D:/sat_data/SEV/out2/', fill_value=0, writer='simple_image')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "273caf29",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Binary file modified docs/_img/CM_Overlay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6d3e1eb

Please sign in to comment.