@@ -60,6 +60,11 @@ int phypp_main(int argc, char* argv[]) {
60
60
bool no_dust = false ; // do not generate fluxes from dust origin
61
61
bool no_random = false ; // disable all randomization of parameters
62
62
// (just passive, M*, z, and position + pos angle)
63
+
64
+ // Approximations
65
+ bool naive_igm = false ; // use a fixed IGM absorption for all galaxies (faster)
66
+
67
+
63
68
// Debug - testing
64
69
bool no_passive_lir = false ; // do not generate dust for passive galaxies
65
70
bool magdis_tdust = false ; // use Magdis+12 Tdust evolution (lower)
@@ -75,7 +80,7 @@ int phypp_main(int argc, char* argv[]) {
75
80
76
81
// SED libraries
77
82
std::string ir_lib_file = egg_share_dir+" ir_lib_cs17.fits" ;
78
- std::string opt_lib_file = egg_share_dir+ " opt_lib_fast.fits " ;
83
+ std::string opt_lib_file;
79
84
80
85
// Filter library
81
86
std::string filter_db_file = filters_dir+" db.dat" ;
@@ -127,7 +132,7 @@ int phypp_main(int argc, char* argv[]) {
127
132
verbose, name (tseed, " seed" ), name (tcosmo, " cosmo" ),
128
133
name (input_cat_file, " input_cat" ), selection_band, bands, rfbands, help, list_bands,
129
134
clust_r0, clust_r1, clust_lambda, clust_eta, clust_fclust_mlim, clust_fclust_lom,
130
- clust_fclust_him, clust_urnd_mlim, magdis_tdust
135
+ clust_fclust_him, clust_urnd_mlim, magdis_tdust, naive_igm
131
136
));
132
137
133
138
if (help) {
@@ -249,6 +254,14 @@ int phypp_main(int argc, char* argv[]) {
249
254
}
250
255
}
251
256
257
+ if (opt_lib_file.empty ()) {
258
+ if (naive_igm) {
259
+ opt_lib_file = egg_share_dir+" opt_lib_fast.fits" ;
260
+ } else {
261
+ opt_lib_file = egg_share_dir+" opt_lib_fast_noigm.fits" ;
262
+ }
263
+ }
264
+
252
265
// Initialize random seed and cosmology
253
266
// ------------------------------------
254
267
auto seed = make_seed (tseed);
@@ -1582,6 +1595,47 @@ if (!no_flux) {
1582
1595
bulge, disk
1583
1596
};
1584
1597
1598
+ auto apply_igm = [&](double z, const vec1f& lam, vec1f& sed) {
1599
+ // http://adsabs.harvard.edu/abs/1995ApJ...441...18M
1600
+ // TODO: check this implementation someday, I suspect this is wrong or
1601
+ // very approximate (taken directly from FAST)
1602
+
1603
+ double da; {
1604
+ double l0 = 1050.0 *(1.0 + z);
1605
+ double l1 = 1170.0 *(1.0 + z);
1606
+ uint_t nstep = 100 ;
1607
+ vec1d tl = rgen (l0, l1, nstep);
1608
+ vec1d ptau = exp (-3.6e-3 *pow (tl/1216.0 , 3.46 ));
1609
+ da = total (ptau)*(l1-l0)/nstep/(120.0 *(1.0 + z));
1610
+ }
1611
+
1612
+ double db; {
1613
+ double l0 = 920.0 *(1.0 + z);
1614
+ double l1 = 1015.0 *(1.0 + z);
1615
+ uint_t nstep = 100 ;
1616
+ vec1d tl = rgen (l0, l1, nstep);
1617
+ vec1d ptau = exp (-1.7e-3 *pow (tl/1026.0 , 3.46 ) - 1.2e-3 *pow (tl/972.5 , 3.46 ) -
1618
+ 9.3e-4 *pow (tl/950.0 , 3.46 ));
1619
+ db = total (ptau)*(l1-l0)/nstep/(95.0 *(1.0 + z));
1620
+ }
1621
+
1622
+ uint_t l0 = lower_bound (lam, 0.0921 );
1623
+ uint_t l1 = lower_bound (lam, 0.1026 );
1624
+ uint_t l2 = lower_bound (lam, 0.1216 );
1625
+
1626
+ for (uint_t l : range (l0)) {
1627
+ sed.safe [l] = 0 ;
1628
+ }
1629
+ for (uint_t l : range (l0, l1)) {
1630
+ sed.safe [l] *= db;
1631
+ }
1632
+ for (uint_t l : range (l1, l2)) {
1633
+ sed.safe [l] *= da;
1634
+ }
1635
+
1636
+ return lam;
1637
+ };
1638
+
1585
1639
auto get_flux = [&](const vec1f& m, const vec1u& optsed, vec2f& flux, vec2f& rfmag,
1586
1640
bool no_ir, component cmp) {
1587
1641
@@ -1606,6 +1660,11 @@ if (!no_flux) {
1606
1660
merge_add (orlam, irlam, orsed, irsed, rlam, rsed);
1607
1661
}
1608
1662
1663
+ // Apply IGM absorption
1664
+ if (!naive_igm && !no_stellar) {
1665
+ apply_igm (out.z [i], rlam, rsed);
1666
+ }
1667
+
1609
1668
// Obtain rest-frame magnitudes
1610
1669
if (!rffilters.empty ()) {
1611
1670
// Redshift the SED @ 10pc
@@ -1755,7 +1814,7 @@ void print_help() {
1755
1814
}
1756
1815
};
1757
1816
1758
- print (" egg-gencat v1.0.9 " );
1817
+ print (" egg-gencat v1.1.0 " );
1759
1818
print (" usage: egg-gencat [options]\n " );
1760
1819
1761
1820
print (" List of generic options:" );
@@ -1797,6 +1856,11 @@ void print_help() {
1797
1856
" fully deterministic recipes" );
1798
1857
print (" " );
1799
1858
1859
+ print (" List of approximations:" );
1860
+ argdoc (" naive_igm" , " [flag]" , " use a fixed IGM absorption for all galaxies instead of using "
1861
+ " a redshift-dependent prescription." );
1862
+ print (" " );
1863
+
1800
1864
print (" List of sky position related options:" );
1801
1865
argdoc (" ra0" , " [double, degrees]" , " sky position of the center of the field "
1802
1866
" (right ascension, default: 53.558750)" );
0 commit comments