fire_studio

Movie Making Utilities for FIRE simulations

https://github.com/agurvich/fire_studio

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    13 of 14 committers (92.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.3%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Movie Making Utilities for FIRE simulations

Basic Info
  • Host: GitHub
  • Owner: agurvich
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 89.3 MB
Statistics
  • Stars: 14
  • Watchers: 1
  • Forks: 10
  • Open Issues: 11
  • Releases: 0
Created over 8 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.md

FIRE_studio

Build Status PyPI version ascl:2202.006

Movie Making Utilities for FIRE simulations

This git repository was lovingly made, the code it contains is largely based off two separate (but related) visualization codes built by Volker Springel and Phil Hopkins. This is not the greatest song in the world, this is just a tribute.

If you use FIRE studio in a talk or paper, please acknowledge it textually and cite the code entry in the Astrophysics Source Code Library.

Thanks, and enjoy!

Help Policy

To receive support please fill out the issue template in the github issues tab. Note that I only support the most recent version of FIRE studio by default and you will be required to upload a full stack trace and printed output along with the python script/pdf printout of the jupyter notebook and, if you want me to debug something I'll need pickled dictionaries with the input data as well (w/ coordinates offset, etc...) and not just a path to the snapshot hdf5 files. I ask this to help me help you!

requirements: abg_python

Sample Rendering

Installation

To install (with ssh) clone the repository and its dependency bash git clone git@github.com:agurvich/abg_python.git git clone git@github.com:agurvich/FIRE_studio.git and add them into your python path. I like to install these things to a single folder located at ${HOME}/python that I add to my python path by including bash export PYTHONPATH="${HOME}/python:${PYTHONPATH}" in my .bashrc file.

Then, if you'd rather install the repositories in a separate folder, you can use a soft link like so: bash ln -s /path/to/repository ${HOME}/python/repository_name So that you don't have to make your PYTHONPATH environment variable very confusing.

Linux

You're done, congratulate yourself!

Mac-OS / Windows

You will have to recompile the C routines in FIRE_studio/firestudio/utils/gas_utils/HsmlAndProject_cubicSpline/ and FIRE_studio/firestudio/utils/stellar_utils/c_libraries/. My only advice is to cd into the directories and use make, if you don't know how to compile C code or end up with an error then you should focus your Google-fu efforts on intalling "Homebrew" and then use brew install gcc if you're on Mac-OS. If you're on Windows then your best bet is to install Windows Subsystem for Linux (WSL) and run a virtual Linux kernel on your computer (and then you can just use apt-get install gcc if necessary).

Using FIRE_studio

There are two ways to use FIRE_studio 1) From the command line (currently broken) 2) From a Python script / Jupyter notebook

Each has its benefits/uses. If you run from within an existing Python context you can avoid having to open and reorient a snapshot (assuming you've already done that) by passing a dictionary with the required arrays. If you run from the command line I have included a simple multiprocessing ability so that you can render a large number of snapshots simultaneously.

Running from the command line

(Note that this is currently not working) A render-loop can be started by passing any of the keyword arguments listed on the wiki as command line arguments with the addition of snapstart and snapmax, which are the initial and final snapshots that will be rendered. There is also the mps flag that determines how many multiprocessing threads should be launched if you'd like to render the snapshots in parallel (1 thread / snapshot), make sure you have enough cores/memory for however many threads you request.

For a gas density rendering: python firestudio/gas_movie_maker.py --snapdir="/home/abg6257/projects/snaps/m12i_res7100/output" --snapstart=555 --snapmax=600 --frame_width=30 --frame_depth=15 --edgeon=1 --datadir="/home/abg6257/src/FIRE_studio" --multiproc=4 --extract_galaxy=1 --noaxis=1

or for a mock hubble (or SDSS) rendering: python firestudio/star_movie_maker.py --snapdir="/home/abg6257/projects/snaps/m12i_res7100/output" --snapstart=555 --snapmax=600 --frame_width=30 --frame_depth=15 --edgeon=1 --datadir="/home/abg6257/src/FIRE_studio" --multiproc=4 --extract_galaxy=1 --noaxis=1

Running from within a Python context

Begin by importing the studio class you would like to use, GasStudio for making volume renderings of the gas and its properties or StarStudio for mock Hubble (or SDSS) images using simulated starlight that is attenuated by dense gas (dust lanes for days!).

```python from firestudio.studios.gas_studio import GasStudio

mygasStudio = GasStudio( datadir, ## where cache files are written out to, not the simulation directory snapnum, ## what snapshot number, used to name cache files simname, ## what simulation name, used to name cache files framehalfwidth=15, ## kpc, half width of image in x- and y-directions framehalfthickness=15, ## kpc, half thickness of image in z-direction gassnapdict=gassnapdict, ## dictionary containing gas particle data starsnapdict=starsnapdict) ## dictionary containing star particle data

mygasStudio.render( plt.gca(), weightname='Masses', quantityname='Temperature', minweight=-0.1, maxweight=1.5, weightadjustmentfunction=lambda x: np.log10(x/gasStudio.Acell)+10-6) ## msun/pc^2 minquantity=2, maxquantity=7, quantityadjustment_function=np.log10) ```

Where gas_snapdict is a python dictionary holding the snapshot arrays for PartType0 with keys that match the FIRE defaults. abg_python.snap_utils.openSnapshot will do this for you.

For more information on the functionality and the different keyword arguments, see the corresponding wiki page.

```python from firestudio.studios.star_studio import StarStudio

mystarStudio = StarStudio( datadir, ## where cache files are written out to, not the simulation directory snapnum, ## what snapshot number, used to name cache files simname, ## what simulation name, used to name cache files framehalfwidth=15, ## kpc, half width of image in x- and y-directions framehalfthickness=15, ## kpc, half thickness of image in z-direction gassnapdict=gassnapdict) ## dictionary containing gas particle data

my_starStudio.render(plt.gca()) ```

Where star_snapdict is a python dictionary holding the snapshot arrays for PartType4 with keys that match the FIRE defaults. abg_python.snap_utils.openSnapshot will do this for you. If you are making an image of an isolated galaxy, you should remember to merge the dictionaries of PartType2, PartType3, and PartType4.

For more information on the functionality and the different keyword arguments, see the corresponding wiki page.

Owner

  • Name: Alex Gurvich
  • Login: agurvich
  • Kind: user
  • Location: Chicago, Illinois
  • Company: Northwestern University: CIERA

star formation enthusiast and interstellar gas-trophysicist

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Gurvich"
  given-names: "Alexander B."
  orcid: "https://orcid.org/0000-0002-6145-3674"
title: "FIRE Studio: Movie making utilities for the FIRE simulations"
version: 2.0.1
doi: 2022ascl.soft02006G
date-released: 2021-12-06
url: "https://github.com/agurvich/FIRE_studio"

GitHub Events

Total
  • Watch event: 1
  • Fork event: 3
Last Year
  • Watch event: 1
  • Fork event: 3

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 434
  • Total Committers: 14
  • Avg Commits per committer: 31.0
  • Development Distribution Score (DDS): 0.141
Top Committers
Name Email Commits
Alex Gurvich a****h@u****u 373
GURVICH Alexander a****7@q****u 17
Alex Gurvich t****9@l****u 9
GURVICH Alexander a****7@q****u 9
GURVICH Alexander a****7@q****u 8
Zach Hafen z****n@g****m 5
Alex Gurvich t****9@c****u 3
Alex Gurvich t****9@l****u 3
GURVICH Alexander a****7@q****u 2
GURVICH Alexander a****7@q****u 1
GURVICH Alexander a****7@q****u 1
Alex Gurvich t****9@l****u 1
Jonathan Stern t****7@l****u 1
GURVICH Alexander a****7@q****u 1

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 19
  • Total pull requests: 5
  • Average time to close issues: 9 months
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 1.58
  • Average comments per pull request: 0.2
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • agurvich (15)
  • sawellons (2)
  • richings (1)
  • peano93 (1)
Pull Request Authors
  • agurvich (2)
  • calebchoban (1)
  • zhafen (1)
  • meorr (1)
Top Labels
Issue Labels
bug (5) enhancement (5)
Pull Request Labels

Dependencies

setup.py pypi
  • abg_python *
  • matplotlib *
  • numpy *
  • scipy *
pyproject.toml pypi