mirror of
https://asciireactor.com/otho/cloudy-agn.git
synced 2024-12-05 02:05:07 +00:00
have a working packaging meta script, now
This commit is contained in:
parent
50c0b4a3d0
commit
7414374273
@ -2,8 +2,8 @@
|
||||
# Lines appear in approximate order they appear in Cloudy standard output file.
|
||||
|
||||
#two incident continuum points
|
||||
inci 1215.00A
|
||||
inci 4860.00A
|
||||
Inci 1215.00A
|
||||
Inci 4860.00A
|
||||
|
||||
#Lyman Lines:
|
||||
TOTL 1215.68A
|
||||
@ -264,4 +264,4 @@ nFnu 1.48022m
|
||||
nFnu 1.64313m
|
||||
nFnu 2.32440m
|
||||
nFnu 4.11370m
|
||||
nFnu 122.400m
|
||||
nFnu 122.400m
|
||||
|
@ -18,38 +18,38 @@ cd fortfiles
|
||||
# pwd
|
||||
|
||||
echo "Directory ready. Calling fort file creation."
|
||||
# $bin_dir/create_fort_files ../mpi_grid.out $script_dir/../reference/linelist
|
||||
$bin_dir/create_fort_files ../mpi_grid.out $script_dir/../reference/linelist
|
||||
|
||||
allfortnums=$(echo fort.*|sed 's@fort\.\([0-9]\+\)@\1@g')
|
||||
inwTfortnums=$(grep 'InwT' fort.*|sed 's@^fort\.\([0-9]\+\):InwT.*@\1@')
|
||||
inwTfortnums=$(grep 'InwT' fort.*|sed 's@^fort\.\([0-9]\+\):InwT.*@\1@'|sort -nr)
|
||||
echo "Generating inward diffuse tables for $(echo "$inwTfortnums"|wc -l) coordinates."
|
||||
for inwTnum in $inwTfortnums
|
||||
echo -n "Writing InwD tables to fortfiles:"
|
||||
for inwTnum in $(echo $inwTfortnums|sort -r)
|
||||
do
|
||||
inwCnum=$(($inwTnum + 1))
|
||||
inwDnum=$(($inwCnum + 1))
|
||||
allfortnums=$(echo fort.*|sed 's@fort\.\([0-9]\+\)@\1@g')
|
||||
fortnumstoproc=""
|
||||
for fortnum in $allfortnums
|
||||
do
|
||||
if [[ $fortnum > $inwCnum ]]
|
||||
if (( $fortnum > $inwCnum ))
|
||||
then
|
||||
fortnumstoproc="$fortnum $fortnumstoproc"
|
||||
fi
|
||||
done
|
||||
echo "Shifting $( echo "$fortnumstoproc"|wc -w ) files."
|
||||
# echo "Shifting $( echo "$fortnumstoproc"|wc -w ) files."
|
||||
for fortnum in $fortnumstoproc
|
||||
do
|
||||
newnum=$(( $fortnum + 1 ))
|
||||
mv fort.$fortnum fort.$newnum
|
||||
done
|
||||
echo "Writing inwD table to fort.$inwDnum"
|
||||
$bin_dir/subtract_fortfiles fort.$inwTnum fort.$inwCnum > fort.$inwDnum
|
||||
echo -n " $inwDnum"
|
||||
$bin_dir/subtract_fortfiles fort.$inwTnum fort.$inwCnum InwD > fort.$inwDnum
|
||||
done
|
||||
echo ""
|
||||
|
||||
echo "Applying interpolative smoothing."
|
||||
$script_dir/operations/bulk_interpolation_fix.sh fort.* > interpolation_report
|
||||
|
||||
tar cf ngc5548_mehdipour_4thdexgrid_${cldndir}.tar *
|
||||
gzip ngc5548_mehdipour_4thdexgrid_${cldndir}.tar
|
||||
mv ngc5548_mehdipour_4thdexgrid_${cldndir}.tar.gz $base_dir/..
|
||||
|
||||
|
||||
tar cf ngc5548_mehdipour_$(basename ${base_dir})_${cldndir}.tar *
|
||||
gzip ngc5548_mehdipour_$(basename ${base_dir})_${cldndir}.tar
|
||||
mv ngc5548_mehdipour_$(basename ${base_dir})_${cldndir}.tar.gz $base_dir
|
||||
|
@ -212,7 +212,7 @@ agn::cloudy_grid agn::read_cloudy_grid(std::ifstream& inputfile) {
|
||||
}
|
||||
else {
|
||||
getline(inputfile,inputline);
|
||||
while (inputline.find(seek_string) == std::string::npos)
|
||||
while (inputline.find(seek_string) == std::string::npos)
|
||||
getline(inputfile,inputline);
|
||||
}
|
||||
}
|
||||
|
@ -25,11 +25,39 @@ int main(int argc, char const *argv[]) {
|
||||
<< " emission lines.\n";
|
||||
std::list<agn::eqwidth_table> tables = agn::compile_eqwidth_tables(grid,lines_to_print,1215.00);
|
||||
|
||||
|
||||
// Remove any tables that are zero.
|
||||
std::list<agn::eqwidth_table>::iterator table_it = tables.begin();
|
||||
std::ofstream zeroreport;
|
||||
zeroreport.open("zero_report");
|
||||
zeroreport << "These headers were pulled from tables"
|
||||
<< " that returned minimum values."
|
||||
<< std::endl;
|
||||
int zeroes=0;
|
||||
while(table_it != tables.end()) {
|
||||
if(agn::is_zero(*table_it)) {
|
||||
zeroreport << " "
|
||||
<< table_it->header[0]
|
||||
<< std::endl;
|
||||
zeroes++;
|
||||
table_it = tables.erase(table_it);
|
||||
continue;
|
||||
}
|
||||
|
||||
table_it++;
|
||||
}
|
||||
std::cout << "Removed "
|
||||
<< zeroes
|
||||
<< " tables from the list because"
|
||||
<< " they had zero value."
|
||||
<< std::endl;
|
||||
|
||||
// Write the tables to the fortfile stack.
|
||||
std::cout
|
||||
<< "Printing "
|
||||
<< tables.size()
|
||||
<< " tables to fortfiles.\n";
|
||||
std::list<agn::eqwidth_table>::iterator table_it = tables.begin();
|
||||
table_it = tables.begin();
|
||||
int fortfilenum=11;
|
||||
while(table_it != tables.end()) {
|
||||
std::ofstream outfile;
|
||||
|
@ -21,6 +21,7 @@ struct eqwidth_table {
|
||||
std::string header[2];
|
||||
table2d value;
|
||||
};
|
||||
bool is_zero(const eqwidth_table&);
|
||||
eqwidth_table read_eqwidth_table(std::ifstream& table_file);
|
||||
std::string format_eqwidth_table(eqwidth_table table);
|
||||
std::string format_eqwidth_table_slice(eqwidth_table table,iterator2d x);
|
||||
@ -64,11 +65,24 @@ std::ostream& operator<< (std::ostream&,eqwidth_table);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Definitions
|
||||
|
||||
bool agn::is_zero(const eqwidth_table& table_to_check) {
|
||||
agn::table2d::const_iterator x_it = table_to_check.value.begin();
|
||||
while (x_it != table_to_check.value.end()) {
|
||||
agn::table1d::const_iterator y_it= x_it->second.begin();
|
||||
while (y_it != x_it->second.end()) {
|
||||
if (y_it->second != EQWIDTH_MIN_VAL)
|
||||
return false;
|
||||
y_it++;
|
||||
}
|
||||
x_it++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
agn::eqwidth_table agn::read_eqwidth_table(std::ifstream& table_file) {
|
||||
agn::eqwidth_table resultant;
|
||||
|
@ -68,7 +68,8 @@ int main(int argc, char const *argv[])
|
||||
std::cout
|
||||
<< first_line
|
||||
<< std::endl
|
||||
<< "HDen Phi(H) ScaInten"
|
||||
//<< "HDen Phi(H) ScaInten"
|
||||
<< second_line
|
||||
<< std::endl;
|
||||
|
||||
for (int i=0; i<table_entries; i++) {
|
||||
@ -85,5 +86,7 @@ int main(int argc, char const *argv[])
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
table1.close();
|
||||
table2.close();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user