|
21 | 21 | "source": [ |
22 | 22 | "import numpy as np\n", |
23 | 23 | "import matplotlib.pyplot as plt\n", |
24 | | - "from matplotlib.colors import LogNorm\n", |
25 | 24 | "\n", |
26 | 25 | "import scopesim_templates as sim_tp" |
27 | 26 | ] |
|
41 | 40 | "metadata": {}, |
42 | 41 | "outputs": [], |
43 | 42 | "source": [ |
44 | | - "my_cluster = sim_tp.stellar.clusters.cluster(mass=1000.0, # [Msun]\n", |
45 | | - " distance=8000, # [pc]\n", |
46 | | - " core_radius=1) # [pc]\n", |
| 43 | + "my_cluster = sim_tp.stellar.clusters.cluster(\n", |
| 44 | + " mass=1000.0, # [Msun]\n", |
| 45 | + " distance=8000, # [pc]\n", |
| 46 | + " core_radius=1, # [pc]\n", |
| 47 | + ")\n", |
47 | 48 | "my_cluster.plot()" |
48 | 49 | ] |
49 | 50 | }, |
|
63 | 64 | "outputs": [], |
64 | 65 | "source": [ |
65 | 66 | "# See the docstring of `elliptical` for more keywords\n", |
66 | | - "my_elliptical = sim_tp.extragalactic.galaxies.elliptical(half_light_radius=30, # [arcsec]\n", |
67 | | - " pixel_scale=0.1, # [arcsec]\n", |
68 | | - " filter_name=\"Ks\",\n", |
69 | | - " amplitude=10,\n", |
70 | | - " normalization=\"total\", # [Ks=10 for integrated flux]\n", |
71 | | - " n=4, # Sersic index \n", |
72 | | - " ellipticity=0.5,\n", |
73 | | - " angle=30)\n", |
| 67 | + "my_elliptical = sim_tp.extragalactic.galaxies.elliptical(\n", |
| 68 | + " half_light_radius=30, # [arcsec]\n", |
| 69 | + " pixel_scale=0.1, # [arcsec]\n", |
| 70 | + " filter_name=\"Ks\",\n", |
| 71 | + " amplitude=10,\n", |
| 72 | + " normalization=\"total\", # [Ks=10 for integrated flux]\n", |
| 73 | + " n=4, # Sersic index \n", |
| 74 | + " ellipticity=0.5,\n", |
| 75 | + " angle=30, # [deg]\n", |
| 76 | + ")\n", |
74 | 77 | "\n", |
75 | 78 | "plt.figure(figsize=(12, 5))\n", |
76 | 79 | "plt.subplot(121)\n", |
77 | | - "plt.imshow(my_elliptical.fields[0].data, norm=LogNorm(), extent=[-25.6, 25.6, -25.6, 25.6])\n", |
| 80 | + "plt.imshow(my_elliptical.fields[0].data, norm=\"log\",\n", |
| 81 | + " extent=[-25.6, 25.6, -25.6, 25.6])\n", |
78 | 82 | "plt.xlabel(\"[arcsec]\")\n", |
79 | 83 | "plt.subplot(122)\n", |
80 | 84 | "wave = np.arange(5000, 25000) # [angstrom]\n", |
|
99 | 103 | "name": "python", |
100 | 104 | "nbconvert_exporter": "python", |
101 | 105 | "pygments_lexer": "ipython3", |
102 | | - "version": "3.9.16" |
| 106 | + "version": "3.12.7" |
103 | 107 | } |
104 | 108 | }, |
105 | 109 | "nbformat": 4, |
|
0 commit comments