Skip to content

Commit c1d7c43

Browse files
committed
minor fixes to episode
1 parent c7a6d52 commit c1d7c43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

_episodes/20-parallel-raster-computations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ resolution, while the scene classification layer has a lower resolution (20 m):
8282
import rioxarray
8383
scl = rioxarray.open_rasterio(scl_href)
8484
visual = rioxarray.open_rasterio(visual_href)
85-
scl.rio.resolution(), visual.rio.resolution()
85+
print(scl.rio.resolution(), visual.rio.resolution())
8686
~~~
8787
{: .language-python}
8888

8989
~~~
90-
((20.0, -20.0), (10.0, -10.0))
90+
(20.0, -20.0), (10.0, -10.0)
9191
~~~
9292
{: .output}
9393

@@ -101,7 +101,7 @@ image we thus open the first level overview (zoom factor 2) and check that the r
101101

102102
~~~
103103
visual = rioxarray.open_rasterio(visual_href, overview_level=0)
104-
visual.rio.resolution()
104+
print(visual.rio.resolution())
105105
~~~
106106
{: .language-python}
107107

@@ -228,15 +228,15 @@ Xarray and Dask also provide a graphical representation of the raster data array
228228
> > depending on the application! Here, we might select a chunks shape of `(1, 6144, 6144)`:
229229
> >
230230
> > ~~~
231-
> > band = rioxarray.open_rasterio(band_url, chunks=(1, 6144, 6144))
231+
> > band = rioxarray.open_rasterio(blue_band_href, chunks=(1, 6144, 6144))
232232
> > ~~~
233233
> > {: .language-python}
234234
> >
235235
> > which leads to chunks 72 MB large: ((1 x 6144 x 6144) x 2 bytes / 2^20 = 72 MB). Also, we can let `rioxarray` and Dask
236236
> > figure out appropriate chunk shapes by setting `chunks="auto"`:
237237
> >
238238
> > ~~~
239-
> > band = rioxarray.open_rasterio(band_url, chunks="auto")
239+
> > band = rioxarray.open_rasterio(blue_band_href, chunks="auto")
240240
> > ~~~
241241
> > {: .language-python}
242242
> >
@@ -300,7 +300,7 @@ from threading import Lock
300300
%%time
301301
mask = scl.squeeze().isin([8, 9])
302302
visual_masked = visual.where(~mask, other=0)
303-
visual_store = visual_masked.rio.to_raster("band_masked.tif", tiled=True, lock=threading.Lock(), compute=False)
303+
visual_store = visual_masked.rio.to_raster("band_masked.tif", tiled=True, lock=Lock(), compute=False)
304304
~~~
305305
{: .language-python}
306306

0 commit comments

Comments
 (0)