@@ -360,11 +360,12 @@ int phypp_main(int argc, char* argv[]) {
360360 struct {
361361 vec3f lam, sed;
362362 vec2b use;
363+ vec2f av;
363364 vec2f bvj, buv;
364365 } opt_lib;
365366
366367 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
368369 ));
369370
370371 // Make sure that it contains at least one valid SED
@@ -395,6 +396,7 @@ int phypp_main(int argc, char* argv[]) {
395396 vec1f disk_angle, disk_radius, disk_ratio;
396397 vec1f bulge_angle, bulge_radius, bulge_ratio;
397398 vec1f bt, m_disk, m_bulge;
399+ vec1f av_disk, av_bulge;
398400
399401 vec1f tdust, ir8, fpah, mdust;
400402
@@ -489,11 +491,13 @@ int phypp_main(int argc, char* argv[]) {
489491 vj += 0.2 *max ((0.5 - z)/0.5 , 0.0 );
490492 };
491493
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) {
493495 uint_t snb = opt_lib.buv .dims [1 ];
494496
495497 sed.resize (uv.size ());
498+ av.resize (uv.size ());
496499 sed[_] = npos;
500+ av[_] = fnan;
497501
498502 auto pg = progress_start (snb*snb);
499503 for (uint_t u : range (snb)) {
@@ -515,6 +519,7 @@ int phypp_main(int argc, char* argv[]) {
515519 // Assign the SED to these galaxies
516520 uint_t ised = flat_id (opt_lib.use , lu, lv);
517521 sed[idl] = ised;
522+ av[idl] = opt_lib.av [ised];
518523 }
519524
520525 if (doprint) progress (pg);
@@ -756,7 +761,8 @@ int phypp_main(int argc, char* argv[]) {
756761 gen_blue_uvj (tmx, tzx, tuvx, tvjx, true );
757762 // Then find the corresponding SED in the library
758763 vec1u tsx;
759- get_sed_uvj (tuvx, tvjx, tsx, false );
764+ vec1f tav;
765+ get_sed_uvj (tuvx, tvjx, tsx, tav, false );
760766 // And estimate the flux in the selection band
761767 double mlcor = get_m2l_cor (tz);
762768 vec1d tflx (tmx.dims );
@@ -1363,16 +1369,18 @@ if (!no_stellar) {
13631369 note (" assigning optical SEDs..." );
13641370 }
13651371
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)) {
13671373 return 1 ;
13681374 }
13691375
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)) {
13711377 return 1 ;
13721378 }
13731379} else {
13741380 out.opt_sed_bulge = replicate (npos, ngal);
13751381 out.opt_sed_disk = replicate (npos, ngal);
1382+ out.av_bulge = replicate (fnan, ngal);
1383+ out.av_disk = replicate (fnan, ngal);
13761384}
13771385
13781386 // Generate IR properties
@@ -1705,7 +1713,7 @@ if (!no_flux) {
17051713 out.sfr , out.rsb , out.m2lcor ,
17061714 out.disk_angle , out.disk_radius , out.disk_ratio ,
17071715 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 ,
17091717 out.rfuv_bulge , out.rfuv_disk , out.rfvj_bulge , out.rfvj_disk ,
17101718 out.sfrir , out.sfruv , out.irx , out.lir , out.ir_sed ,
17111719 out.opt_sed_bulge , out.opt_sed_disk ,
0 commit comments