Git Product home page Git Product logo

fastpp's People

Contributors

cschreib avatar hughdickinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastpp's Issues

valid dust laws

Running some initial tests and noticed an issue with the valid dust laws in fast++-read_input.cpp:

note: this is FAST++ version '1.2'
error: unknown dust law 'mw'
error: possible values: {calzetti, mz, noll, kc}

Adding new filters

Hi Corentin,

Would it be possible to add a small section on the documentation on adding new filters? It seems there are some minor differences between the IDL and C++ versions in how the filters are identified from the database?

download_bc03_ssp.sh vs what is looked for by fastpp

Hi!!!

In the download script for the models the final names are in the format of
*.ised_ASCII

However, when the code is executed libraries are still expected in this format:
fastpp/share/libraries/ised_exp.hr/bc03_hr_ch_z004_ltau8.5.ised

installation issue

when I try to install the code in strw desktops I get the following error:

is this a quick fix?

[ 93%] Performing build step for 'fast++'
Scanning dependencies of target fast++-sfh2sed
[ 7%] Building CXX object CMakeFiles/fast++-sfh2sed.dir/fast++-sfh2sed.cpp.o
/data2/themiya/softwares/fastpp/src/fast++-sfh2sed.cpp: In function ‘int phypp_main(int, char**)’:
/data2/themiya/softwares/fastpp/src/fast++-sfh2sed.cpp:58:9: error: ‘end_with’ was not declared in this scope
if (end_with(sfh_file, ".fits")) {
^~~~~~~~
make[5]: *** [CMakeFiles/fast++-sfh2sed.dir/build.make:63: CMakeFiles/fast++-sfh2sed.dir/fast++-sfh2sed.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:68: CMakeFiles/fast++-sfh2sed.dir/all] Error 2
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/fast++.dir/build.make:113: fast++-prefix/src/fast++-stamp/fast++-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:143: CMakeFiles/fast++.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
kuider [524] $

Error with make install

Hi,

I am trying to install fast++, but I am getting an error (see below). I have a Dell XPS15 with Ubuntu 22.04 OS. I also installed cmake with sudo apt install cmake.

Error:

...
[ 81%] Performing build step for 'fast++'
[  7%] Building CXX object CMakeFiles/fast++.dir/fast++-read_input.cpp.o
In file included from /home/tomas/fastpp/external/include/vif/core/vec.hpp:1236,
                 from /home/tomas/fastpp/src/fast++.hpp:5,
                 from /home/tomas/fastpp/src/fast++-read_input.cpp:1:
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:155:15: error: invalid use of incomplete type ‘struct vif::impl::op_mul_t’
  155 |     VECTORIZE(*, *=)
      |               ^
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:26:56: note: in definition of macro ‘OP_TYPE’
   26 |         #define OP_TYPE(op) decltype(impl::op_node_t{} op impl::op_node_t{})
      |                                                        ^~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:155:5: note: in expansion of macro ‘VECTORIZE’
  155 |     VECTORIZE(*, *=)
      |     ^~~~~~~~~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:12:16: note: forward declaration of ‘struct vif::impl::op_mul_t’
   12 |         struct op_mul_t;
      |                ^~~~~~~~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:78:56: error: template argument 1 is invalid
   78 |         vec<Dim,typename impl::op_res_t<OP_TYPE(op),T,U>::type> operator op (const vec<Dim,T>& v, const vec<Dim,U>& u) { \
      |                                                        ^
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:155:5: note: in expansion of macro ‘VECTORIZE’
  155 |     VECTORIZE(*, *=)
      |     ^~~~~~~~~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:78:57: error: ‘<declaration error>’ is not a template [-fpermissive]
   78 |         vec<Dim,typename impl::op_res_t<OP_TYPE(op),T,U>::type> operator op (const vec<Dim,T>& v, const vec<Dim,U>& u) { \
      |                                                         ^~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:155:5: note: in expansion of macro ‘VECTORIZE’
  155 |     VECTORIZE(*, *=)
      |     ^~~~~~~~~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:78:63: error: template argument 2 is invalid
   78 |         vec<Dim,typename impl::op_res_t<OP_TYPE(op),T,U>::type> operator op (const vec<Dim,T>& v, const vec<Dim,U>& u) { \
      |                                                               ^
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:155:5: note: in expansion of macro ‘VECTORIZE’
  155 |     VECTORIZE(*, *=)
      |     ^~~~~~~~~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp: In function ‘int vif::operator*(const vif::vec<Dim, Type>&, const vif::vec<Dim, U>&)’:
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:155:15: error: invalid use of incomplete type ‘struct vif::impl::op_mul_t’
  155 |     VECTORIZE(*, *=)
      |               ^
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:26:56: note: in definition of macro ‘OP_TYPE’
   26 |         #define OP_TYPE(op) decltype(impl::op_node_t{} op impl::op_node_t{})
      |                                                        ^~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:155:5: note: in expansion of macro ‘VECTORIZE’
  155 |     VECTORIZE(*, *=)
      |     ^~~~~~~~~
/home/tomas/fastpp/external/include/vif/core/bits/operators.hpp:12:16: note: forward declaration of ‘struct vif::impl::op_mul_t’
   12 |         struct op_mul_t;
      |                ^~~~~~~~
compilation terminated due to -fmax-errors=5.
make[5]: *** [CMakeFiles/fast++.dir/build.make:76: CMakeFiles/fast++.dir/fast++-read_input.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:87: CMakeFiles/fast++.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/fast++.dir/build.make:86: fast++-prefix/src/fast++-stamp/fast++-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:168: CMakeFiles/fast++.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Comparison between fastpp and FAST-IDL

Hello! I'm really excited to use fastpp, but I'm really confused as to a few things with respect to the comparison between the results from fastpp and FAST-IDL. When I use the same parameter file with both FAST-IDL and fastpp, I get similar masses, but vastly different ages, tau values, and SFRs (the tau values and ages don't have any correlation), even when I set:

C_INTERVAL=68
BEST_AT_ZPHOT=1
ZPHOT_CONF=68

as suggested in the README. The chi-square values are larger for FAST-IDL by quite a bit than for fastpp, as well. For this test, I'm running with N_SIM = 0, for quick usage.

In addition, I'm confused as to what the fitting redshifts correspond to. In the .param file, I set:

NAME_ZPHOT     = 'z_peak'

and the output redshifts in the .fout file don't seem to correspond to z_peak values, even with BEST_AT_ZPHOT = 1. Here, both the z_spec value in the .zout and .cat files are set to -9999.

Perhaps I am not understanding how the code works, but I just don't know why I can't seem to get fast to try to fit at the z_peak values.

Higher Sig Figs in Output file

Hey, How do you get higher significant figures for your output columns? Can you add a feature where we can define that?

FAST++ aborts while running with JWST filters

I am trying to run FAST++ on some JWST photometry and every time I run the parameter file it always aborts.

I use the new FILTERS.RES file from EAZY that includes the JWST filters.

Here is the parameter file (most of them are the default parameters and I use absolute paths):

#... FAST++ V1.2: parameter file .......................................


#--- GENERAL INFORMATION -----------------------------------------------
#
# Please read this parameter file in detail, you can find all relevant
# information here. Note that you have to adjust your input catalogs
# accordingly, otherwise FAST++ may not work properly!
#
# o Requirements:
#   - about 30 MB of free RAM memory
#   - at least one CPU core
#
# o The current directory should contain the following files:
#   - This parameter file
#   - [CATALOG].cat        If you fit broadband photometry
#   - [CATALOG].zout       If you input photometric redshifts
#   - [CATALOG].lir        If you input infrared luminosities
#   - [CATALOG].translate  If you input a translate file
#   - [SPECTRUM].spec      If you fit spectra
#
# o FAST++ runs from the command line.
#   The first argument is the parameter file. Default is 'fast.param'
#   $ fast++
#   $ fast++ my_fast.param
#
# o VERBOSE: set to 0 to disable output in the terminal (except for
#   warnings and errors, which are always shown)
#
# o PARALLEL: sets which part of the code should be executed in parallel.
#    - 'none': (default) no parallelization, the code will execute on
#      one CPU.
#    - 'generators': each model will be generated and adjusted to the
#      photometry in a separate thread. Good when you have a huge number
#      of models and very few galaxies to fit. Will fallback to 'models'
#      if a model cache exists.
#    - 'models': each model will be adjusted to the photometry in a
#      separate thread, but models are generated in the main thread only.
#      Good when you have many models and few galaxies to fit, or when
#      the models were already generated and cached on the disk.
#    - 'sources': the input catalog will be split into equal parts, and
#      each part will be analyzed in a separate thread. Good when you
#      have few models but lots of galaxies.
#
# o N_THREAD: sets the maximum number of threads the program can use at
#   once. This should be close to (or equal to) the number of available
#   cores on your CPU, or one less than the number of nodes available on a
#   cluster. Setting this to zero will disable parallelization. Note that,
#   to enable parallel execution, you also need to change PARALLEL to
#   something other than 'none'.
#
# o MAX_QUEUED_FITS: sets the maximum number of fits that are queued and
#   waiting to be executed by the worker threads. Increasing this value
#   will make the code run faster, but will also increase memory usage.
#   For a run on a desktop computer with no more than 10 threads, a value
#   of 1000 provides a good compromise; larger values do not improve
#   performances significantly (no more than 10%).
#
#-----------------------------------------------------------------------

VERBOSE         = 1         # 0 / 1
PARALLEL        = 'generators'    # 'none', 'generators', 'models', or 'sources'
N_THREAD        = 4         # 0, 1, 2, 3, 4, etc
MAX_QUEUED_FITS = 10000


#--- BROADBAND PHOTOMETRIC INFORMATION ---------------------------------
#
# o [CATALOG].cat (similar as for EAzY):
#   - Example catalog: hdfn_fs99.cat
#   - FAST++ recognizes columns with names {id,ID,z_spec,F[n],E[n],
#     TOT[n]} with n the number of the filter
#   - If z_spec is not given or any negative value, no z_spec is assumed
#   - Give a negative error or "NaN" if the object has no coverage in a
#     certain band
#
# o [CATALOG].zout (preferably generated with EAzY):
#   - Example catalog: hdfn_fs99.zout
#   - If NAME_ZPHOT is not defined, FAST reads columns with labels "z_phot"
#     as best-fit photometric redshifts "l68/l95/l99" and "h68/h95/h99"
#     for the confidence intervals
#   - If input photo-z is a negative value, the photo-z will be ignored
#   - If [CATALOG].zout is not available, and no z_specs are given in
#     [CATALOG].cat, then the redshifts are allowed to float
#   - You can also read in spectroscopic redshifts from [CATALOG].zout.
#     The corresponding column should be labeled "z_spec". However, if you
#     list them in [CATALOG].cat, FAST++ will ignore those in [CATALOG].zout
#
# o [CATALOG].translate:
#   - Example file: hdfn_fs99.translate
#   - Translates the column names in [CATALOG].cat to the required
#     F[n],E[n],etc formats
#   - Will only be used when available
#
# o AB_ZEROPOINT: m_AB = AB_ZEROPOINT - 2.5*log(F[n])
#   - Default: AB_ZEROPOINT = 23.9
#   - fluxes in micro Janskys: AB_ZEROPOINT = 23.9
#   - fluxes in erg sec^{-1} cm^{-2} Hz^{-1}: AB_ZEROPOINT = 48.6
#
# o FILTERS_RES: similar as for EAzY
#
# o FILTER_FORMAT: tells the program in the response curves provided in
#   filters_res file are determined for energy-counting (=0) or photon-
#   counting (=1) detectors (Default: 1)
#
# o TEMP_ERR_FILE: Template error function. The photometric errors are
#   in rest-frame multiplied by this function.
#
# o NAME_ZPHOT: Header name of the column in your [CATALOG].zout file
#   that you want to use for your photometric redshifts. If not defined,
#   FAST will look for 'z_phot'
#
# o FORCE_ZPHOT: if set to 1, tells the program to treat the photometric
#   redshifts as spectroscopic redshifts.
#
# o BEST_AT_ZPHOT: if set to 1, tells the program to force the best-fit
#   solution to match the photometric redshift obtained by EAzY, but the
#   confidence intervals will still account for the uncertainty on the
#   redshift (note that these intervals may not be centered on the best-
#   fit solution if this option is enabled).
#
# o ZPHOT_CONF: tells which confidence interval of the photometric
#   redshifts should be used to limit the grid for each galaxy.
#   Redshifts outside of this confidence interval will not be considered.
#
# o USE_LIR: if set to 1 and [CATALOG].lir exists, FAST++ will read
#   infrared luminosities from this file and use them to constrain the
#   fit. Must contain columns: id, lir and elir. The observed luminosities
#   (given in units of total solar luminosity) are compared to the
#   modelled difference of bolometric luminosity before and after dust
#   attenuation is applied to the model. This can help break degeneracies,
#   but requires that the redshift is well known. The file can contain a
#   fourth column, labelled 'log', which is a 0/1 flag that determines if
#   the LIR value is given in log10 units or in natural units. This
#   changes the way the uncertainty is interpreted: with log=0 the
#   uncertainty is assumed to be Gaussian (additive), but with log=1 the
#   uncertainty is assumed to be log-normal (multiplicative). Therefore
#   when log=1, the 'elir' column must contain the 1-sigma uncertainty on
#   log10(LIR).
#
#-----------------------------------------------------------------------

CATALOG        = '/Users/nikhilgaruda/Documents/Astronomy_Research/G165/fast/img_fam'
AB_ZEROPOINT   = 0.
FILTERS_RES    = '/Users/nikhilgaruda/Documents/Astronomy_Research/G165/Photometry/EAZYpy/eazy/data/filters/FILTER.RES.latest'
FILTER_FORMAT  = 1
TEMP_ERR_FILE  = ''
NAME_ZPHOT     = 'z_m1'
FORCE_ZPHOT    = 0          # 0 / 1
BEST_AT_ZPHOT  = 0          # 0 / 1
ZPHOT_CONF     = 68         # 68 / 95 / 99
USE_LIR        = 0          # 0 / 1


#--- SPECTROSCOPIC INFORMATION -----------------------------------------
#
# o SPECTRUM:
#   - Example file: "1030_gnirs.spec"
#   - The file should have the following format:
#     # bin wl_low wl_low F[id1] E[id1] F[id2] E[id2] ...
#   - bin: ID of the bin in which the spectral element falls
#   - wl_low: lower wavelength of the spectral element in Angstrom
#   - wl_up: upper wavelength of the spectral element in Angstrom
#   - (e)fl: in 10^-19 ergs s-1 cm-2 Angstrom-1 (these units do not
#     matter if AUTO_SCALE is set to 1)
#   - id[.]: should be an ID in the flux catalog
#   - Missing values can be signaled with negative errors or "NaN".
#
# o AUTO_SCALE: This option automatically adjusts the spectrum to the
#   model separately from the rest of the photometry. The spectrum thus
#   does not participate in determining the best amplitude of the
#   model, but still participates in the chi2. This can account for
#   uncertain flux calibration of the spectrum, and will emphasize more
#   the features of the spectrum rather than it's absolute flux level.
#   Note that when this feature is enabled, the template error function,
#   if used, will not be applied to the spectral data.
#
# o APPLY_VDISP: Velocity dispersion of the spectral templates. Setting
#   this parameter to a non-zero value will broaden the templates with
#   a fixed velocity dispersion before the fit. This is only relevant
#   when fitting spectra, and has an impact on performances (a couple
#   seconds of extra delay), so it is disabled by default.
#
#-----------------------------------------------------------------------

SPECTRUM       = ''
AUTO_SCALE     = 0          # 0 / 1
APPLY_VDISP    = 0          # km/s


#--- OUTPUT INFORMATION  -----------------------------------------------
#
# o OUTPUT_DIR: output directory for results
#
# o OUTPUT_FILE: output file for results.
#   If not given: [CATALOG]_[SPECTRUM].fout
#
# o N_SIM: The number of Monte Carlo simulations used to determine the
#   confidence levels. If zero or not defined, only best-fit values will
#   be given.
#
# o C_INTERVAL: Percentage of confidence intervals, choose from 68% (1
#   sigma), 95% (2 sigma), or 99% (3 sigma)
#
# o BEST_FIT: output best-fit SPS model in the 'best_fits' directory
#
# o BEST_FROM_SIM: use the median of the Monte Carlo simulation as
#   best-fit instead of the model with the smallest chi squared on
#   the original (unperturbed) photometry.
#
# o INTERVAL_FROM_CHI2: use the chi2 grid directly to compute confidence
#   intervals on the fit parameters, instead of using Monte Carlo
#   simulation. This will force setting 'SAVE_BESTCHI' to a value large
#   enough to encompass the chosen confidence intervals.
#
# o SAVE_SIM: save the best-fit parameters for each Monte Carlo
#   simulation for all sources in the "best_fits" directory.
#
# o SFR_AVG: output the SFR as the average of the 'SFR_AVG' last million
#   years. If set to zero (the default) FAST++ will output the
#   instantaneous SFR.
#
# o INTRINSIC_BEST_FIT: if BEST_FIT=1, setting this option to 1 will also
#   output the intrinsic best-fit SED of the galaxy, as it would be seen
#   without dust obscuration. This intrinsic SED is saved as a third
#   column in the best-fit SED file.
#
# o BEST_SFHS: if set to 1, the program will output the best-fit star
#   formation history along with the best fit SEDs. If Monte Carlo
#   simulations are enabled, the confidence intervals of the SFH will
#   also be written.
#
# o SFH_OUTPUT_STEP: if BEST_SFHS=1, sets the time step of the output SFH
#   in million years. The default is 10 Myr.
#
# o SFH_OUTPUT: 'sfr' will output the evolution of the star formation rate
#   with time, while 'mass' will show the total stellar mass (including
#   mass loss).
#
# o REST_MAG: list of filter ID to use to compute rest-frame magnitudes.
#   These absolute magnitudes are then given at 10pc in the AB system,
#   using AB_ZEROPOINT, and are not corrected for attenuation.
#
# o CONTINUUM_INDICES: file listing the continuum indices (absorption
#   line equivalent-width, Dn4000, ...) to compute from each model
#   spectrum. See examples in the "share/continuum_indices" directory.
#
# o SFH_QUANTITIES: list of SFH quantities to compute for each model.
#   These quantities are computed directly on the SFH functional form
#   of each model, and are thus non-parametric. Available quantites:
#    - 'tsf': shortest time interval over which 68% of SFR took place
#             (= duration of star formation).
#    - 'past_sfr': average SFR during the above time interval
#                  (= mean past SFR).
#    - 'sfr'X : average SFR over the last 'X' Myr.
#    - 'brate'X : 'sfr'X / 'past_sfr' (= birth-rate parameter).
#    - 'tquench'X : elapsed time since the SFR dropped below a factor
#                   'X' of the 'past_sfr' (= time since quenching).
#    - 'tform'X : elapsed time since the galaxy had formed 'X'% of its
#                 current mass (= time since formation).
#
# o OUTPUT_COLUMNS: define here what columns to write in [CATALOG].fout
#   Available columns: id, metal, lage, Av, lmass, lsfr, lssfr, lldust,
#   llion, lmform and chi2. If using the "standard" FAST templates, two
#   additional columns are available: ltau and la2t. If using custom SFH,
#   you can also choose any of your custom SFH parameter. Rest-frame
#   magnitudes specified in 'REST_MAG' are also available, the format is
#   "M[...]" where "[...]" is the filter ID. If this variable is set to
#   an empty array (default), then all available parameters are written
#   in the file (except lldust, llion, and lmform).
#
#-----------------------------------------------------------------------

OUTPUT_DIR         = '/Users/nikhilgaruda/Documents/Astronomy_Research/G165/fast/OUTPUT'
OUTPUT_FILE        = ''
N_SIM              = 100
C_INTERVAL         = [68 ,95]           # 68 / 95 / 99 or [68,95] etc
BEST_FIT           = 1             # 0 / 1
BEST_FROM_SIM      = 0             # 0 / 1
INTERVAL_FROM_CHI2 = 0             # 0 / 1
SAVE_SIM           = 1             # 0 / 1
SFR_AVG            = 0             # 0, 100 Myr, 300 Myr etc
INTRINSIC_BEST_FIT = 0             # 0 / 1
BEST_SFHS          = 1             # 0 / 1
SFH_OUTPUT_STEP    = 1           # 10 Myr, 100 Myr etc
SFH_OUTPUT         = 'sfr'         # 'sfr' or 'mass'
REST_MAG           = []            # [140,142,161] for UVJ colors
CONTINUUM_INDICES  = ''
SFH_QUANTITIES     = ['tsf','past_sfr','sfr10','brate10','tquench10','tform50']            # ['tquench10','tform50','brate10', ...]
OUTPUT_COLUMNS     = ['id','Av','lmass','lsfr', 'metal', 'chi2']            # ['id','Av','lmass','lsfr', ...]


#--- CHOOSE STELLAR POPULATIONS LIBRARY --------------------------------
#
# o LIBRARY_DIR: directory containing the stellar population libraries
#   of the form: ised_[SFH].[resolutions].
#   The binaries in these directories are of the following form:
#   [library]_[resolution]_[imf]_z[metallicity]_ltau[ltau/yr].ised
#
# o All binary inputs are made using "csp_galaxev"
#   ("galaxev" software by Bruzual & Charlot 2003) on the SSP models
#   "bc2003_[RESOLUTION]_[metal]_[IMF]_ssp.ised" and assuming no dust
#   law (and no recycling of gas ejected by stars for exponentially
#   declining star formation history)
#
# o LIBRARY: choose from Bruzual & Charlot 2003 ('bc03'),
#   Maraston 2005 ('ma05'), and FSPS by Conroy et al. ('co11')
#
# o RESOLUTION: Choose 'hr' for spectral fitting, and 'pr' (photometric
#   resolution) or 'lr' for medium and broadband filters. Not all
#   resolutions are standard available for all SFHs or libraries or IMFs
#
# o IMF (stellar initial mass function), choose from
#   - 'ch'(abrier)
#   - 'sa'(lpeter)
#   - 'kr'(oupa)
#
# o SFH: parametrization of the star formation history (SFH), choose from
#   - 'exp': exponentially declining SFH; sfr ~ exp(-t/tau)
#   - 'del': delayed exponentially declining SFH; sfr ~ t exp(-t/tau)
#   - 'tru': truncated SFH, with constant star formation between
#            t_onset and t_onset+tau
#   For all SFH you can specify the range tau in the grid
#
# o DUST_LAW: parametrization of the dust attenuation curve. You can
#   choose from the following options
#   - 'calzetti': Calzetti (2000) dust law
#   - 'mw': Milky Way, following parametrization by Cardelli et al. (1989)
#   - 'kc': Kriek & Conroy (2013). Average dust law. We use the
#      parametrization by Noll et al. with E_B = 1 and delta = -0.1
#   - 'noll': For this law you have to parametrize E_b and delta.
#      You can only pick one value for each, arrays are not allowed.
#
# o MY_SFH: if you define this option, FAST++ will not fit a range of
#   star-formation histories, but just one model (so LOG_TAU_XXX will
#   be ignored). For this option you can only read in one custom star
#   formation history, for which you have to make the ISED file
#   yourself using "csp_galaxev". The naming of the ised file has to
#   be as follows:
#   [library]_[resolution]_[imf]_z[metallicity]_[MY_SFH].ised
#   This file needs to be placed directly in 'LIBRARY_DIR'
#
# o CUSTOM_SFH: if you define this option, FAST++ will build a grid of
#   templates on the fly using SSP models, instead of reading the
#   composite models from "csp_galaxev". You can therefore fit any
#   star formation history. The SFH must be a mathematical expression
#   which returns the SFR as a function of the time 't' since the galaxy
#   was born (the unit of the SFR doest not matter). Custom grid parameters
#   can be referenced in this function (see below) but not the age or the
#   dust attenuation.
#
# o CUSTOM_PARAMS: when using CUSTOM_SFH, define here the names of your
#   grid parameters (e.g., log_tau). For each of these parameters you
#   must provide the _MIN, _MAX and _STEP values, as for the other
#   grid parameters.
#
# o CUSTOM_SFH_LOOKBACK: changes the meaning of the time 't' in the SFH
#   expression, so that 't' refers to the lookback time. The instant t=0
#   then refers to the moment where the galaxy is observed, and larger
#   values correspond to earlier times in the past. This is equivalent
#   to substituting 't' for '10^lage - t' in the SFH expression.
#
#-----------------------------------------------------------------------

LIBRARY_DIR         = '/Users/nikhilgaruda/Documents/Documents/Astronomy_Research/Software/fastpp/share/libraries/'
LIBRARY             = 'co11'         # 'bc03' / 'ma05' / 'co11'
RESOLUTION          = 'hr'           # 'pr' / 'lr' / 'hr'
IMF                 = 'ch'           # 'ch' / 'sa' / 'kr'
SFH                 = 'del'          # 'exp' / 'del' / 'tru'
DUST_LAW            = 'kc'     # 'calzetti' / 'mw' / 'kc' / 'noll'
# E_B               = 1              # only define for 'noll' dust law
# delta             = -0.2           # only define for 'noll' dust law
MY_SFH              = ''
CUSTOM_SFH          = ''             # '(1 + t)^alpha'
CUSTOM_PARAMS       = []             # ['alpha', ...]
CUSTOM_SFH_LOOKBACK = 0              # 0 / 1
# ALPHA_MIN         = -2             # define these for each parameter
# ALPHA_MAX         = 2              # define these for each parameter
# ALPHA_STEP        = 0.1            # define these for each parameter


#--- DEFINE GRID -------------------------------------------------------
#
# o Choose only values for tau and metallicity that are in your library.
#   Otherwise extend your library.
#
# o If EAzY is used, make sure Z_MIN, Z_MAX are similar.
#
# o METAL: the options differ per stellar population library
#   ma05: Z=0.001, Z=0.01, Z=0.02 [solar], and Z=0.04
#   bc03: Z=0.004, Z=0.008, Z=0.02 [solar], and Z=0.05
#   co11: Z=0.0008, Z=0.0031, Z=0.0096, Z=0.019 [solar], and Z=0.03
#   You can choose more than one by defining an array.
#
# o If a grid has already been made for a specific LIBRARY, RESOLUTION,
#   IMF, tau, age, z, A_v, A_v_bc, metallicity, and filter set and/or
#   spectral elements, the grid will be automatically read from the cache
#   unless the NO_CACHE option is set to "1". This option will also
#   prevent the code from writing this cache in the first place.
#
# o DIFFERENTIAL_A_V: By default (0), all stars suffer the same amount
#   of extinction by dust. If DIFFERENTIAL_A_V is set to "1", young
#   stars will be place under a thicker screen of dust, as controlled by
#   A_V_BC_MIN, A_V_BC_MAX, A_V_BC_STEP, and LOG_BC_AGE_MAX.
#
# o LOG_BC_AGE_MAX: When DIFFERENTIAL_A_V is set to "1", stars in their
#   birth cloud will be given extra attenuation. Only stars younger than
#   LOG_BC_AGE_MAX are considered to be in their birthcloud. The default
#   of 10 Myr is taken from Charlot&Fall (2001).
#
# o NO_MAX_AGE: By default (0), ages that exceed the age of the universe
#   are not allowed. However, when NO_MAX_AGE is put to "1" you can have
#   older ages.
#
#-----------------------------------------------------------------------

LOG_TAU_MIN      = 8.5            # log [yr]
LOG_TAU_MAX      = 10.            # log [yr]
LOG_TAU_STEP     = 0.5            # log [yr], min 0.1
LOG_AGE_MIN      = 8.0            # log [yr]
LOG_AGE_MAX      = 10.0           # log [yr]
LOG_AGE_STEP     = 0.05            # log [yr]
NO_MAX_AGE       = 0              # 0 / 1
Z_MIN            = 0.01           # Cannot be 0.0
Z_MAX            = 14.00
Z_STEP           = 0.01
Z_STEP_TYPE      = 1              # 0: Z_STEP, 1: Z_STEP*(1+z)
A_V_MIN          = 0.             # [mag]
A_V_MAX          = 3.             # [mag]
A_V_STEP         = 0.1            # [mag]
A_V_BC_MIN       = 0.             # [mag]
A_V_BC_MAX       = 0.             # [mag]
A_V_BC_STEP      = 0.1            # [mag]
DIFFERENTIAL_A_V = 0              # 0 / 1
LOG_BC_AGE_MAX   = 7.0            # log [yr]
METAL            = [0.02]         # [0.0096,0.019,0.03]
NO_CACHE         = 1              # 0 / 1


#--- COSMOLOGY ---------------------------------------------------------
#
#-----------------------------------------------------------------------

H0             = 70.0               # Hubble constant
OMEGA_M        = 0.3                # Omega matter
OMEGA_L        = 0.7                # Omega lambda
NO_IGM         = 0                  # 0 / 1


#--- SAVE INTERMEDIATE PRODUCTS ----------------------------------------
#
# o SAVE_CHI_GRID: if "1" then the chi2 grid for all objects will be
#   saved in a ".grid" file in the output directory.
#
# o SAVE_BESTCHI: if anything else than "0", the models with a chi2
#   less than SAVE_BESTCHI different from the best chi2 will be
#   saved in a ".grid" file in the "best_chi2" directory, for each
#   object separately. This will occupy less disk space than the
#   SAVE_CHI_GRID option. Usual values are "1" to have 68% chance of
#   including the "true" model, "2.71" for 90% and "6.63" for 99%.
#   SAVE_CHI_GRID and SAVE_BESTCHI can be enabled together.
#
#-----------------------------------------------------------------------

SAVE_CHI_GRID  = 1          # 0 / 1
SAVE_BESTCHI   = 1          # 1 (68%) / 2.71 (90%) / 6.63 (99%) / etc

Here is the error I get while running the program:

❯ ./fast++ /Users/nikhilgaruda/Documents/Astronomy_Research/G165/fast/fast.param

note: this is FAST++ version '1.3.0-ecf74e2'
note: using instantaneous SFRs
note: applying Madau+1995 IGM absorption
note: computing SFH quantities: {tform50, tsf, past_sfr, tquench10, sfr10, brate10}
note: reading fluxes from '/Users/nikhilgaruda/Documents/Astronomy_Research/G165/fast/img_fam.cat'
note: using column translation file '/Users/nikhilgaruda/Documents/Astronomy_Research/G165/fast/img_fam.translate'
note: ... translated 16 column names
note: reading filters from '/Users/nikhilgaruda/Documents/Astronomy_Research/G165/Photometry/EAZYpy/eazy/data/filters/FILTER.RES.latest'
note: found 417 filters in the database, will use 8 of them
note: reading fluxes...
note: fitting 2 sources with 8 fluxes each
note: reading photometric redshifts from '/Users/nikhilgaruda/Documents/Astronomy_Research/G165/fast/img_fam.zout'
note: define grid...
note: fitting a grid of 599912 templates (ntau=4,nmetal=1,nage=41,nav=31,navbc=1,nz=118)
note: identify zspecs and redshift bounds in the grid...
note: initializing chi2 grid on disk... (expected size 77.8084 MB)
libc++abi: terminating due to uncaught exception of type std::length_error: vector
[1]    47262 abort      ./fast++ /Users/nikhilgaruda/Documents/Astronomy_Research/G165/fast/fast.para

custom SFH as a piecewise constant model

Hi, I'm wondering if it's possible to define a custom SFH using something similar to the piecewise constant model of Leja et al. 2019, section 2.1 and 2.2.1. Essentially the SFH is parameterized as a series of uncorrelated "bursts" with fixed time edges, where the SFR is constant between those time edges, creating a kind of step function.

Reading the available documentation, I'm not sure how I could go about doing this, as the SFR isn't exactly described by a smoothly varying function of time.

Any insight or help would be appreciated!

Parameter estimation

I am trying to fit a galaxy SED using fast but the code seems to not be able to estimate some parameter values correctly. For example the value which I get for Av is always equal to maximum or minimum possible value for Av. I attaching all the relevant files here.

fastfits.zip

Considering multiple metallicities

can I follow up on the new build regarding Z? :)

METAL = [0.004, 0.02, 0.05, 0.008]

In the past commit this would use all SSPs in this array, but now it seems it uses only the first value specified in the array.

Segmentation fault: 11 when using a set of models

Dear Corentin,

I'm running Fast++ on the photometry (with and without spectroscopy) for a single source with a simple set of standard parameters. When I run it with bc03 models, I encounter a "Segmentation fault: 11" error either while fitting or at the end, right after saving catalogs and best fits. This does not occur when I model the same galaxy with co11 models.
I've tried reducing the number of templates, excluding or including spectroscopy, fixing parameters, but the error keeps appearing.

I've refreshed the Fast++ installation, but the error keeps appearing.

Would you have any ideas of how to fix this?

Thank you in advance for your help!
Francesco

  1. Machine: macOS Big Sur (11.7.9)

  2. .param file: with bc03

#... FAST++ V1.2: parameter file .......................................


#--- GENERAL INFORMATION -----------------------------------------------
#
# Please read this parameter file in detail, you can find all relevant
# information here. Note that you have to adjust your input catalogs
# accordingly, otherwise FAST++ may not work properly!
#
# o Requirements:
#   - about 30 MB of free RAM memory
#   - at least one CPU core
#
# o The current directory should contain the following files:
#   - This parameter file
#   - [CATALOG].cat        If you fit broadband photometry
#   - [CATALOG].zout       If you input photometric redshifts
#   - [CATALOG].lir        If you input infrared luminosities
#   - [CATALOG].translate  If you input a translate file
#   - [SPECTRUM].spec      If you fit spectra
#
# o FAST++ runs from the command line.
#   The first argument is the parameter file. Default is 'fast.param'
#   $ fast++
#   $ fast++ my_fast.param
#
# o VERBOSE: set to 0 to disable output in the terminal (except for
#   warnings and errors, which are always shown)
#
# o PARALLEL: sets which part of the code should be executed in parallel.
#    - 'none': (default) no parallelization, the code will execute on
#      one CPU.
#    - 'generators': each model will be generated and adjusted to the
#      photometry in a separate thread. Good when you have a huge number
#      of models and very few galaxies to fit. Will fallback to 'models'
#      if a model cache exists.
#    - 'models': each model will be adjusted to the photometry in a
#      separate thread, but models are generated in the main thread only.
#      Good when you have many models and few galaxies to fit, or when
#      the models were already generated and cached on the disk.
#    - 'sources': the input catalog will be split into equal parts, and
#      each part will be analyzed in a separate thread. Good when you
#      have few models but lots of galaxies.
#
# o N_THREAD: sets the maximum number of threads the program can use at
#   once. This should be close to (or equal to) the number of available
#   cores on your CPU, or one less than the number of nodes available on a
#   cluster. Setting this to zero will disable parallelization.
#
# o MAX_QUEUED_FITS: sets the maximum number of fits that are queued and
#   waiting to be executed by the worker threads. Increasing this value
#   will make the code run faster, but will also increase memory usage.
#   For a run on a desktop computer with no more than 10 threads, a value
#   of 1000 provides a good compromise; larger values do not improve
#   performances significantly (no more than 10%).
#
#-----------------------------------------------------------------------

VERBOSE         = 1         # 0 / 1
PARALLEL        = 'generators'    # 'none', 'generators', 'models', or 'sources'
N_THREAD        = 4
MAX_QUEUED_FITS = 1000


#--- BROADBAND PHOTOMETRIC INFORMATION ---------------------------------
#
# o [CATALOG].cat (similar as for EAzY):
#   - Example catalog: hdfn_fs99.cat
#   - FAST++ recognizes columns with names {id,ID,z_spec,F[n],E[n],
#     TOT[n]} with n the number of the filter
#   - If z_spec is not given or any negative value, no z_spec is assumed
#   - Give a negative error or "NaN" if the object has no coverage in a
#     certain band
#
# o [CATALOG].zout (preferably generated with EAzY):
#   - Example catalog: hdfn_fs99.zout
#   - If NAME_ZPHOT is not defined, FAST reads columns with labels "z_phot"
#     as best-fit photometric redshifts "l68/l95/l99" and "h68/h95/h99"
#     for the confidence intervals
#   - If input photo-z is a negative value, the photo-z will be ignored
#   - If [CATALOG].zout is not available, and no z_specs are given in
#     [CATALOG].cat, then the redshifts are allowed to float
#   - You can also read in spectroscopic redshifts from [CATALOG].zout.
#     The corresponding column should be labeled "z_spec". However, if you
#     list them in [CATALOG].cat, FAST++ will ignore those in [CATALOG].zout
#
# o [CATALOG].translate:
#   - Example file: hdfn_fs99.translate
#   - Translates the column names in [CATALOG].cat to the required
#     F[n],E[n],etc formats
#   - Will only be used when available
#
# o AB_ZEROPOINT: m_AB = AB_ZEROPOINT - 2.5*log(F[n])
#   - Default: AB_ZEROPOINT = 23.9
#   - fluxes in micro Janskys: AB_ZEROPOINT = 23.9
#   - fluxes in erg sec^{-1} cm^{-2} Hz^{-1}: AB_ZEROPOINT = 48.6
#
# o FILTERS_RES: similar as for EAzY
#
# o FILTER_FORMAT: tells the program in the response curves provided in
#   filters_res file are determined for energy-counting (=0) or photon-
#   counting (=1) detectors (Default: 1)
#
# o TEMP_ERR_FILE: Template error function. The photometric errors are
#   in rest-frame multiplied by this function.
#
# o NAME_ZPHOT: Header name of the column in your [CATALOG].zout file
#   that you want to use for your photometric redshifts. If not defined,
#   FAST will look for 'z_phot'
#
# o FORCE_ZPHOT: if set to 1, tells the program to treat the photometric
#   redshifts as spectroscopic redshifts.
#
# o BEST_AT_ZPHOT: if set to 1, tells the program to force the best-fit
#   solution to match the photometric redshift obtained by EAzY, but the
#   confidence intervals will still account for the uncertainty on the
#   redshift (note that these intervals may not be centered on the best-
#   fit solution if this option is enabled).
#
# o ZPHOT_CONF: tells which confidence interval of the photometric
#   redshifts should be used to limit the grid for each galaxy.
#   Redshifts outside of this confidence interval will not be considered.
#
# o USE_LIR: if set to 1 and [CATALOG].lir exists, FAST++ will read
#   infrared luminosities from this file and use them to constrain the
#   fit. Must contain columns: id, lir and elir. The observed luminosities
#   (given in units of total solar luminosity) are compared to difference
#   of bolometric luminosity before and after dust attenuation is applied
#   to the models. This can help break degeneracies, but requires that
#   the redshift is well known.
#
#-----------------------------------------------------------------------

CATALOG        = 'psb'
AB_ZEROPOINT   = 23.9
FILTERS_RES    = 'FILTER.RES.latest'
FILTER_FORMAT  = 1
TEMP_ERR_FILE  = '/Users/fvalenti/bin/fastpp/share/TEMPLATE_ERROR.fast.v0.2'
NAME_ZPHOT     = 'z_phot'
FORCE_ZPHOT    = 1          # 0 / 1
BEST_AT_ZPHOT  = 0          # 0 / 1
ZPHOT_CONF     = 68         # 68 / 95 / 99
USE_LIR        = 0          # 0 / 1


#--- SPECTROSCOPIC INFORMATION -----------------------------------------
#
# o SPECTRUM:
#   - Example file: "1030_gnirs.spec"
#   - The file should have the following format:
#     # bin wl_low wl_low F[id1] E[id1] F[id2] E[id2] ...
#   - bin: ID of the bin in which the spectral element falls
#   - wl_low: lower wavelength of the spectral element in Angstrom
#   - wl_up: upper wavelength of the spectral element in Angstrom
#   - (e)fl: in 10^-19 ergs s-1 cm-2 Angstrom-1 (these units do not
#     matter if AUTO_SCALE is set to 1)
#   - id[.]: should be an ID in the flux catalog
#   - Missing values can be signaled with negative errors or "NaN".
#
# o AUTO_SCALE: This option automatically adjusts the spectrum to the
#   model separately from the rest of the photometry. The spectrum thus
#   does not participate in determining the best amplitude of the
#   model, but still participates in the chi2. This can account for
#   uncertain flux calibration of the spectrum, and will emphasize more
#   the features of the spectrum rather than its absolute flux level.
#   Note that when this feature is enabled, the template error function,
#   if used, will not be applied to the spectral data.
#
# o APPLY_VDISP: Velocity dispersion of the spectral templates. Setting
#   this parameter to a non-zero value will broaden the templates with
#   a fixed velocity dispersion before the fit. This is only relevant
#   when fitting spectra, and has an impact on performances (a couple
#   seconds of extra delay), so it is disabled by default.
#
#-----------------------------------------------------------------------

SPECTRUM =''
AUTO_SCALE     = 0          # 0 / 1
APPLY_VDISP    = 266          # km/s	; 300 km/s for the first run


#--- OUTPUT INFORMATION  -----------------------------------------------
#
# o OUTPUT_DIR: output directory for results
#
# o OUTPUT_FILE: output file for results.
#   If not given: [CATALOG]_[SPECTRUM].fout
#
# o N_SIM: The number of Monte Carlo simulations used to determine the
#   confidence levels. If zero or not defined, only best-fit values will
#   be given.
#
# o C_INTERVAL: Percentage of confidence intervals, choose from 68% (1
#   sigma), 95% (2 sigma), or 99% (3 sigma)
#
# o BEST_FIT: output best-fit SPS model in the 'best_fits' directory
#
# o BEST_FROM_SIM: use the median of the Monte Carlo simulation as
#   best-fit instead of the model with the smallest chi squared on
#   the original (unperturbed) photometry.
#
# o SAVE_SIM: save the best-fit parameters for each Monte Carlo
#   simulation for all sources in the "best_fits" directory.
#
# o SFR_AVG: output the SFR as the average of the 'SFR_AVG' last million
#   years. If set to zero (the default) FAST++ will output the
#   instantaneous SFR.
#
# o INTRINSIC_BEST_FIT: if BEST_FIT=1, setting this option to 1 will also
#   output the intrinsic best-fit SED of the galaxy, as it would be seen
#   without dust obscuration. This intrinsic SED is saved as a third
#   column in the best-fit SED file.
#
# o BEST_SFHS: if set to 1, the program will output the best-fit star
#   formation history along with the best fit SEDs. If Monte Carlo
#   simulations are enabled, the confidence intervals of the SFH will
#   also be written.
#
# o SFH_OUTPUT_STEP: if BEST_SFHS=1, sets the time step of the output SFH
#   in million years. The default is 10 Myr.
#
# o SFH_OUTPUT: 'sfr' will output the evolution of the star formation rate
#   with time, while 'mass' will show the total stellar mass (including
#   mass loss).
#
# o REST_MAG: list of filter ID to use to compute rest-frame magnitudes.
#   These absolute magnitudes are then given at 10pc in the AB system,
#   using AB_ZEROPOINT, and are not corrected for attenuation.
#
# o CONTINUUM_INDICES: file listing the continuum indices (absorption
#   line equivalent-width, Dn4000, ...) to compute from each model
#   spectrum. See examples in the "share/continuum_indices" directory.
#
# o SFH_QUANTITIES: list of SFH quantities to compute for each model.
#   These quantities are computed directly on the SFH functional form
#   of each model, and are thus non-parametric. Available quantites:
#    - 'tsf': shortest time interval over which 68% of SFR took place
#             (= duration of star formation).
#    - 'past_sfr': average SFR during the above time interval
#                  (= mean past SFR).
#    - 'sfr'X : average SFR over the last 'X' Myr.
#    - 'brate'X : 'sfr'X / 'past_sfr' (= birth-rate parameter).
#    - 'tquench'X : elapsed time since the SFR dropped below a factor
#                   'X' of the 'past_sfr' (= time since quenching).
#    - 'tform'X : elapsed time since the galaxy had formed 'X'% of its
#                 current mass (= time since formation).
#
# o OUTPUT_COLUMNS: define here what columns to write in [CATALOG].fout
#   Available columns: id, metal, lage, Av, lmass, lsfr, lssfr, lldust,
#   llion, lmform and chi2. If using the "standard" FAST templates, two
#   additional columns are available: ltau and la2t. If using custom SFH,
#   you can also choose any of your custom SFH parameter. Rest-frame
#   magnitudes specified in 'REST_MAG' are also available, the format is
#   "M[...]" where "[...]" is the filter ID. By default all available
#   parameters are written in the file (except lldust, llion, and lmform).
#
# o OUTPUT_PRECISION: define the numerical precision to use when printing
#   values in the output catalog. The default (0) means to use the
#   standard precision, which is 1e-4 for the redshift and metallicity,
#   and 1e-2 for everything else. If set to any other power of ten
#   between zero and one (excluded), this value will be used to round
#   the outputs. Note, this only affects the output catalog (.fout);
#   all other outputs (including grid files) are always stored in full
#   precision.
#
#-----------------------------------------------------------------------

OUTPUT_DIR         = 'delayed/bc03_ch/'
OUTPUT_FILE        = ''
N_SIM              = 100
C_INTERVAL         = [68,90,95]            # 68 / 95 / 99 or [68,95] etc
BEST_FIT           = 1             # 0 / 1
BEST_FROM_SIM      = 0             # 0 / 1
SAVE_SIM           = 1             # 0 / 1
SFR_AVG            = 10             # 0, 100 Myr, 300 Myr etc
INTRINSIC_BEST_FIT = 0             # 0 / 1
BEST_SFHS          = 1             # 0 / 1
SFH_OUTPUT_STEP    = 10            # 10 Myr, 100 Myr etc
SFH_OUTPUT         = 'sfr'         # 'sfr' or 'mass'
REST_MAG           = [140,142,161,153,155,121,81,414,415,416]            # [140,142,161] for UVJ colors
CONTINUUM_INDICES  = ''
SFH_QUANTITIES     = ['tsf','past_sfr','sfr10','tquench10','tform50','brate10']            # ['tquench10','tform50','brate10',...]
OUTPUT_COLUMNS     = ['id','z','ltau','lage','av','lmass','lsfr','lssfr','lldust','lscale','sscale','chi2','tsf','past_sfr','sfr10','tquench10','tform50','brate10','M140','M142','M153','M155','M161','M121','M81','M414','M415','M416','metal']            # ['id','Av','lmass','lsfr', ...]
OUTPUT_PRECISION   = 0             # 0 / 0.01 / 0.0001 / 1e-6


#--- CHOOSE STELLAR POPULATIONS LIBRARY --------------------------------
#
# o LIBRARY_DIR: directory containing the stellar population libraries
#   of the form: ised_[SFH].[resolutions].
#   The binaries in these directories are of the following form:
#   [library]_[resolution]_[imf]_z[metallicity]_ltau[ltau/yr].ised
#
# o All binary inputs are made using "csp_galaxev"
#   ("galaxev" software by Bruzual & Charlot 2003) on the SSP models
#   "bc2003_[RESOLUTION]_[metal]_[IMF]_ssp.ised" and assuming no dust
#   law (and no recycling of gas ejected by stars for exponentially
#   declining star formation history)
#
# o LIBRARY: choose from Bruzual & Charlot 2003 ('bc03'),
#   Maraston 2005 ('ma05'), and FSPS by Conroy et al. ('co11')
#
# o RESOLUTION: Choose 'hr' for spectral fitting, and 'pr' (photometric
#   resolution) or 'lr' for medium and broadband filters. Not all
#   resolutions are standard available for all SFHs or libraries or IMFs
#
# o IMF (stellar initial mass function), choose from
#   - 'ch'(abrier)
#   - 'sa'(lpeter)
#   - 'kr'(oupa)
#
# o SFH: parametrization of the star formation history (SFH), choose from
#   - 'exp': exponentially declining SFH; sfr ~ exp(-t/tau)
#   - 'del': delayed exponentially declining SFH; sfr ~ t exp(-t/tau)
#   - 'tru': truncated SFH, with constant star formation between
#            t_onset and t_onset+tau
#   For all SFH you can specify the range tau in the grid
#
# o DUST_LAW: parametrization of the dust attenuation curve. You can
#   choose from the following options
#   - 'calzetti': Calzetti (2000) dust law
#   - 'mw': Milky Way, following parametrization by Cardelli et al. (1989)
#   - 'kc': Kriek & Conroy (2013). Average dust law. We use the
#      parametrization by Noll et al. with E_B = 1 and delta = -0.1
#   - 'noll': For this law you have to parametrize E_b and delta.
#      You can only pick one value for each, arrays are not allowed.
#
# o MY_SFH: if you define this option, FAST++ will not fit a range of
#   star-formation histories, but just one model (so LOG_TAU_XXX will
#   be ignored). For this option you can only read in one custom star
#   formation history, for which you have to make the ISED file
#   yourself using "csp_galaxev". The naming of the ised file has to
#   be as follows:
#   [library]_[resolution]_[imf]_z[metallicity]_[MY_SFH].ised
#   This file needs to be placed directly in 'LIBRARY_DIR'
#
# o CUSTOM_SFH: if you define this option, FAST++ will build a grid of
#   templates on the fly using SSP models, instead of reading the
#   composite models from "csp_galaxev". You can therefore fit any
#   star formation history. The SFH must be a mathematical expression
#   which returns the SFR as a function of the time 't' since the galaxy
#   was born (the unit of the SFR doest not matter). Custom grid parameters
#   can be referenced in this function (see below) but not the age or the
#   dust attenuation.
#
# o CUSTOM_PARAMS: when using CUSTOM_SFH, define here the names of your
#   grid parameters (e.g., log_tau). For each of these parameters you
#   must provide the _MIN, _MAX and _STEP values, as for the other
#   grid parameters.
#
# o CUSTOM_SFH_LOOKBACK: changes the meaning of the time 't' in the SFH
#   expression, so that 't' refers to the lookback time. The instant t=0
#   then refers to the moment where the galaxy is observed, and larger
#   values correspond to earlier times in the past. This is equivalent
#   to substituting 't' for '10^lage - t' in the SFH expression.
#
#-----------------------------------------------------------------------

LIBRARY_DIR         = '/Users/fvalenti/bin/fastpp/share/libraries/'
LIBRARY             = 'bc03'         # 'bc03' / 'ma05' / 'co11'
RESOLUTION          = 'hr'           # 'pr' / 'lr' / 'hr'
IMF                 = 'ch'           # 'ch' / 'sa' / 'kr'
SFH                 = 'del'          # 'exp' / 'del' / 'tru'
DUST_LAW            = 'kc'     # 'calzetti' / 'mw' / 'kc' / 'noll'
MY_SFH              = ''

#--- DEFINE GRID -------------------------------------------------------
#
# o Choose only values for tau and metallicity that are in your library.
#   Otherwise extend your library.
#
# o If EAzY is used, make sure Z_MIN, Z_MAX are similar.
#
# o METAL: the options differ per stellar population library
#   ma05: Z=0.001, Z=0.01, Z=0.02 [solar], and Z=0.04
#   bc03: Z=0.004, Z=0.008, Z=0.02 [solar], and Z=0.05
#   co11: Z=0.0008, Z=0.0031, Z=0.0096, Z=0.019 [solar], and Z=0.03
#   You can choose more than one by defining an array.
#
# o If a grid has already been made for a specific LIBRARY, RESOLUTION,
#   IMF, tau, age, z, A_v, A_v_bc, metallicity, and filter set and/or
#   spectral elements, the grid will be automatically read from the cache
#   unless the NO_CACHE option is set to "1". This option will also
#   prevent the code from writing this cache in the first place.
#
# o DIFFERENTIAL_A_V: By default (0), all stars suffer the same amount
#   of extinction by dust. If DIFFERENTIAL_A_V is set to "1", young
#   stars will be place under a thicker screen of dust, as controlled by
#   A_V_BC_MIN, A_V_BC_MAX, A_V_BC_STEP, and LOG_BC_AGE_MAX.
#
# o LOG_BC_AGE_MAX: When DIFFERENTIAL_A_V is set to "1", stars in their
#   birth cloud will be given extra attenuation. Only stars younger than
#   LOG_BC_AGE_MAX are considered to be in their birthcloud. The default
#   of 10 Myr is taken from Charlot&Fall (2001).
#
# o NO_MAX_AGE: By default (0), ages that exceed the age of the universe
#   are not allowed. However, when NO_MAX_AGE is put to "1" you can have
#   older ages.
#
#-----------------------------------------------------------------------

LOG_TAU_MIN    = 6.5            # log [yr]
LOG_TAU_MAX    = 10.            # log [yr]
LOG_TAU_STEP   = 0.1            # log [yr], min 0.1
LOG_AGE_MIN    = 6.5            # log [yr]; 
LOG_AGE_MAX    = 9.2      	# log [yr]; max age universe
LOG_AGE_STEP   = 0.1            # log [yr]
NO_MAX_AGE     = 0              # 0 / 1
Z_MIN          = 4.1045            # Cannot be 0.0
Z_MAX          = 4.1085
Z_STEP         = 0.001
Z_STEP_TYPE    = 0              # 0: Z_STEP, 1: Z_STEP*(1+z)
A_V_MIN        = 0.0            # [mag]
A_V_MAX        = 1.0            # [mag]
A_V_STEP       = 0.1            # [mag]
A_V_BC_MIN       = 0.             # [mag]
A_V_BC_MAX       = 0.             # [mag]
A_V_BC_STEP      = 0.1            # [mag]
DIFFERENTIAL_A_V = 0              # 0 / 1
LOG_BC_AGE_MAX   = 7.0            # log [yr]
METAL          = [0.02] # BC  [0.008,0.02,0.05] 
NO_CACHE       = 0             # 0 / 1


#--- COSMOLOGY ---------------------------------------------------------
#
#-----------------------------------------------------------------------

H0             = 70.0               # Hubble constant
OMEGA_M        = 0.3                # Omega matter
OMEGA_L        = 0.7                # Omega lambda


#--- SAVE INTERMEDIATE PRODUCTS ----------------------------------------
#
# o SAVE_CHI_GRID: if "1" then the chi2 grid for all objects will be
#   saved in a ".grid" file in the output directory.
#
# o SAVE_BESTCHI: if anything else than "0", the models with a chi2
#   less than SAVE_BESTCHI different from the best chi2 will be
#   saved in a ".grid" file in the "best_chi2" directory, for each
#   object separately. This will occupy less disk space than the
#   SAVE_CHI_GRID option. Usual values are "1" to have 68% chance of
#   including the "true" model, "2.71" for 90% and "6.63" for 95%.
#   SAVE_CHI_GRID and SAVE_BESTCHI can be enabled together.
#
#-----------------------------------------------------------------------

SAVE_CHI_GRID  = 0          # 0 / 1
SAVE_BESTCHI   = 1       # 1 (68%) / 2.71 (90%) / 3.84 (95%) / 6.63 (99%) / etc
  1. Error:
note: this is FAST++ version '1.5.0-dfac27f'
note: averaging SFRs over 10 Myr
note: applying Madau+1995 IGM absorption
note: convolving templates with sigma=266 km/s
note: computing SFH quantities: {tform50, tsf, past_sfr, tquench10, sfr10, brate10}
note: reading fluxes from 'psb.cat'
note: using column translation file 'psb.translate'
note: ... translated 16 column names
note: reading filters from 'FILTER.RES.latest'
note: found 416 filters in the database, will use 8 of them
note: ... plus 10 for rest-frame magnitudes
note: reading fluxes...
note: fitting 1 source with 8 fluxes
note: apply template library error function to photometry '/Users/fvalenti/bin/fastpp/share/TEMPLATE_ERROR.fast.v0.2'
note: define grid...
note: fitting a grid of 55440 templates (ntau=36,nmetal=1,nage=28,nav=11,navbc=1,nz=5)
note: cache file is 'delayed/bc03_ch/bc03_hr_ch_del_kc_dfe63a61ac9a9db8b24a76a4028755bab26660f4.grid'
note: initializing template error function...
note: identify zspecs and redshift bounds in the grid...
note: start fitting...
[--------------------------------] 55441 100%, 7s elapsed, 0ns left, 7s total             
note: finding best fits...
note: saving catalog
note: saving best fits
Segmentation fault: 11

Investigating best-fit SEDs

The INTRINSIC_BEST_FIT option is expected to output a text file with wavelength, best-fit SED, and intrinsic best-fit SED. However, fl and fl_nodust are both the same and it looks like it is the intrinsic SED that is getting attributed to both the columns here.

Question: How to access the scaling factor for the spectra in the grid file?

Hello, I am doing a combined fit of photometry and spectrum for a galaxy. I set AUTO_SCALE to 1 and SAVE_CHI_GRID to 1 but I don't seem to find the scaling factor in FITS file after converting the grid to .FITS.

This was the output I got after using the convert script provided:

found 1 galaxies, with 42 properties, 6 grid parameters and 674016 models
grid names: z, Av, Av_bc, lage, metal, ltau
prop names: lscale, sscale, lmass, lsfr, lssfr, lldust, lldust_bc, llion, lmform, la2t, CN_1, CN_2, Ca4227, G4300, Fe4383, Ca4455, Fe4531, Fe4668, Hbeta, Fe5015, Mg_1, Mg_2, Mg_b, Fe5270, Fe5335, Fe5406, Fe5709, Fe5782, Na_D, TiO_1, TiO_2, Hdelta_A, Hgamma_A, Hdelta_F, Hgamma_F, Halpha, tsf, past_sfr, sfr10, sfr50, brate10, brate50
[--------------------------------] 28982688 100%, 104ms elapsed, 0ns left, 104ms total  

Can you please tell me where the scaling factor is located at? Or is it something we will need to extrapolate somehow?

Unavailable library ised_exp.pr

When I run FAST++, I get the following error:

error: could not read data in library file '~/Software/fastpp/share/libraries/ised_exp.pr/bc03_pr_ch_z02_ltau7.0.ised'
error: could not open file
error: the file is probably corrupted, try re-downloading it

The libraries available from Mariska Kriek's website are ised_del.lr, ised_del.hr, ised_tru.hr, and ised_exp.hr, but there is no ised_exp.pr as far as I can tell.

Getting error while running "make install"

Hello,

I am trying to install fast++ on my mac, which has an updated XCode, C++ compiler, git, and CMake. However, while I run the "make install" command, I get an error saying :

".../fastpp/external/cfitsio/group.c:5476:3: error: implicit declaration of function 'getcwd' is invalid in C99 [-Werror,-Wimplicit-function-declaration]"

I wonder whether this error is related to any incompatibility between the recent Mac version (macOS 11.4) and the current fast++ code or there is an issue with my installations.

Any help on this is really appreciated!

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.