Skip to content

nkoshimoto/genstars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: GPL v3 DOI

genstars

genstars is a stellar population synthesis tool for our Galaxy that generates stars using the Galactic model developed by Koshimoto, Baba & Bennett (2021).
A difference from other population synthesis tools is that the Galactic model used is optimized for the bulge direction.
Currently the simulation is only available inside a box with -9.5 < l < 9.5 and -10.0 < b < 4.5 because it uses the VVV extinction map combining the ones by Gonzalez et al. (2012) and Surot et al. (2020) to calculate extinction values.

Although the Galactic model was originally developed for the Galactic bulge region in |b| > 1 deg. genstars uses a newly developed version of the model that includes the nuclear stellar disk (NSD) model based on Sormani et al. (2022). A paper describing the new model is currently in preparation, and will be linked here as long as it becomes available.
The code itself has been published as Koshimoto (2022), Zenodo.6941086.

A simulator for microlensing events, genulens, is also available.

The copyright of an included supplementary code, "option.c", belongs to Ian A. Bond and Takahiro Sumi.

Before installation

Please ensure that GSL (GNU Scientific Library) is installed in your environment. If you do not have GSL, please download it from the link provided on the GSL page, and install it following README or INSTALL in the downloaded directory.

You can check where you have GSL by

gsl-config --libs

If the command gsl-config does not work in the terminal, it probably means that the GSL lib is not installed, or unknown to the OS.

Installation

If you have git, you can download the package by

git clone https://github.com/nkoshimoto/genstars.git

This is recommended because that way you can track any future updates with git.

If you do not have git, you can simply download the package by clicking the green button "Code" on the upper right in the repository page, selecting "Download ZIP", and then unzipping it.

You need a C compiler to make using Makefile to compile the program genstars.c in the downloaded directory. The default compiler is clang, which is available in macOS. Please replace the first uncommented line in Makefile with gcc or any other C compiler if you prefer. If you are not sure if you have clang or gcc, you can check it by

which clang (or gcc)

If your terminal returns a full path for it, then you have the compiler.

You might also need to change the paths for GSL specified in Makefile. There are two lines to specify paths for GSL in the file;

INCLUDE = -I/opt/local/include LINK = -L/opt/local/lib

Please replace the path in INCLUDE with the path returned by

gsl-config --cflags

and replace the path in LINK with the path returned by

gsl-config --libs 

After making sure that you specify your C compiler and the paths for GSL in Makefile, you can compile the program by

make

If

./genstars

returns output lines that starts from

# Output of "./genstars "

and ends with

# (n_BD n_MS n_WD n_NS n_BH)/n_all= ( 78278 144310 25211 1083 499 ) / 249381 = ( 0.313889 0.578673 0.101094 0.004343 0.002001 )

you are ready to use genstars. Note that the exact numbers of the end line might depend on your environment because the calculation uses random numbers. Please make sure that the input_files/ directory is in the same directory as where you run genstars.

Usage

Some example runs and their explanations are presented in genstars_samples.ipynb

About

A stellar population synthesis tool for our Galaxy optimized for the bulge region

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors