Skip to content

Commit 6d3e1eb

Browse files
committed
Update docs image and add code that produced the image.
1 parent a3af1d8 commit 6d3e1eb

File tree

2 files changed

+62
-14
lines changed

2 files changed

+62
-14
lines changed

Examples/Complex_SEVIRI.ipynb

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"cell_type": "code",
47-
"execution_count": 1,
47+
"execution_count": null,
4848
"id": "c715463a",
4949
"metadata": {
5050
"pycharm": {
@@ -67,7 +67,7 @@
6767
},
6868
{
6969
"cell_type": "code",
70-
"execution_count": 2,
70+
"execution_count": null,
7171
"id": "c3c82074",
7272
"metadata": {
7373
"pycharm": {
@@ -91,7 +91,7 @@
9191
},
9292
{
9393
"cell_type": "code",
94-
"execution_count": 3,
94+
"execution_count": null,
9595
"id": "0f07e2b9",
9696
"metadata": {
9797
"pycharm": {
@@ -139,7 +139,7 @@
139139
},
140140
{
141141
"cell_type": "code",
142-
"execution_count": 4,
142+
"execution_count": null,
143143
"id": "5e0b928a",
144144
"metadata": {
145145
"pycharm": {
@@ -208,7 +208,7 @@
208208
},
209209
{
210210
"cell_type": "code",
211-
"execution_count": 5,
211+
"execution_count": null,
212212
"id": "351f79c3",
213213
"metadata": {
214214
"pycharm": {
@@ -224,7 +224,7 @@
224224
},
225225
{
226226
"cell_type": "code",
227-
"execution_count": 6,
227+
"execution_count": null,
228228
"id": "fb118cb5",
229229
"metadata": {
230230
"pycharm": {
@@ -240,7 +240,7 @@
240240
},
241241
{
242242
"cell_type": "code",
243-
"execution_count": 7,
243+
"execution_count": null,
244244
"id": "f15954c7",
245245
"metadata": {
246246
"pycharm": {
@@ -256,7 +256,7 @@
256256
},
257257
{
258258
"cell_type": "code",
259-
"execution_count": 8,
259+
"execution_count": null,
260260
"id": "feb04898",
261261
"metadata": {
262262
"pycharm": {
@@ -273,7 +273,7 @@
273273
},
274274
{
275275
"cell_type": "code",
276-
"execution_count": 9,
276+
"execution_count": null,
277277
"id": "122fdbf8",
278278
"metadata": {
279279
"pycharm": {
@@ -291,7 +291,7 @@
291291
},
292292
{
293293
"cell_type": "code",
294-
"execution_count": 10,
294+
"execution_count": null,
295295
"id": "e1c4a155",
296296
"metadata": {
297297
"pycharm": {
@@ -306,7 +306,7 @@
306306
},
307307
{
308308
"cell_type": "code",
309-
"execution_count": 11,
309+
"execution_count": null,
310310
"id": "7cd3640c",
311311
"metadata": {
312312
"pycharm": {
@@ -321,7 +321,7 @@
321321
},
322322
{
323323
"cell_type": "code",
324-
"execution_count": 12,
324+
"execution_count": null,
325325
"id": "bbaa5bf4",
326326
"metadata": {
327327
"pycharm": {
@@ -336,7 +336,7 @@
336336
},
337337
{
338338
"cell_type": "code",
339-
"execution_count": 13,
339+
"execution_count": null,
340340
"id": "3d7343d9",
341341
"metadata": {
342342
"pycharm": {
@@ -352,7 +352,7 @@
352352
},
353353
{
354354
"cell_type": "code",
355-
"execution_count": 14,
355+
"execution_count": null,
356356
"id": "6f2c3cbc",
357357
"metadata": {
358358
"pycharm": {
@@ -373,6 +373,54 @@
373373
"metadata": {},
374374
"outputs": [],
375375
"source": []
376+
},
377+
{
378+
"cell_type": "markdown",
379+
"id": "e4fd53d4",
380+
"metadata": {},
381+
"source": [
382+
"## Note\n",
383+
"#### The code below produces the example SEVIRI image shown in the `pycoxmunk` documentation.\n",
384+
"\n",
385+
"It applies the land / sea mask to the data, showing SEVIRI data over land and the Cox-Munk reflectance over sea."
386+
]
387+
},
388+
{
389+
"cell_type": "code",
390+
"execution_count": null,
391+
"id": "9f571cc5",
392+
"metadata": {},
393+
"outputs": [],
394+
"source": [
395+
"# Load the RGB composite for the land component\n",
396+
"pcm.scn.load(['natural_color'])\n",
397+
"land_b1 = pcm.scn['natural_color'].data[0, :, :]\n",
398+
"land_b2 = pcm.scn['natural_color'].data[1, :, :]\n",
399+
"land_b3 = pcm.scn['natural_color'].data[2, :, :]\n",
400+
"\n",
401+
"# The sea component from Cox-Munk\n",
402+
"sea_b1 = pcm.scn['cox_munk_refl_VIS006'].data\n",
403+
"sea_b2 = pcm.scn['cox_munk_refl_VIS008'].data\n",
404+
"sea_b3 = pcm.scn['cox_munk_refl_IR_016'].data\n",
405+
"\n",
406+
"# Apply the land / sea mask\n",
407+
"lsm = pcm.pixmask.mask\n",
408+
"out_b1 = np.where(lsm == 1, land_b1, sea_b1)\n",
409+
"out_b2 = np.where(lsm == 1, land_b2, sea_b2)\n",
410+
"out_b3 = np.where(lsm == 1, land_b3, sea_b3)\n",
411+
"\n",
412+
"# Apply the result to the Scene and save to disk.\n",
413+
"pcm.scn['natural_color'].data = np.moveaxis(np.dstack((out_b3, out_b2, out_b1)), 2, 0)\n",
414+
"pcm.scn.save_dataset('natural_color', base_dir='D:/sat_data/SEV/out2/', fill_value=0, writer='simple_image')"
415+
]
416+
},
417+
{
418+
"cell_type": "code",
419+
"execution_count": null,
420+
"id": "273caf29",
421+
"metadata": {},
422+
"outputs": [],
423+
"source": []
376424
}
377425
],
378426
"metadata": {

docs/_img/CM_Overlay.jpg

785 KB
Loading

0 commit comments

Comments
 (0)