basic course content added, more TODO

This commit is contained in:
Thomas (Tom) C. Gorordo 2026-02-22 18:07:24 -08:00
commit 76468828e3
Signed by: tgorordo
GPG key ID: 0CBED22BB0D94490
94 changed files with 22022 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 KiB

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,99 @@
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "marimo>=0.19.7",
# ]
# ///
import marimo
__generated_with = "0.19.11"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
return (mo,)
@app.cell
def _():
import numpy as np
return (np,)
@app.cell
def _():
import matplotlib.pyplot as plt
return (plt,)
@app.cell
def _(mo):
from pathlib import Path
mo.pdf(src=Path("Homework0.pdf"), width="100%", height="50vh")
return
@app.cell
def _(np):
def unit_gridcircle_mask(N):
ruler = np.arange(-(N + 1.5), (N + 2.5)) / N
xx, yy = np.meshgrid(ruler, ruler)
mask = np.sqrt(np.square(xx) + np.square(yy)) <= 1
return mask
return (unit_gridcircle_mask,)
@app.cell
def _(np, unit_gridcircle_mask):
def unit_gridcircle_area(N):
area = float(np.sum(unit_gridcircle_mask(N), dtype=float) / N**2)
return area
return (unit_gridcircle_area,)
@app.cell
def _(np, plt, unit_gridcircle_mask):
plt.matshow(unit_gridcircle_mask(5), cmap=plt.cm.gray_r)
plt.grid(visible=True, color="cyan")
plt.xticks(ticks=(np.arange(14) - 0.5))
plt.yticks(ticks=(np.arange(14) - 0.5))
f = plt.gca()
f.axes.xaxis.set_ticklabels([])
f.axes.yaxis.set_ticklabels([])
plt.show()
return
@app.cell
def _(np, plt, unit_gridcircle_area):
Npts = 100
Ns = np.unique(np.floor(np.logspace(np.log10(2), np.log10(2000), Npts)).astype(int))
As = list(map(unit_gridcircle_area, Ns))
plt.figure(figsize=(8,6))
plt.semilogx(Ns, As, 'o-', color='steelblue', markerfacecolor='lightblue', markersize=12)
xlim = plt.gca().get_xlim()
plt.semilogx((xlim[0], xlim[1]), (np.pi, np.pi), ':', linewidth=2.5, color='darkorange')
plt.xlabel('N', fontsize=14)
plt.ylabel('Area', fontsize=14)
plt.xticks(fontsize=12)
plt.yticks(fontsize=12)
plt.show()
return
@app.cell
def _():
return
if __name__ == "__main__":
app.run()

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,163 @@
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "marimo>=0.19.7",
# ]
# ///
import marimo
__generated_with = "0.19.11"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
return (mo,)
@app.cell
def _():
import numpy as np
return (np,)
@app.cell
def _():
import matplotlib.pyplot as plt
return (plt,)
@app.cell
def _(mo):
from pathlib import Path
mo.pdf(src=Path("Homework1.pdf"), width="100%", height="50vh")
return
@app.cell(hide_code=True)
def _(mo):
mo.md(r"""
## Puzzles
### a.
""")
return
@app.cell
def _(plt):
im_A_png = plt.imread("AuLait_gray.png")
im_A_tif = plt.imread("AuLait_gray.tif")
return im_A_png, im_A_tif
@app.cell
def _(im_A_png, plt):
plt.imshow(im_A_png, "gray")
return
@app.cell
def _(im_A_tif):
im_A_tif.shape
return
@app.cell
def _(im_A_png, np):
np.max(im_A_png)
return
@app.cell
def _(im_A_tif, plt):
plt.imshow(im_A_tif, "gray")
return
@app.cell
def _(im_A_tif):
im_A_tif.shape
return
@app.cell
def _(im_A_tif, np):
np.max(im_A_tif)
return
@app.cell(hide_code=True)
def _(mo):
mo.md(r"""
## b.
""")
return
@app.cell
def _():
from skimage import io
return (io,)
@app.cell
def _(im_A_png, io):
io.imsave("AuLait_gray_png_skout_unscaled.tif", im_A_png)
return
@app.cell
def _(plt):
im_A_sk_tif_unscaled = plt.imread("AuLait_gray_png_skout_unscaled.tif")
return (im_A_sk_tif_unscaled,)
@app.cell
def _(im_A_sk_tif_unscaled):
im_A_sk_tif_unscaled.shape
return
@app.cell
def _(im_A_sk_tif_unscaled, plt):
plt.imshow(im_A_sk_tif_unscaled)
return
@app.cell
def _(im_A_png, io):
io.imsave("AuLait_gray_png_skout_scaledup.tif", im_A_png * 255)
return
@app.cell
def _(plt):
im_A_sk_tif_scaled = plt.imread("AuLait_gray_png_skout_scaledup.tif")
return (im_A_sk_tif_scaled,)
@app.cell
def _(im_A_sk_tif_scaled):
im_A_sk_tif_scaled.shape
return
@app.cell
def _(im_A_sk_tif_scaled, plt):
plt.imshow(im_A_sk_tif_scaled)
return
@app.cell
def _():
return
if __name__ == "__main__":
app.run()

File diff suppressed because one or more lines are too long