SHARE
TWEET

Kinematic Redshift

Yukterez Jul 15th, 2019 (edited) 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pic=Import["http://yukterez.net/mw/gradient4.png"];                   (* Frequenzgradient *)
  2.  
  3. vr = -0.5;                                          (* radiale Geschwindigkeitskomponente *)
  4. vφ = +0.5;                                        (* azimutale Geschwindigkeitskomponente *)
  5. vθ = +0.5;                                           (* polare Geschwindigkeitskomponente *)
  6.  
  7. ς  = +1;                                                                         (* Lapse *)
  8.  
  9. width  = 120;                                                                 (* Bildhöhe *)
  10. height = 60;                                                                (* Bildbreite *)
  11.  
  12. v  = +Sqrt[vr^2+vθ^2+vφ^2];
  13. If[v>1, Print["Error: v > 1: v" -> v], Print["v" -> v]];
  14.  
  15. dΘ = +Limit[ArcCos[-vθ/Sqrt[vR^2+vθ^2+vφ^2]], vR->vr];
  16. dθ = If[vr>0, -dΘ, +dΘ];
  17. dΦ = +Limit[ArcTan[Abs[vφ]/vR], vR->vr];
  18. dφ = If[vr!=0, -1, 1] If[vφ<0, +1, -1] If[NumericQ[dΦ], dΦ, π/2];
  19. dψ = 0 If[vr<0, 0, π];
  20.  
  21. f[{φ_,θ_}] := {0, ς/(1-v Cos[θ-π/2]) Sqrt[1-v^2]};            (* winkelabhängige Frequenz *)
  22.  
  23. img = ImageTransformation[pic, f, {width, height},                     (* Frequenzbereich *)
  24. DataRange->{{-1, 1}, {0, 2}},
  25. PlotRange->{{-π, π}, {-π/2, π/2}},
  26. Padding->"Fixed"];
  27.  
  28. xyz[{x_,y_}] := {Sin[y] Cos[x],Sin[y] Sin[x],Cos[y]};                  (* Rotationsmatrix *)
  29. Xyz[{x_,y_,z_},dφ_] := {x Cos[dφ]-y Sin[dφ],x Sin[dφ]+y Cos[dφ],z};
  30. xYz[{x_,y_,z_},dθ_] := {x Cos[dθ]+z Sin[dθ],y,z Cos[dθ]-x Sin[dθ]};
  31. xyZ[{x_,y_,z_},dψ_] := {x,y Cos[dψ]-z Sin[dψ],y Sin[dψ]+z Cos[dψ]};
  32. xy[{x_,y_,z_}] := {ArcTan[x,y],ArcCos[z]};
  33.  
  34. fpt[{x_, y_}] := {If[y<0, x+1, x], If[y<0, -y, y]};                              (* Range *)
  35. pct = ImageTransformation[img, fpt, DataRange->{{-1, 1}, {0, 1}},
  36. PlotRange->{{-1, 1}, {-1, 1}}, Padding->"Periodic"];
  37.  
  38. rm[pct_,dφ_,dθ_,dψ_] := xy[xyZ[xYz[Xyz[xyz[pct], dφ], dθ], dψ]];              (* Rotation *)
  39. RM[{x_,y_}] := rm[{x,y}, dφ, dθ, dψ];
  40.  
  41. red = ImageTransformation[pct, RM,               (* Output im 360°x180° Plattkartenformat *)
  42. DataRange->{{-π, π}, {-π, π}},
  43. PlotRange->{{-π, π}, {0, π}},
  44. Padding->"Periodic"]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top