@@ -360,11 +360,12 @@ int phypp_main(int argc, char* argv[]) {
360
360
struct {
361
361
vec3f lam, sed;
362
362
vec2b use;
363
+ vec2f av;
363
364
vec2f bvj, buv;
364
365
} opt_lib;
365
366
366
367
fits::read_table (opt_lib_file, ftable (
367
- opt_lib.lam , opt_lib.sed , opt_lib.use , opt_lib.bvj , opt_lib.buv
368
+ opt_lib.lam , opt_lib.sed , opt_lib.use , opt_lib.av , opt_lib. bvj , opt_lib.buv
368
369
));
369
370
370
371
// Make sure that it contains at least one valid SED
@@ -395,6 +396,7 @@ int phypp_main(int argc, char* argv[]) {
395
396
vec1f disk_angle, disk_radius, disk_ratio;
396
397
vec1f bulge_angle, bulge_radius, bulge_ratio;
397
398
vec1f bt, m_disk, m_bulge;
399
+ vec1f av_disk, av_bulge;
398
400
399
401
vec1f tdust, ir8, fpah, mdust;
400
402
@@ -489,11 +491,13 @@ int phypp_main(int argc, char* argv[]) {
489
491
vj += 0.2 *max ((0.5 - z)/0.5 , 0.0 );
490
492
};
491
493
492
- auto get_sed_uvj = [&opt_lib](const vec1f& uv, const vec1f& vj, vec1u& sed, bool doprint) {
494
+ auto get_sed_uvj = [&opt_lib](const vec1f& uv, const vec1f& vj, vec1u& sed, vec1f& av, bool doprint) {
493
495
uint_t snb = opt_lib.buv .dims [1 ];
494
496
495
497
sed.resize (uv.size ());
498
+ av.resize (uv.size ());
496
499
sed[_] = npos;
500
+ av[_] = fnan;
497
501
498
502
auto pg = progress_start (snb*snb);
499
503
for (uint_t u : range (snb)) {
@@ -515,6 +519,7 @@ int phypp_main(int argc, char* argv[]) {
515
519
// Assign the SED to these galaxies
516
520
uint_t ised = flat_id (opt_lib.use , lu, lv);
517
521
sed[idl] = ised;
522
+ av[idl] = opt_lib.av [ised];
518
523
}
519
524
520
525
if (doprint) progress (pg);
@@ -756,7 +761,8 @@ int phypp_main(int argc, char* argv[]) {
756
761
gen_blue_uvj (tmx, tzx, tuvx, tvjx, true );
757
762
// Then find the corresponding SED in the library
758
763
vec1u tsx;
759
- get_sed_uvj (tuvx, tvjx, tsx, false );
764
+ vec1f tav;
765
+ get_sed_uvj (tuvx, tvjx, tsx, tav, false );
760
766
// And estimate the flux in the selection band
761
767
double mlcor = get_m2l_cor (tz);
762
768
vec1d tflx (tmx.dims );
@@ -1363,16 +1369,18 @@ if (!no_stellar) {
1363
1369
note (" assigning optical SEDs..." );
1364
1370
}
1365
1371
1366
- if (!get_sed_uvj (out.rfuv_bulge , out.rfvj_bulge , out.opt_sed_bulge , verbose)) {
1372
+ if (!get_sed_uvj (out.rfuv_bulge , out.rfvj_bulge , out.opt_sed_bulge , out. av_bulge , verbose)) {
1367
1373
return 1 ;
1368
1374
}
1369
1375
1370
- if (!get_sed_uvj (out.rfuv_disk , out.rfvj_disk , out.opt_sed_disk , verbose)) {
1376
+ if (!get_sed_uvj (out.rfuv_disk , out.rfvj_disk , out.opt_sed_disk , out. av_disk , verbose)) {
1371
1377
return 1 ;
1372
1378
}
1373
1379
} else {
1374
1380
out.opt_sed_bulge = replicate (npos, ngal);
1375
1381
out.opt_sed_disk = replicate (npos, ngal);
1382
+ out.av_bulge = replicate (fnan, ngal);
1383
+ out.av_disk = replicate (fnan, ngal);
1376
1384
}
1377
1385
1378
1386
// Generate IR properties
@@ -1705,7 +1713,7 @@ if (!no_flux) {
1705
1713
out.sfr , out.rsb , out.m2lcor ,
1706
1714
out.disk_angle , out.disk_radius , out.disk_ratio ,
1707
1715
out.bulge_angle , out.bulge_radius , out.bulge_ratio ,
1708
- out.bt , out.m_disk , out.m_bulge , out.passive ,
1716
+ out.bt , out.m_disk , out.m_bulge , out.av_disk , out. av_bulge , out. passive ,
1709
1717
out.rfuv_bulge , out.rfuv_disk , out.rfvj_bulge , out.rfvj_disk ,
1710
1718
out.sfrir , out.sfruv , out.irx , out.lir , out.ir_sed ,
1711
1719
out.opt_sed_bulge , out.opt_sed_disk ,
0 commit comments