<p>The first formula from the article <em>Vítek, S. Modeling of Astronomical Images</em> gives an idea of ​​how the distortion of astronomical images is modeled. This is a sequential chain of transformations (matrix product or convolution), each stage introduces its own distortion. We can then construct a correlated random field using filtering of the uncorrelated random field (Fourier or Gaussian filter). Here is the code in Matlab and results. <a href="https://ieeexplore.ieee.org/document/8126645" rel="nofollow noreferrer">https://ieeexplore.ieee.org/document/8126645</a> <a href="https://ieeexplore.ieee.org/document/9252580" rel="nofollow noreferrer">https://ieeexplore.ieee.org/document/9252580</a></p>
<p>Of course, distortion is not implemented entirely correctly. This is simply a sequential multiplication of different masks by the original image. In addition, as can be seen from the results, one or another defect (fuzzy blob or speckle) depends on the size of the correlation lengths in the statistics of atmospheric turbulence. And it’s not a fact that these statistics are Gaussian. I don't know. Perhaps the statistics are different, and the general approach is to use special correlation functions. <strong>If someone decides to mention other formulas and algorithms, you are welcome!</strong> <strong>Write your answers and comments.</strong></p>
<pre><code>N = 500; %number of surface points
rL = 10; %length of surface
h = 1; %rms height
cl = 0.5; %correlation length

x = linspace(-rL/2,rL/2,N); %surface points on x-axis
y = linspace(-rL/2,rL/2,N); %surface points on y-axis
[X,Y] = meshgrid(x,y); %XY meshgrid

Z = h.*randn(N,N); % uncorrelated Gaussian random rough surface distribution with mean 0 and standard deviation h        
% Gaussian filter
F = exp(-(X.^2+Y.^2)/(cl^2/2));

% correlation of surface using convolution (faltung), inverse Fourier transform and normalizing prefactors
f = sqrt(2/sqrt(pi))*sqrt(rL/N/cl)*ifft2(fft2(Z).*fft2(F)); %surface heights
f = f./max(max(f)); %Additional Field Normalization
norm_data_f = (f - min(min(f))) / ( max(max(f)) - min(min(f)) );%Additional Field Normalization

%Wavefront model. Simple monochromatic wave
A = 1; %Amplitude
a = 1; %initial radius
W = A*exp(-(X.^2+Y.^2)/(2*a));
Intensity = abs(W).^2;

%Resulting wavefront
ResW = Intensity.*norm_data_f;

%Aperture mask. A circular surface is selected as the aperture.
R = 1; %Apperture radius
apx = linspace(-rL/2,rL/2,N); %aperture points on x-axis
apy = linspace(-rL/2,rL/2,N); %aperture points on y-axis
[apX,apY] = meshgrid(apx,apy); %aperture XY meshgrid
ApertureMask = zeros(N,N);

for i = 1:N
for j = 1:N
if sqrt(apX(i,j).^2+apY(i,j).^2)&gt;R
ApertureMask(i,j) = NaN;
else
ApertureMask(i,j) = 1;
end
end
end

subplot(2,2,1)
surf(X,Y,norm_data_f,'edgecolor','none')
view ([0 0 90])
colorbar
title('Atmosphere with distortion')
xlabel('X') 
ylabel('Y') 
axis square

subplot(2,2,2)
surf(X,Y,Intensity,'edgecolor','none')
view ([0 0 90])
colorbar
title('Intensity')
xlabel('X') 
ylabel('Y') 
axis square

subplot(2,2,3)
surf(apX,apY,ApertureMask,'edgecolor','none')
view ([0 0 90])
colorbar
title('Aperture Mask')
xlabel('X') 
ylabel('Y') 
axis square

subplot(2,2,4)
surf(X,Y,ResW.*ApertureMask,'edgecolor','none')
view ([0 0 90])
colorbar
title('Resulting wavefront with taking into account the aperture mask')
xlabel('X') 
ylabel('Y') 
axis square
</code></pre>
<p><a href="https://i.sstatic.net/ZL7D81pm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZL7D81pm.png" alt="enter image description here" /></a></p>
<p><a href="https://i.sstatic.net/jxhA1ZFd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jxhA1ZFd.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2024-06-19T07:11:09.620Z
2024-06-19T07:16:50.113Z
2024-06-19T07:16:50.113Z
ayr
<p>Associated with: <a href="https://astronomy.stackexchange.com/questions/57930/mathematical-modeling-of-the-influence-of-components-of-the-interstellar-medium">Mathematical modeling of the influence of components of the interstellar medium on the distortion of the wavefront of the observed object</a></p>
<p>Being inspired by <a href="https://en.wikipedia.org/wiki/Astronomical_seeing#/Mathematical%20description%20of%20r0%20and%20t0" rel="nofollow noreferrer">this article</a>, as well as some promising, but unfortunately not supported by references, results of “simulation” of various distorting defects (<em>fuzzy blob, slow-motion, blurred, speckle, multi-speckle, scintillation</em>) of the wavefronts of astronomical objects, I immediately threw myself into the beautiful ocean of searching for the information I needed. Unfortunately, apparently I confused the beautiful ocean with a dark abyss, which turned out to be too deep and uninhabited where I was looking. I am returning from my first search voyage for information almost empty-handed:</p>
<ol>
<li><a href="https://iopscience.iop.org/article/10.1088/0150-536X/18/5-6/003" rel="nofollow noreferrer">Simulation of the effect of atmospheric turbulence on the wavefronts</a></li>
<li><a href="https://academic.oup.com/mnras/article/434/1/742/1005440" rel="nofollow noreferrer">Numerical simulations of a new approach for seeing measurement</a></li>
<li><a href="https://www.sciencedirect.com/science/article/abs/pii/S0030402620300115" rel="nofollow noreferrer">Simulation of anisoplanatic imaging containing optical system parameters through atmospheric turbulence</a></li>
<li><a href="https://adsabs.harvard.edu/full/2009BaltA..18..387V" rel="nofollow noreferrer">Modeling of Astronomical Images</a></li>
<li><a href="https://iopscience.iop.org/article/10.1086/656016/pdf" rel="nofollow noreferrer">Astronomical Image Simulation for Telescope and Survey Development</a> - <em>Here I ask everyone to pay special attention to Fig. 3 on page 4!</em></li>
</ol>
<p>What little I was able to find does not completely satisfy me, but contains some clues that I decided to show to experienced specialists in the hope that they will help structure the information found and tell me where else to get building materials for the future building (by building materials I mean , which you could try with your own hands in MATLAB).</p>
<hr />
<p><strong>My question:</strong> Turbulent processes in the Earth's atmosphere turbulently distort the amplitude and phase of the incoming wave front, as a result of which we get different patterns of distorting defects. But how does one or another mathematical model include the ability to simulate various distorting effects? In my mind, this may resemble a kind of construction set, from the details of which an astronomer can assemble his own numerical experimental platform, for example, “Object: star. Effect: twinkling. Diffraction: Fraunhofer” or “Object: star cluster. Effect: speckle. Diffraction: Fresnel” . Something like this... <em>Algorithms and formulas are welcome!</em></p>
<hr />
<p><strong>Examples from Wiki:</strong></p>
<p><a href="https://i.sstatic.net/CURfGMPr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CURfGMPr.png" alt="enter image description here" /></a></p>
<p><em>&quot;<strong>Simulated</strong> negative image showing what a single (point-like) star would look like through a ground-based telescope with a diameter of 2r0. The blurred look of the image is because of diffraction, which causes the appearance of the star to be an Airy pattern with a central disk surrounded by hints of faint rings. The atmosphere would make the image move around very rapidly, so that in a long-exposure photograph it would appear more blurred.&quot;</em></p>
<p><a href="https://i.sstatic.net/O2k2TO18.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/O2k2TO18.png" alt="enter image description here" /></a></p>
<p><em>&quot;<strong>Simulated</strong> negative image showing what a single (point-like) star would look like through a ground-based telescope with a diameter of 7r0, on the same angular scale as the 2r0 image above. The atmosphere makes the image break up into several blobs (speckles). The speckles move around very rapidly, so that in a long-exposure photograph the star would appear as a single blurred blob.&quot;</em></p>
<p><a href="https://i.sstatic.net/o0nhSYA4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/o0nhSYA4.png" alt="enter image description here" /></a></p>
<p><em>&quot;<strong>Simulated</strong> negative image showing what a single (point-like) star would look like through a ground-based telescope with a diameter of 20r0. The atmosphere causes further atomization of the image into many blobs (speckles). As above, the speckles move around very rapidly, so that in a long-exposure photograph the star would appear as a single blurred blob.&quot;</em></p>

<observational-astronomy><astrophysics><modeling><algorithm>
Flowchart of the pipeline of key processes for modeling wavefront distortion of astronomical objects: ground-based observation case
ayr
# Flowchart of the pipeline of key processes for modeling wavefront distortion of astronomical objects: ground-based observation case

(Asked by: username_0 on 2024-06-18)

Associated with: [Mathematical modeling of the influence of components of the interstellar medium on the distortion of the wavefront of the observed object](https://astronomy.stackexchange.com/questions/57930/mathematical-modeling-of-the-influence-of-components-of-the-interstellar-medium)

Being inspired by [this article](https://en.wikipedia.org/wiki/Astronomical_seeing#/Mathematical%20description%20of%20r0%20and%20t0), as well as some promising, but unfortunately not supported by references, results of “simulation” of various distorting defects (*fuzzy blob, slow-motion, blurred, speckle, multi-speckle, scintillation*) of the wavefronts of astronomical objects, I immediately threw myself into the beautiful ocean of searching for the information I needed. Unfortunately, apparently I confused the beautiful ocean with a dark abyss, which turned out to be too deep and uninhabited where I was looking. I am returning from my first search voyage for information almost empty-handed:

1. [Simulation of the effect of atmospheric turbulence on the wavefronts](https://iopscience.iop.org/article/10.1088/0150-536X/18/5-6/003)
2. [Numerical simulations of a new approach for seeing measurement](https://academic.oup.com/mnras/article/434/1/742/1005440)
3. [Simulation of anisoplanatic imaging containing optical system parameters through atmospheric turbulence](https://www.sciencedirect.com/science/article/abs/pii/S0030402620300115)
4. [Modeling of Astronomical Images](https://adsabs.harvard.edu/full/2009BaltA..18..387V)
5. [Astronomical Image Simulation for Telescope and Survey Development](https://iopscience.iop.org/article/10.1086/656016/pdf) - *Here I ask everyone to pay special attention to Fig. 3 on page 4!*

What little I was able to find does not completely satisfy me, but contains some clues that I decided to show to experienced specialists in the hope that they will help structure the information found and tell me where else to get building materials for the future building (by building materials I mean , which you could try with your own hands in MATLAB).

---

**My question:** Turbulent processes in the Earth's atmosphere turbulently distort the amplitude and phase of the incoming wave front, as a result of which we get different patterns of distorting defects. But how does one or another mathematical model include the ability to simulate various distorting effects? In my mind, this may resemble a kind of construction set, from the details of which an astronomer can assemble his own numerical experimental platform, for example, “Object: star. Effect: twinkling. Diffraction: Fraunhofer” or “Object: star cluster. Effect: speckle. Diffraction: Fresnel” . Something like this... *Algorithms and formulas are welcome!*

---

**Examples from Wiki:**

[![enter image description here](https://i.sstatic.net/CURfGMPr.png)](https://i.sstatic.net/CURfGMPr.png)

*"**Simulated** negative image showing what a single (point-like) star would look like through a ground-based telescope with a diameter of 2r0. The blurred look of the image is because of diffraction, which causes the appearance of the star to be an Airy pattern with a central disk surrounded by hints of faint rings. The atmosphere would make the image move around very rapidly, so that in a long-exposure photograph it would appear more blurred."*

[![enter image description here](https://i.sstatic.net/O2k2TO18.png)](https://i.sstatic.net/O2k2TO18.png)

*"**Simulated** negative image showing what a single (point-like) star would look like through a ground-based telescope with a diameter of 7r0, on the same angular scale as the 2r0 image above. The atmosphere makes the image break up into several blobs (speckles). The speckles move around very rapidly, so that in a long-exposure photograph the star would appear as a single blurred blob."*

[![enter image description here](https://i.sstatic.net/o0nhSYA4.png)](https://i.sstatic.net/o0nhSYA4.png)

*"**Simulated** negative image showing what a single (point-like) star would look like through a ground-based telescope with a diameter of 20r0. The atmosphere causes further atomization of the image into many blobs (speckles). As above, the speckles move around very rapidly, so that in a long-exposure photograph the star would appear as a single blurred blob."*

**Tags:** observational-astronomy, astrophysics, modeling, algorithm


---

## 1 answers

### Answer by username_0 on 2024-06-19. Score: 1 | Accepted answer

The first formula from the article *Vítek, S. Modeling of Astronomical Images* gives an idea of ​​how the distortion of astronomical images is modeled. This is a sequential chain of transformations (matrix product or convolution), each stage introduces its own distortion. We can then construct a correlated random field using filtering of the uncorrelated random field (Fourier or Gaussian filter). Here is the code in Matlab and results. <https://ieeexplore.ieee.org/document/8126645> <https://ieeexplore.ieee.org/document/9252580>

Of course, distortion is not implemented entirely correctly. This is simply a sequential multiplication of different masks by the original image. In addition, as can be seen from the results, one or another defect (fuzzy blob or speckle) depends on the size of the correlation lengths in the statistics of atmospheric turbulence. And it’s not a fact that these statistics are Gaussian. I don't know. Perhaps the statistics are different, and the general approach is to use special correlation functions. **If someone decides to mention other formulas and algorithms, you are welcome!** **Write your answers and comments.**

```
N = 500; %number of surface points
rL = 10; %length of surface
h = 1; %rms height
cl = 0.5; %correlation length

x = linspace(-rL/2,rL/2,N); %surface points on x-axis
y = linspace(-rL/2,rL/2,N); %surface points on y-axis
[X,Y] = meshgrid(x,y); %XY meshgrid

Z = h.*randn(N,N); % uncorrelated Gaussian random rough surface distribution with mean 0 and standard deviation h        
% Gaussian filter
F = exp(-(X.^2+Y.^2)/(cl^2/2));

% correlation of surface using convolution (faltung), inverse Fourier transform and normalizing prefactors
f = sqrt(2/sqrt(pi))*sqrt(rL/N/cl)*ifft2(fft2(Z).*fft2(F)); %surface heights
f = f./max(max(f)); %Additional Field Normalization
norm_data_f = (f - min(min(f))) / ( max(max(f)) - min(min(f)) );%Additional Field Normalization

%Wavefront model. Simple monochromatic wave
A = 1; %Amplitude
a = 1; %initial radius
W = A*exp(-(X.^2+Y.^2)/(2*a));
Intensity = abs(W).^2;

%Resulting wavefront
ResW = Intensity.*norm_data_f;

%Aperture mask. A circular surface is selected as the aperture.
R = 1; %Apperture radius
apx = linspace(-rL/2,rL/2,N); %aperture points on x-axis
apy = linspace(-rL/2,rL/2,N); %aperture points on y-axis
[apX,apY] = meshgrid(apx,apy); %aperture XY meshgrid
ApertureMask = zeros(N,N);

for i = 1:N
for j = 1:N
if sqrt(apX(i,j).^2+apY(i,j).^2)>R
ApertureMask(i,j) = NaN;
else
ApertureMask(i,j) = 1;
end
end
end

subplot(2,2,1)
surf(X,Y,norm_data_f,'edgecolor','none')
view ([0 0 90])
colorbar
title('Atmosphere with distortion')
xlabel('X') 
ylabel('Y') 
axis square

subplot(2,2,2)
surf(X,Y,Intensity,'edgecolor','none')
view ([0 0 90])
colorbar
title('Intensity')
xlabel('X') 
ylabel('Y') 
axis square

subplot(2,2,3)
surf(apX,apY,ApertureMask,'edgecolor','none')
view ([0 0 90])
colorbar
title('Aperture Mask')
xlabel('X') 
ylabel('Y') 
axis square

subplot(2,2,4)
surf(X,Y,ResW.*ApertureMask,'edgecolor','none')
view ([0 0 90])
colorbar
title('Resulting wavefront with taking into account the aperture mask')
xlabel('X') 
ylabel('Y') 
axis square

```

[![enter image description here](https://i.sstatic.net/ZL7D81pm.png)](https://i.sstatic.net/ZL7D81pm.png)

[![enter image description here](https://i.sstatic.net/jxhA1ZFd.png)](https://i.sstatic.net/jxhA1ZFd.png)


---

