Digital Twin Animated#

An animated gif of the real and simulated images taken by POGS

Loading star catalog: 8.56e-01 seconds
0
Applying 2.91e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.52
BEFORE QUEST: median error 121.68 pixels
Performing the QUEST fit with 38 stars
Applying a 3.66e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.78 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 1.11e+00 seconds
0
Applying 2.91e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.52
BEFORE QUEST: median error 121.68 pixels
Performing the QUEST fit with 38 stars
Applying a 3.66e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.78 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.70e-01 seconds
0
Applying 2.91e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.52
BEFORE QUEST: median error 121.68 pixels
Performing the QUEST fit with 38 stars
Applying a 3.66e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.78 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 9.12e-01 seconds
0
Applying 2.91e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.52
BEFORE QUEST: median error 121.68 pixels
Performing the QUEST fit with 38 stars
Applying a 3.66e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.78 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.92e-01 seconds
1
Applying 2.90e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.58
BEFORE QUEST: median error 121.32 pixels
Performing the QUEST fit with 35 stars
Applying a 3.48e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 1.85 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 9.53e-01 seconds
2
Applying 2.89e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.49
BEFORE QUEST: median error 120.83 pixels
Performing the QUEST fit with 30 stars
Applying a 3.82e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 1.77 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.53e-01 seconds
3
Applying 2.89e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.52
BEFORE QUEST: median error 119.87 pixels
Performing the QUEST fit with 31 stars
Applying a 3.59e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.17 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 9.37e-01 seconds
4
Applying 2.88e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.51
BEFORE QUEST: median error 120.83 pixels
Performing the QUEST fit with 35 stars
Applying a 3.93e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.10 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.32e-01 seconds
5
Applying 2.87e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.46
BEFORE QUEST: median error 119.96 pixels
Performing the QUEST fit with 32 stars
Applying a 4.22e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 1.91 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.74e-01 seconds
6
Applying 2.87e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.50
BEFORE QUEST: median error 121.29 pixels
Performing the QUEST fit with 40 stars
Applying a 3.89e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 1.98 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.32e-01 seconds
7
Applying 2.86e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.44
BEFORE QUEST: median error 120.59 pixels
Performing the QUEST fit with 28 stars
Applying a 3.76e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 1.49 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.42e-01 seconds
8
Applying 2.85e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.48
BEFORE QUEST: median error 119.44 pixels
Performing the QUEST fit with 39 stars
Applying a 3.64e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.16 pixels
Objects in frame 1:
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 8.88e-01 seconds
9
Applying 2.85e-02 deg of refraction
fits_info["integration_time"]=4.0
sim counts are too high by a factor of 1.46
BEFORE QUEST: median error 119.84 pixels
Performing the QUEST fit with 46 stars
Applying a 3.76e-02 degree rotation to the telescope orientation
AFTER QUEST: median error 2.21 pixels
Objects in frame 1:
RESURS O1
NAVSTAR 80 (USA 309)
Synthesizing CCD Image: 6.41e-01 seconds

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FuncAnimation

import mirage as mr

# info_path = "/Users/liamrobinson/Library/CloudStorage/OneDrive-purdue.edu/2022-09-18_GPS_PRN14/ObservationData.mat"
# info_path = '/Users/liamrobinson/Library/CloudStorage/OneDrive-purdue.edu/2023-05-29 Telstar 19V/ObservationData.mat'
info_path = '/Users/liamrobinson/Library/CloudStorage/OneDrive-purdue.edu/pogs/2022-09-18/ObservationData.mat'
add_distortion = True
add_refraction = True
station = mr.Station()
station.telescope.fwhm = 3.0
mr.tic('Loading star catalog')
catalog = mr.GaiaStarCatalog(station, mr.now() - mr.years(2))
mr.toc()

fig = plt.figure()
plt.subplot(1, 2, 1)
im_obs = plt.imshow(np.eye(4096), cmap='gray')
plt.gca().get_xaxis().set_visible(False)
plt.gca().get_yaxis().set_visible(False)
plt.title('Observed')
plt.subplot(1, 2, 2)
im_synth = plt.imshow(np.eye(4096), cmap='gray')
plt.title('Synthetic')
plt.gca().get_xaxis().set_visible(False)
plt.gca().get_yaxis().set_visible(False)
plt.tight_layout()


def animate(i):
    print(i)
    res = mr.generate_matched_image(
        info_path,
        i,
        station,
        catalog,
        add_distortion,
        add_refraction,
        bias_variance=150,
    )
    img_synth = np.log10(np.clip(res['img_sym'], 1, np.inf))

    img = np.log10(np.clip(res['img'] - int(1e3), 1, np.inf))
    plt.subplot(1, 2, 1)
    im_obs.set_data(img)
    plt.clim(img.min(), img.max())
    plt.subplot(1, 2, 2)
    im_synth.set_data(img_synth)
    plt.clim(img.min(), img.max())
    return im_obs, im_synth


frames = 10
fps = 8
anim = FuncAnimation(fig, animate, frames=frames, interval=1000 / fps, blit=True)
anim.save('synth_imgs.gif')

Total running time of the script: (1 minutes 10.843 seconds)

Gallery generated by Sphinx-Gallery