CAstCitizen Astronomy All tutorials

Galaxy Merger

Citizen Astronomy for Windows with OpenGL 3.3 support. The Galaxy merger scene is included with the app.

Set up an encounter Step 02

Choose a starting scene

Start here Open Galaxy Merger. Save any recording you want to keep before changing scenes.

  1. Click Simulation (1). For this example, leave Galaxy merger selected. For another encounter, choose Retrograde merger, where one disk spins against the orbital motion, or Seeded merger, an alternative spiral model.
  2. If you have a scene file instead, click Load scene (2), select the .scene file and click Open. A scene supplies the starting conditions for a new run.
The Simulation selector and Load scene button marked separately in the file controls. Enlarge screenshot
What you should see

The selected scene name appears next to Simulation. The Run button is available.

Set up an encounter Step 03

Set up a short first run

Start here Select the built-in Galaxy merger scene. Scroll to Parameters. Click the section heading if it is folded.

  1. Under Resolution, click Minimal (1). This reduces the number of particles CAst tracks.
  2. Click the number beside Steps (2), press Ctrl+A, type 400 and press Enter.
  3. Set Sample every (3) to 20 the same way. Leave dt at 0.005. CAst will save a snapshot once every 20 calculation steps.
Parameters panel with Minimal resolution, Steps at 400 and Sample every at 20 marked in order. Enlarge screenshot
What you should see

The panel shows Minimal, 400 steps and a sampling interval of 20. This run covers 2 simulation time units, enough to practice playback while the galaxies are still separate.

Set up an encounter Step 04

Give one galaxy four spiral arms

Start here Select the built-in Galaxy merger scene. To compare with an earlier run, save that recording first.

  1. Expand Parameters, then click the left heading (1), below Softening. This opens the starting conditions for the galaxy named left.
  2. Scroll to Initial arms (2), click its menu and choose Four. Leave the right galaxy unchanged so you can compare them. Scroll back up to Run when ready.
The left galaxy section is expanded, and the Initial arms selector reads Four. Both controls are outlined. Enlarge screenshot
What you should see

The Initial arms field reads Four. The next run starts the left galaxy with that spiral pattern. Gravity can change its shape as the galaxies interact.

Set up an encounter Step 05

Run the simulation

Start here An editable scene is loaded. For a quick first attempt, use the 400-step settings.

  1. Scroll to the top of the left panel. Click Run once.
  2. Wait until the progress bar disappears and the playback controls are available. For a long run, use the Stop branch to keep a partial result.
The Run button directly below the resolution status is outlined. Enlarge screenshot
What you should see

During calculation, Stop replaces Run. Afterward, Playback shows a time readout and the view displays the galaxies.

Set up an encounter Step 06

Keep part of an unfinished run

Start here An encounter is currently calculating. Look for the progress bar near the top of the panel.

  1. Click Stop. Wait for the status to say Stopped at step before using the recording.
The Stop button below an active simulation progress bar is highlighted. Enlarge screenshot
What you should see

The status gives the step reached. Continue appears beside Run. You can inspect or save the snapshots calculated so far.

Explore the recording Step 08

Play, scrub and move the camera

Start here Finish or stop a run, or load a recording. Scroll to Playback and expand the heading if needed.

  1. Click Play (1) to move forward. Click the same button when it says Pause to hold a moment.
  2. While paused, drag Time (2) left or right. The number above the slider is the simulated time at the selected snapshot.
  3. Drag Speed (3) to the right for faster playback. To look around, left-drag in the galaxy view to orbit, right-drag to pan, and scroll to zoom. Click Frame beside Play to bring the encounter back into view.
Real galaxy recording with Play, Time and Speed outlined next to the two galaxies. Enlarge screenshot
What you should see

Dragging Time changes the positions shown on screen. In the 400-step example the time runs from 0 to 2. A longer encounter gives you more of the orbit to explore.

Explore the recording Step 09

Jump to the closest approach

Start here Use a longer recording to see a close encounter. To reproduce this example, select Galaxy merger, choose Minimal, set dt to 0.005, Steps to 16000 and Sample every to 80, then run to completion.

  1. Pause playback. Open Appearance and set Picture to Optical.
  2. Click First passage (1). CAst frames the galaxies at their first close approach in the recording.
  3. Click After passage (2) to advance to a later view. Use the two buttons above this tutorial screenshot to compare those actual frames.
Optical view at first passage with First passage and After passage outlined. First passage · Enlarge screenshot The same encounter at a later time selected by After passage, with both camera buttons outlined. After passage · Enlarge screenshot
What you should see

In this run First passage selects simulation time 40.8, with the two bright centers close together. At 55.2, the later frame shows two more widely separated centers within elongated clouds of light. A shorter recording may end before the galaxies pass.

Explore the recording Step 10

Turn a galaxy face-on or edge-on

Start here Pause a recording. Scroll the left panel to Appearance and expand the heading.

  1. Click the Picture selector (1) and choose Optical to reconstruct light from the recorded particles.
  2. Click Face-on disk (2) to look down on the first disk.
  3. Click Edge-on disk (3) to look along its plane. Click Frame current light above the two buttons to frame the emitting material again.
The optical picture of two galaxies with the Picture selector and Face-on disk and Edge-on disk buttons marked. Enlarge screenshot
What you should see

The camera turns around the first galaxy, making the disk appear broader or thinner. Its playback time stays the same.

Explore the recording Step 11

Adjust starlight and dust

Start here Choose the Optical picture, pause on a frame and scroll down through Appearance.

  1. Drag Exposure (1) a short distance to the right. Watch the faint outer light as you move it.
  2. Drag Dust (2) to change how strongly foreground dust absorbs starlight. Compare the same region while keeping the camera still.
Face-on optical reconstruction with the Exposure and Dust sliders outlined. Enlarge screenshot
What you should see

The brightness and dust contrast change on the same frame. These are illustrative brightness settings for the rendering.

Explore the recording Step 12

Save or reuse an optical look

Start here Choose Optical and scroll down through Appearance to the controls below Stellar texture.

  1. To keep the current settings, click Save look (1). Choose a folder, type a name such as My galaxy.look, and click Save.
  2. To apply an existing look, click Load look (2). Select a .look file and click Open. The bundled broadband and nebular looks are examples.
The neighboring Save look and Load look buttons are each outlined. Enlarge screenshot
What you should see

Loading a look applies its optical settings to the current scene. To keep the particle motions as well, save the recording separately.

Explore the recording Step 13

Read the galaxies as a density field

Start here Pause a recording at a time you want to inspect and expand Appearance.

  1. Click Picture (1) and choose Illustrative volume. Nearby particles now contribute to a continuous map of where material is concentrated.
  2. Click Resolution (2) and choose Standard to start. This control changes the density map’s detail.
  3. Drag Field brightness (3) to see fainter material. Zoom out with the mouse wheel if the map fills the frame.
Illustrative volume rendered from the simulation with Picture, Resolution and Field brightness marked. Enlarge screenshot
What you should see

A colored volume replaces the starlight picture. The palette illustrates the distribution of material at the selected time.

Explore the recording Step 14

Inspect individual particles

Start here Pause a recording and expand Appearance.

  1. Click Picture (1) and choose Particles.
  2. Drag Point scale (2) left to shrink the points or right to make them larger. Zoom with the mouse wheel to inspect one disk.
Particles from a real run with Picture set to Particles and the Point scale slider outlined. Enlarge screenshot
What you should see

The smooth picture resolves into colored points. Each point represents a simulation particle. Its displayed size changes while its recorded position stays fixed.

Explore the recording Step 15

Place stars behind the encounter

Start here A recording is visible. Scroll down to Background and click its heading.

  1. Check Stars (1) to draw a star field behind the galaxies.
  2. Clear Real catalog stars (2) to use generated stars, as shown here. To use Hipparcos positions instead, check it and click Download star catalog if prompted.
  3. Move Star brightness (3) until the points are visible. Clear Stars again to remove them.
The Background section with Stars on, Real catalog stars off and the Star brightness slider marked. Enlarge screenshot
What you should see

Stars appear behind the galaxies. They are a backdrop, independent of the particles in the encounter. Saved images and video include any enabled background.

Save or share Step 16

Save the simulation for later

Start here You have a finished or stopped calculation. Scroll to the top of the left panel.

  1. Click Save recording. Choose a folder and enter a name such as First encounter.traj. Click Save.
Save recording is highlighted in the three-button file row. Enlarge screenshot
What you should see

The .traj file stores your calculated snapshots for playback. To continue calculating a stopped run, keep the current session open and use Continue.

Save or share Step 17

Reopen an existing recording

Start here Open Galaxy Merger and locate the .traj file you want to view. Save any current recording you want to keep.

  1. Click Load recording at the top of the left panel. Select your .traj file and click Open.
Load recording in the top-left file row is marked. Enlarge screenshot
What you should see

Playback becomes available with the recorded time range. To change physical parameters and calculate a different encounter, select a new scene.

Save or share Step 18

Save the current frame as a PNG

Start here Pause the recording on the view you want to keep. Scroll to Export and click the section heading. Set Format to PNG sequence so Browse selects a folder.

  1. Choose a Preset (1), such as 1920 x 1080, for the saved picture size.
  2. Click Browse (2) and choose an output folder. Choose a fresh folder if you want to keep a previous frame.png.
  3. Click Save frame (3).
Export controls with the size Preset, Browse and Save frame outlined in that order. Enlarge screenshot
What you should see

The status says Wrote followed by a path. Open frame.png there to see the camera view without the control panel.

Save or share Step 19

Export a playable MP4 movie

Start here Use a finished or loaded recording and your chosen camera angle. Expand Export.

  1. Set Format (1) to MP4 (ffmpeg). Choose a size under Preset and keep FPS at 30 for this example.
  2. Click Browse (2). Pick a folder, type Galaxy preview.mp4 and click Save.
  3. Enter a starting time in From (3) and an ending time in To (4). For the short preview, use 0 and 2. These are times on the simulation’s playback slider.
  4. Click Export (5). Wait for the export status to report completion, then open the MP4 in a video player.
Movie settings with MP4 Format, Browse, From, To and Export outlined. Enlarge screenshot
What you should see

The frame count and target filename appear below the time range. At 30 frames per simulation time unit, a range from 0 to 2 produces 60 frames.

Save or share Step 20

Export a numbered PNG sequence

Start here A recording is available. Expand Export. Choose your image size under Preset.

  1. Set Format (1) to PNG sequence.
  2. Click Browse (2) and select a folder for the images. Set From and To to the part of the recording you want to keep.
  3. Click Export (3). If you stop a sequence early, leave its settings in place and click Continue in the Export section to finish it.
Export panel highlighting PNG sequence format, the output folder chooser, and Export. Enlarge screenshot
What you should see

The selected folder fills with numbered PNG images, one per exported frame. Each uses the chosen camera and appearance.

Screenshot