This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
# Helper function used for visualization in the following examples | |
def identify_axes(ax_dict, fontsize=48): | |
""" | |
Helper to identify the Axes in the examples below. | |
Draws the label in a large font in the center of the Axes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the maps I will use | |
TEMPERATURE="BASE/Obelisk_00194_Projection_y_temperature_density.png" | |
GAMMA="BASE/Obelisk_00194_Projection_y_Gamma_HI_density.png" | |
DENSITY="BASE/Obelisk_00194_Projection_y_H_nuclei_density.png" | |
DM="BASE/Obelisk_00194_Projection_y_DM_density.png" | |
STARS="BASE/Obelisk_00194_Projection_y_star_density.png" | |
SIZE=$(convert $TEMPERATURE -ping -format "%w" info:) | |
HALF=$(echo "scale=0;$SIZE / 2" | bc -l) | |
ONETHIRD=$(echo "scale=0; $SIZE / 3" | bc -l) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def chladni(n, m, N=100): | |
x = np.linspace(-1,1,N) | |
y = np.linspace(-1,1,N) | |
xx, yy = np.meshgrid(x, y) | |
sgn = -1 if n>m else 1 | |
return np.cos(n*np.pi*xx/2.)*np.cos(m*np.pi*yy/2.) + sgn*np.cos(m*np.pi*xx/2.)*np.cos(n*np.pi*yy/2.) | |
def all_chladni(nr=10, mr=10): | |
fig, ax = plt.subplots(nr, mr, figsize=(nr+2.5,mr+2.5), sharex=True, sharey=True) | |
for n in range(nr): |