Cloudy & Associates

Commit 4307a8b4 authored by Chatzikos, Marios's avatar Chatzikos, Marios
Browse files

Report all opaque lines in 'save fine continuum'

The previous implementation reported only the most opaque line per bin.
Merging cells may eliminate important lines from the output.

All lines contributing opacity to a cell are now reported, if their
optical depth exceeds a limit.
parent 89b5afdf
......@@ -66,6 +66,7 @@
#include <fstream>
#include <bitset>
#include <unordered_map>
#include <numeric>
// Workaround for Windows...
#if defined(_MSC_VER) && !defined(SYS_CONFIG)
......
......@@ -1205,30 +1205,34 @@ void SaveDo(
}
}
// identify most opaque line in bin
// sort lines in decreasing opacity
//
string label = "";
realnum max_odep = 0.;
for( auto &lst_ind : all_stack_lines )
{
realnum this_odep =
LineSave.lines[lst_ind].getTransition()
.Emis().TauInSpecific();
if( this_odep > max_odep )
sort( all_stack_lines.begin(),
all_stack_lines.end(),
[](int i1, int i2)
{
max_odep = this_odep;
label = string( LineSave.lines[lst_ind].chALab() );
}
}
return LineSave.lines[i1].getTransition().Emis().TauInSpecific()
> LineSave.lines[i2].getTransition().Emis().TauInSpecific();
} );
double transm = sexp(sum1/nskip);
fprintf( save.params[ipPun].ipPnunit,
"%.6e\t%.3e",
AnuUnit(xnu/nskip),
transm );
if( label != "" and max_odep > 0.01 )
static const realnum odep_limit = 0.01;
for( auto &ind: all_stack_lines )
{
realnum odep = LineSave.lines[ind].getTransition() .Emis().TauInSpecific();
if( odep < odep_limit )
break;
fprintf( save.params[ipPun].ipPnunit,
"\t%s\t%.3e", label.c_str(), max_odep );
"\t%s\t%.3e",
LineSave.lines[ind].chALab(), odep );
}
fprintf( save.params[ipPun].ipPnunit, "\n" );
} while( j < nu_hi );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment