Dwarf models

mockimgs_generate_dwarf is a script that allows to generate spheroidal dwarf models.

In a fitrs step, from a given total quantity of stellar mass, in solar unit, formed (e.g. --M0 1e4), the script generates a corresponding quantity of individual stars with some individual metallicityies and ages.

In a second step, the script uses an isochrone database to find the magnitude in some bands (e.g. --filters_keys VISmag Ymag Jmag) and luminosities (--logL 'logL') of each individual stars. Only stars that did not exploded yet, according to the lifetimes stored in the isochrone database, are considered.

If the option --filters_names MagVIS MagY MagJ is provided, the final output will be an n-nbody file with magnitudes for each star stored as:

nb.MagVIS
nb.MagY
nb.MagJ

mockimgs_generate_dwarf

usage: mockimgs_generate_dwarf [-h] [-o OUTPUTFILENAME] [-d DIRECTORY]
                               [-f FILENAME] [--info] [--seed INT]
                               [--imf STRING] [--minAge FLOAT]
                               [--maxAge FLOAT] [--minFe FLOAT]
                               [--maxFe FLOAT] [--logL STRING]
                               [--filters_keys [STRING ...]]
                               [--filters_names [STRING ...]] [--M0 FLOAT]
                               [--MassFactor FLOAT] [-e FLOAT]
                               [--rmax_e_ratio FLOAT] [--ftype FTYPE]
                               [--do_not_compute_rsp] [--nngb NNGB]
                               [--inidividual_stars] [-N INT]

generate a dwarf galaxy

By default, a density profile is generated with N particles having a mass M0/N.
If --inidividual_stars is specified, particles will represent individual stars with a given age and mass obtained
from a distribution.
To get the stellar masses, by default, the Kroupa 2001 IMF is used. It can be changed to anything providing a parameter file containing
the IMF parametrisation:

params = {}
params["Mmax"] = 50.
params["Mmin"] = 0.05
params["as"] = [0.7,-0.8,-1.7,-1.3]
params["ms"] = [0.08,0.5,1.0]

where ``as`` is the slope of the IMF in the mass intervals ``ms`` given is solar masses.   

options:
  -h, --help            show this help message and exit
  -o OUTPUTFILENAME     Name of the output file
  -d DIRECTORY          a directory (default=None)
  -f FILENAME           the name of isochrones database file
  --info                get info (list of keys) and exit.
  --seed INT            random seed
  --imf STRING          a file containing the IMF parameters
  --minAge FLOAT        minAge
  --maxAge FLOAT        maxAge
  --minFe FLOAT         minFe
  --maxFe FLOAT         maxFe
  --logL STRING         field name for logL
  --filters_keys [STRING ...]
                        the filters keys as stored in the database
  --filters_names [STRING ...]
                        the filters names as stored in the output n-body file
  --M0 FLOAT            stellar mass to generate [Msol]
  --MassFactor FLOAT    Mass factor (to the the correct final luminosity)
  -e FLOAT              scale length [kpc]
  --rmax_e_ratio FLOAT  rmax to scale length ratio
  --ftype FTYPE         type of file
  --do_not_compute_rsp  do not compute rsp
  --nngb NNGB           Number of neighbouring particles to consider to
                        compute RSP(==HSML)
  --inidividual_stars   sample individual stars
  -N INT                number of particles

Examples:
--------

# particles representing SSP

mockimgs_generate_dwarf  --M0 1e4 -e 0.1 -N 1000000   --minFe -4 --maxFe -2 --minAge 12500  --maxAge 13500 -o 1e4.hdf5 

# particles representing individual stars

mockimgs_generate_dwarf  --inidividual_stars --minFe -4 --maxFe -2 --minAge 12500  --maxAge 13500 --M0 1e4 -e 0.1  -f CMD_Euclid.dat --logL 'logL' -o 1e4.hdf5 --filters_keys VISmag Ymag Jmag --filters_names MagVIS MagY MagJ
mockimgs_generate_dwarf  --inidividual_stars --minFe -4 --maxFe -2 --minAge 12500  --maxAge 13500 --M0 1e4 -e 0.1  -d P04O1D1E1Y247 -o 1e4.hdf5  --filters_keys r g --filters_names Magr Magg
mockimgs_generate_dwarf  --inidividual_stars --minFe -4 --maxFe -2 --minAge 12500  --maxAge 13500 --M0 1e4 -e 0.1  -d P04O1D1E1Y247 -o 1e4.hdf5  --imf imf.py --filters_keys r g --filters_names Magr Magg