mclindner / galcollide Goto Github PK
View Code? Open in Web Editor NEWEnvironment for creating initial conditions for galaxy collisions.
Environment for creating initial conditions for galaxy collisions.
--------------------------------------------------------------------------- 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.