mirror of
https://asciireactor.com/otho/cloudy-agn.git
synced 2024-12-05 02:15:09 +00:00
sed success!
This commit is contained in:
parent
43dd15864a
commit
ba16e5e194
@ -1,8 +1,9 @@
|
||||
0.0003 0.002
|
||||
#0.001 0.007
|
||||
#0.0003 0.002
|
||||
0.001 0.0072
|
||||
0.008 0.04
|
||||
0.012 0.044
|
||||
0.03 0.025
|
||||
#0.03 0.025
|
||||
0.44 0.024
|
||||
2.1 0.012
|
||||
60.0 0.029
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
12.00 -9
|
||||
0.0004 3.2e10
|
||||
0.006 4.9e13
|
||||
.4 2.2e13
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
namespace agn {
|
||||
|
||||
const bool debug = true;
|
||||
const bool debug = false;
|
||||
const bool line_debug = false;
|
||||
const bool verbose=true;
|
||||
|
||||
|
44
src/sed.hpp
44
src/sed.hpp
@ -37,6 +37,11 @@ struct sed_table {
|
||||
|
||||
// To account for the four main powerlaws in a typical
|
||||
// AGN SED.
|
||||
|
||||
// Hardcoded infrared and gamma ray power laws.
|
||||
const double IR_POWER = 3;
|
||||
const double GAMMA_POWER = -2;
|
||||
|
||||
struct powerlaw_bounds {
|
||||
double ir_min;
|
||||
double ir_max;
|
||||
@ -183,10 +188,8 @@ agn::sed_powerlaw_spline::sed_powerlaw_spline(
|
||||
// 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 = (*table_it).first;
|
||||
double gamma_power = (*table_it).second;
|
||||
std::cout << ir_power << ", " << gamma_power;
|
||||
table_it++;
|
||||
double ir_power = agn::IR_POWER;
|
||||
double gamma_power = agn::GAMMA_POWER;
|
||||
coord2d ir_high_point = *table_it; table_it++;
|
||||
coord2d uv_low_point = *table_it; table_it++;
|
||||
coord2d uv_high_point = *table_it; table_it++;
|
||||
@ -385,34 +388,17 @@ double agn::sed_pow_law::SED_at_2KeV() {
|
||||
|
||||
agn::sed_table agn::read_sed_table(std::ifstream& table_file) {
|
||||
sed_table resultant;
|
||||
std::string scratch;
|
||||
std::string line;
|
||||
double hnu;
|
||||
std::getline(table_file,scratch);
|
||||
if(!isdigit(scratch[0])) {
|
||||
resultant.header = scratch;
|
||||
if(!isdigit(table_file.peek()) && table_file.peek() != '#') {
|
||||
std::getline(table_file,resultant.header);
|
||||
}
|
||||
else
|
||||
table_file.seekg(0);
|
||||
while(!table_file.eof()) {
|
||||
char next;
|
||||
next = table_file.peek();
|
||||
if (next == '\n'){
|
||||
table_file.get();
|
||||
next = table_file.peek();
|
||||
}
|
||||
if (next == '#') {
|
||||
char commented;
|
||||
while (commented != '\n') {
|
||||
if(table_file.eof() || table_file.fail())
|
||||
break;
|
||||
table_file.get(commented);
|
||||
}
|
||||
if(table_file.eof() || table_file.fail())
|
||||
break;
|
||||
next = table_file.peek();
|
||||
}
|
||||
table_file >> hnu;
|
||||
table_file >> resultant.table[hnu];
|
||||
std::getline(table_file,line);
|
||||
if (line[0] == '#') continue;
|
||||
std::stringstream scratch(line);
|
||||
scratch >> hnu;
|
||||
scratch >> resultant.table[hnu];
|
||||
}
|
||||
return resultant;
|
||||
}
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
|
||||
// Syntax: table_powerlaw_spline <samples table> <powerlaw coordinates> <output table>
|
||||
|
||||
namespace agn {
|
||||
bool sed_debug =true;
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
@ -46,12 +48,14 @@ int main(int argc, char const *argv[])
|
||||
// Read in sampling table and construct a spline model.
|
||||
samples = agn::read_sed_table(sample_table);
|
||||
|
||||
if(agn::debug) debug_file
|
||||
<< "Read samples:\n"
|
||||
if(agn::sed_debug) debug_file
|
||||
<< "Read "
|
||||
<< samples.table.size()
|
||||
<< " samples:\n"
|
||||
<< format_sed_table(samples);
|
||||
powerlaw_coords = agn::read_sed_table(powerlaw_table);
|
||||
|
||||
if(agn::debug) debug_file
|
||||
if(agn::sed_debug) debug_file
|
||||
<< "Read power coords:\n"
|
||||
<< format_sed_table(powerlaw_coords);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user