From a97f59b2068f13f654068f7766ef07213064076a Mon Sep 17 00:00:00 2001 From: caes Date: Wed, 9 Aug 2017 22:37:20 -0400 Subject: [PATCH] almost working --- src/sed.hpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/sed.hpp b/src/sed.hpp index 3fa43b7..c6aeb51 100644 --- a/src/sed.hpp +++ b/src/sed.hpp @@ -50,6 +50,7 @@ public: _power(slope), _normal((log(x0.second)-(_power*log(x0.first)))) {} + double eval(double hnu) { return 0; } }; class sed { @@ -165,6 +166,7 @@ agn::sed_powerlaw_spline::sed_powerlaw_spline( std::vector x1; // powerlaws are evaluated across four regions of the sed, first + // we construct the powerlaws, here, and locate them iterator1d table_it = powerlaw_coords.table.begin(); double ir_power = 3; coord2d ir_high_point = *table_it; table_it++; @@ -179,10 +181,30 @@ agn::sed_powerlaw_spline::sed_powerlaw_spline( _xray_powerlaw = powerlaw(xray_low_point,xray_high_point); _gamma_powerlaw = powerlaw(gamma_low_point,gamma_power); - ir_bounds= + double ir_lowerbound = agn::CLOUDY_MIN_EV; + double ir_upperbound = ir_high_point.first; + double uv_lowerbound = uv_low_point.first; + double uv_upperbound = uv_high_point.first; + double xray_lowerbound = xray_low_point.first; + double xray_upperbound = xray_high_point.first; + double gamma_lowerbound = gamma_low_point.first; + double gamma_upperbound = agn::CLOUDY_MAX_EV; - for (int i=0; i<10; i++) { - _ir_powerlaw.eval() + // here we inject the powerlaws into the samples + int segments=10; + for (int i=0; i<=segments; i++) { + double hnu = + ir_lowerbound + + (i/segments)*(ir_upperbound-ir_lowerbound); + double value = _ir_powerlaw.eval(hnu); + coord2d point = coord2d(hnu,value); + samples.table.insert(point); + } + + if(agn::debug) { + std::cout + << "[Constructor] Samples after evaluating powerlaws: \n"; + std::cout << agn::format_sed_table(samples); } // load all samples into coordinate vectors