Skip to content

Commit

Permalink
Fixed exaggerated jitter - was treating x and y independently but jit…
Browse files Browse the repository at this point in the history
…ter input is magnitude rms at random angle
  • Loading branch information
jmason86 committed Jan 18, 2024
1 parent f86fed2 commit 117d767
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion suncet_instrument_simulator/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,10 @@ def apply_jitter(self, onboard_processed_images): # Note really onboard software
blur_pixels = blur_amount / scale

# Generate random jitter offsets for shift
dx, dy = np.random.normal(0, jitter_pixels.value, 2)
angle = np.random.uniform(0, 2*np.pi)
jitter_magnitude = np.random.normal(0, jitter_pixels.value)
dx = jitter_magnitude * np.cos(angle)
dy = jitter_magnitude * np.sin(angle)

# Shift the image data to simulate the instantaneous start/stop boundary between timesteps (cadence steps)
shifted_data = shift(image.data, shift=[dy, dx], mode='nearest')
Expand Down

0 comments on commit 117d767

Please sign in to comment.