Giter Site home page Giter Site logo

galcollide's Introduction

---------------------------------------------------------------------------
Combining galaxy models to create an initial condition for a collision:
Run "python GalCollide.py" to produce initial condition of two galaxies in a Keplerian orbit.
Place galaxy models in InitialConditions directory and specify file name in Parameters.py
The output file name is specified along with orbital parameters in Parameters.py

Example Parameters.py file:
########################################
#!/usr/bin/env python

import pynbody

# Paths to tipsy files for galaxy models
Gal1 = pynbody.load('./InitialConditions/initMW')
Gal2 = pynbody.load('./InitialConditions/initMW2')

# dDelta for changa param file
dDelta = .01

# Perigalactic distance in kpc
d_perigalactic = 14.8

# Initial separation distance in kpc
initial_separation = 10**2

# Eccentricity of system
eccentricity = 0.99

# Time in Myr since first perigalacticon passage of desired output snapshot
time = 250

# Dynamical mass of the system in kg
mDyn =  1.312687200755e+42

# Output file name
writename = "TheMice.tipsy"

# Euler angles to transform each galaxy by
Omega1, w1, i1 = 0, 4.10152, 0.261799
Omega2, w2, i2 = 0, 3.49066, 0.436332

# Transform galaxies by Euler angles
transform = True
########################################

Outputs:
writename.tipsy
writename.tipsy.param
writename.tipsy.director
writename.tipsy.info

Copy outputs (writename*) to your ChaNGa working directory and run!

The final tipsy snapshot that is output is at the time since first perigalacticon passage specified in the Parameters.py file.

Once finished, you can place the ChaNGa output files into the data directory and run MakeMovie to create a .gif of the collision, which will be saved in the Animations directory.

---------------------------------------------------------------------------
Transforming to observation frame:
Move your changa outputs to the Data directory. To transform a tipsy snapshot 
(writename.tipsy) into the observation frame of reference, specify viewing angles and scaling factors in ObservationParameters.py. 

Example ObservationParameters.py file:
########################################
#!/usr/bin/env python

import pynbody

# Tipsy snapshot to transform into observation frame
snapshot = pynbody.load('./Data/TheMice.tipsy.005000')

# Length scale factor
L = 39.5

# Velocity scale factor
V = 165

# Viewing angle relative to orbital plane
w = 1.36136
i = -0.767945
Omega = -2.26893
########################################

Next, run ObservationFrame.py, which will output the final product, scaled.tipsy.

---------------------------------------------------------------------------
Making a movie using ChaNGa outputs:
Copy .ppm files to Data directory, then run MakeMovie.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.