<jupyter_start><jupyter_text>Loading the 1st DEM<jupyter_code>%%time

X_0, p_0 = stitch_dem(bounds, 
                      dem_0, 
                      # More than 5 workers can cause timeout errors.
                      max_workers=5,
                      dst_ellipsoidal_height=ellipsoidal_hgt)
p_0
# source https://stackoverflow.com/a/70334691
fig, ax = plt.subplots()
data = plot.show(X_0, transform=p_0['transform'], ax=ax)
im = data.get_images()[0]
fig.colorbar(im, label='Ellipsoidal Height (m)', ax=ax)<jupyter_output><empty_output><jupyter_text>Loading the 2nd DEM<jupyter_code>%%time

X_1, p_1 = stitch_dem(bounds, 
                      dem_1, 
                      # More than 5 workers can cause timeout errors.
                      max_workers=5,
                      dst_ellipsoidal_height=ellipsoidal_hgt)
p_1<jupyter_output>Reading 3dep Datasets: 100%|█| 12/12 [00:05<00:00,  2.08it/s<jupyter_text>ComparisonWe first have to reproject the two DEMs into the same frame; although they were called using the same bounds, dem-stitcher aligns to |the original pixel resolution.<jupyter_code>X_1_r, _ = reproject_arr_to_match_profile(X_1, p_1, p_0)
X_1_r = X_1_r[0, ...]<jupyter_output><empty_output><jupyter_text>We get the qualitative statistics of the difference of the two DEMs.<jupyter_code>diff = (X_0 - X_1_r)
diff_r = diff[~np.isnan(diff)]
plt.hist(diff_r, bins=50, range=(-10, 10))
plt.xlabel(f'{dem_1} - {dem_0} (m)')
df = pd.DataFrame({'diff': diff_r})
df['diff_cm'] = np.round(df['diff'] * 100, 3)
df.drop(columns=['diff'], inplace=True)
df.describe()
# source https://stackoverflow.com/a/70334691
fig, ax = plt.subplots()
data = plot.show(diff, transform=p_0['transform'], ax=ax, vmin=-10, vmax=10)
im = data.get_images()[0]
fig.colorbar(im, label='Ellipsoidal Height (m)', ax=ax)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1342391304347826, 'fraction_numerical': 0.042934782608695654, 'mean_word_length': 3.7694300518134716, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '556417', 'license': 'Apache-2.0', 'n_tokens_mistral': 747, 'n_tokens_neox': 682, 'n_words': 141, 'path': 'notebooks/Comparing_DEMs.ipynb', 'repo_name': 'bjmarfito/dem_stitcher', 'size': '1840'}