An example demonstrating grid building and interactive use of the grids. Warning: this takes a while.
from IPython.html.widgets import interact, interactive, fixed
from matplotlib import pyplot as plt
from IPython.display import clear_output, display, HTML
%run ph2co_grid_computation_mm.py
/Users/adam/repos/astroquery/astroquery/lamda/__init__.py:21: UserWarning: Experimental: LAMDA has not yet been refactored to have its API match the rest of astroquery. warnings.warn("Experimental: LAMDA has not yet been refactored to have its API match the rest of astroquery.") /Users/adam/repos/pyradex/pyradex/core.py:800: RuntimeWarning: invalid value encountered in divide frac_level_diff = level_diff/self.level_population
lvg Tex tau ... brightness T_B K ... erg / (cm2 Hz s sr) K ---------------- ---------------- ... ------------------- --------------- -0.0882039508932 -0.0979960800905 ... 4.61746449234e-22 0.296964156461 9.103986656 5.451913832 ... 3.54509369553e-14 5.44271465357 -0.18371087569 -0.0152884958926 ... 1.75625508037e-21 0.0452137414101
%run -i interactive_setup_mm.py
run_plot_temden()
from matplotlib.ticker import FuncFormatter
fig = plt.figure(figsize=(16,10))
ax = fig.gca()
ax.yaxis.set_major_formatter(FuncFormatter(lambda x,y: str(densities[int(x)]) if x<len(densities) else ""))
ax.xaxis.set_major_formatter(FuncFormatter(lambda x,y: str(temperatures[int(x)]) if x<len(temperatures) else ""))
plt.imshow(fluxgrid_303/fluxgrid_321, vmin=1, vmax=5)
plt.xlabel("Temperature")
plt.ylabel("Density")
plt.colorbar()
<matplotlib.colorbar.Colorbar instance at 0x1653a8c68>
from matplotlib.ticker import FuncFormatter
fig = plt.figure(figsize=(16,10))
ax = fig.gca()
ax.yaxis.set_major_formatter(FuncFormatter(lambda x,y: str(densities[int(x)]) if x<len(densities) else ""))
ax.xaxis.set_major_formatter(FuncFormatter(lambda x,y: str(temperatures[int(x)]) if x<len(temperatures) else ""))
plt.imshow(fluxgrid_303/fluxgrid_322, vmin=1, vmax=5)
plt.xlabel("Temperature")
plt.ylabel("Density")
plt.colorbar()
<matplotlib.colorbar.Colorbar instance at 0x16541a5a8>
plt.imshow(taugrid_303)
plt.colorbar()
<matplotlib.colorbar.Colorbar instance at 0x1657ad368>
densities
array([ 3.16227766e+02, 5.45559478e+02, 9.41204967e+02, 1.62377674e+03, 2.80135676e+03, 4.83293024e+03, 8.33782223e+03, 1.43844989e+04, 2.48162892e+04, 4.28133240e+04, 7.38619982e+04, 1.27427499e+05, 2.19839265e+05, 3.79269019e+05, 6.54318913e+05, 1.12883789e+06, 1.94748304e+06, 3.35981829e+06, 5.79639395e+06, 1.00000000e+07])