@@ -26,29 +26,19 @@ set_theme!(merge!(curr_theme, theme_latexfonts()))
2626# A region spanned by radii between the horizon and 10M at varying inclinations will be ray traced onto the 15x15
2727# screen of the observer.
2828
29- metric = Krang. Kerr (0.01 ); # Kerr metric with a spin of 0.99
29+ metric = Krang. Kerr (0.99 ); # Kerr metric with a spin of 0.99
3030θo = 45 * π / 180 ; # inclination angle of the observer. θo ∈ (0, π)
31- ro = 20.0
32- sze = 40 ; # resolution of the screen is sze x sze
31+ sze = 400 ; # resolution of the screen is sze x sze
3332rmin = Krang. horizon (metric); # minimum radius to be ray traced
34- rmax = 6.0 ; # maximum radius to be ray traced
35- ρmax = 10 / ro; # horizontal and vertical limits of the screen
36-
33+ rmax = 10.0 ; # maximum radius to be ray traced
34+ ρmax = 15.0 ; # horizontal and vertical limits of the screen
3735
3836# Initialize Camera and pre-allocate memory for data to be plotted
3937coordinates = (zeros (sze, sze) for _ = 1 : 3 )
40- camera = Krang. SlowLightIntensityCamera (metric, θo, ro, - ρmax, ρmax, - ρmax, ρmax, sze);
41- camera2 = Krang. SlowLightIntensityCamera (metric, θo, - 10 , 10 , - 10 , 10 , sze);
38+ camera = Krang. SlowLightIntensityCamera (metric, θo, - ρmax, ρmax, - ρmax, ρmax, sze);
4239colormaps = (:afmhot , :afmhot , :hsv )
4340colorrange = ((- 20 , 20 ), (0 , rmax), (0 , 2 π))
4441
45-
46- [i. screen_coordinate[1 ] for i in camera2. screen. pixels] .≈ [i. screen_coordinate[1 ] .* ro for i in camera. screen. pixels]
47-
48- maximum ([abs .(camera2. screen. pixels[i]. η - camera. screen. pixels[i]. η) for i in range (1 , length (camera. screen. pixels))])
49- maximum ([abs .(camera2. screen. pixels[i]. λ - camera. screen. pixels[i]. λ) for i in range (1 , length (camera. screen. pixels))])
50-
51-
5242# # Defining a function to get the coordinates of the geometry
5343# Let's define a function that will return the coordinates of a ray when it intersects with a cone of opening angle $\theta_s$.
5444# Coordinate information can be accessed using the `emission_coordinates(pixel, θs, isindir, n)` function, which returns the
@@ -87,12 +77,11 @@ function draw!(axes_list, camera, coordinates, rmin, rmax, θs)
8777 for (i, geometry) in enumerate (geometries)
8878 rendered_scene = coordinate_point .(camera. screen. pixels, Ref (geometry))
8979 for I in CartesianIndices (rendered_scene)
90- temp = rendered_scene[I][1 ]
91- times[I] = temp
80+ times[I] = rendered_scene[I][1 ]
9281 radii[I] = rendered_scene[I][2 ]
93- azimuths[I] = mod2pi ( rendered_scene[I][4 ]) # azimuths are in radians
82+ azimuths[I] = rendered_scene[I][4 ]
9483 end
95- coordinates = (times, radii, azimuths)
84+ coordinates = (times, radii, mod2pi .( azimuths) )
9685 for j = 1 : 3
9786 heatmap! (
9887 axes_list[i][j],
@@ -104,33 +93,6 @@ function draw!(axes_list, camera, coordinates, rmin, rmax, θs)
10493 end
10594end
10695
107- function draw2! (axes_list, camera, coordinates, rmin, rmax, θs)
108- times, radii, azimuths = coordinates
109- map (axes -> empty! .(axes), axes_list)
110-
111- geometries = (Krang. ConeGeometry (θs, (i, rmin, rmax)) for i = 0 : 2 )
112-
113- for (i, geometry) in enumerate (geometries)
114- rendered_scene = coordinate_point .(camera. screen. pixels, Ref (geometry))
115- for I in CartesianIndices (rendered_scene)
116- temp = rendered_scene[I][1 ]
117- times[I] = temp == 0 ? 0 : temp - 2 log (ro) - ro
118- radii[I] = rendered_scene[I][2 ]
119- azimuths[I] = mod2pi (rendered_scene[I][4 ]) # azimuths are in radians
120- end
121- coordinates = (times, radii, azimuths)
122- for j = 1 : 3
123- heatmap! (
124- axes_list[i][j],
125- coordinates[j],
126- colormap = colormaps[j],
127- colorrange = colorrange[j],
128- )
129- end
130- end
131- end
132-
133-
13496# Create Figure
13597fig = Figure (resolution = (700 , 700 ));
13698axes_list = [
@@ -147,38 +109,15 @@ axes_list = [
147109 ] for i = 1 : 3
148110]
149111
150- draw2! (axes_list, camera, coordinates, rmin, rmax, π/ 2 )
151- display (fig)
152-
153- fig = Figure (resolution = (700 , 700 ));
154- axes_list = [
155- [
156- Axis (
157- fig[i, 1 ],
158- title = (i == 1 ? " Regularized Time" : " " ),
159- titlesize = 20 ,
160- ylabel = (i == 1 ? L " n=0" : i == 2 ? L " n=1" : L " n=2" ),
161- ylabelsize = 20 ,
162- ),
163- Axis (fig[i, 2 ], title = (i == 1 ? " Radius" : " " ), titlesize = 20 ),
164- Axis (fig[i, 3 ], title = (i == 1 ? " Azimuth" : " " ), titlesize = 20 ),
165- ] for i = 1 : 3
166- ]
167-
168- draw! (axes_list, camera2, coordinates, rmin, rmax, π/ 2 )
169- display (fig)
170-
171-
172-
173112# Create the animation of Cone of Emission Coordinates
174- # recording = CairoMakie.record(
175- # fig,
176- # "coordinate.gif",
177- # range(0.0, π, length = 180),
178- # framerate = 12,
179- # ) do θs
180- # draw!(axes_list, camera, coordinates, rmin, rmax, θs)
181- # end
113+ recording = CairoMakie. record (
114+ fig,
115+ " coordinate.gif" ,
116+ range (0.0 , π, length = 180 ),
117+ framerate = 12 ,
118+ ) do θs
119+ draw! (axes_list, camera, coordinates, rmin, rmax, θs)
120+ end
182121
183122# 
184123
0 commit comments