Skip to content

Commit 6494251

Browse files
Generate notebooks and solutions
1 parent 55abcf2 commit 6494251

43 files changed

Lines changed: 3206 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

notebooks/14-xarray-intro.ipynb

Lines changed: 1744 additions & 0 deletions
Large diffs are not rendered by default.

notebooks/15-xarray-datasets.ipynb

Lines changed: 1373 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tc_data = xr.open_rasterio("./data/gent/raster/2020-09-17_Sentinel_2_L1C_True_color.tiff")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Create the histogram plots
2+
fig, (ax0, ax1) = plt.subplots(1, 2, sharey=True)
3+
b4_data.plot.hist(bins=30, log=True, ax=ax0)
4+
b4_data_f.plot.hist(bins=30, log=True, ax=ax1);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Calculate the min and max for each channel
2+
h_min = herstappe_data.min(dim=["x", "y"])
3+
h_max = herstappe_data.max(dim=["x", "y"])
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Rescale the data
2+
herstappe_rescaled = ((herstappe_data - h_min)/(h_max - h_min))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Make a plot
2+
herstappe_rescaled.plot.imshow(figsize=(9, 5))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
gent = xr.open_rasterio("./data/gent/raster/2020-09-17_Sentinel_2_L1C_True_color.tiff")
2+
gent
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gent.plot.imshow()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Convert to float and make 65535 equal to Nan
2+
gent_f = gent.astype(float)
3+
gent_f = gent_f.where(gent != 65535)

0 commit comments

Comments
 (0)