mirror of
https://asciireactor.com/otho/cloudy-agn.git
synced 2025-04-12 11:45:44 +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.
|
# Lines appear in approximate order they appear in Cloudy standard output file.
|
||||||
|
|
||||||
#two incident continuum points
|
#two incident continuum points
|
||||||
inci 1215.00A
|
Inci 1215.00A
|
||||||
inci 4860.00A
|
Inci 4860.00A
|
||||||
|
|
||||||
#Lyman Lines:
|
#Lyman Lines:
|
||||||
TOTL 1215.68A
|
TOTL 1215.68A
|
||||||
@ -264,4 +264,4 @@ nFnu 1.48022m
|
|||||||
nFnu 1.64313m
|
nFnu 1.64313m
|
||||||
nFnu 2.32440m
|
nFnu 2.32440m
|
||||||
nFnu 4.11370m
|
nFnu 4.11370m
|
||||||
nFnu 122.400m
|
nFnu 122.400m
|
||||||
|
@ -18,38 +18,38 @@ cd fortfiles
|
|||||||
# pwd
|
# pwd
|
||||||
|
|
||||||
echo "Directory ready. Calling fort file creation."
|
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@'|sort -nr)
|
||||||
inwTfortnums=$(grep 'InwT' fort.*|sed 's@^fort\.\([0-9]\+\):InwT.*@\1@')
|
|
||||||
echo "Generating inward diffuse tables for $(echo "$inwTfortnums"|wc -l) coordinates."
|
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
|
do
|
||||||
inwCnum=$(($inwTnum + 1))
|
inwCnum=$(($inwTnum + 1))
|
||||||
inwDnum=$(($inwCnum + 1))
|
inwDnum=$(($inwCnum + 1))
|
||||||
|
allfortnums=$(echo fort.*|sed 's@fort\.\([0-9]\+\)@\1@g')
|
||||||
fortnumstoproc=""
|
fortnumstoproc=""
|
||||||
for fortnum in $allfortnums
|
for fortnum in $allfortnums
|
||||||
do
|
do
|
||||||
if [[ $fortnum > $inwCnum ]]
|
if (( $fortnum > $inwCnum ))
|
||||||
then
|
then
|
||||||
fortnumstoproc="$fortnum $fortnumstoproc"
|
fortnumstoproc="$fortnum $fortnumstoproc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "Shifting $( echo "$fortnumstoproc"|wc -w ) files."
|
# echo "Shifting $( echo "$fortnumstoproc"|wc -w ) files."
|
||||||
for fortnum in $fortnumstoproc
|
for fortnum in $fortnumstoproc
|
||||||
do
|
do
|
||||||
newnum=$(( $fortnum + 1 ))
|
newnum=$(( $fortnum + 1 ))
|
||||||
mv fort.$fortnum fort.$newnum
|
mv fort.$fortnum fort.$newnum
|
||||||
done
|
done
|
||||||
echo "Writing inwD table to fort.$inwDnum"
|
echo -n " $inwDnum"
|
||||||
$bin_dir/subtract_fortfiles fort.$inwTnum fort.$inwCnum > fort.$inwDnum
|
$bin_dir/subtract_fortfiles fort.$inwTnum fort.$inwCnum InwD > fort.$inwDnum
|
||||||
done
|
done
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo "Applying interpolative smoothing."
|
echo "Applying interpolative smoothing."
|
||||||
$script_dir/operations/bulk_interpolation_fix.sh fort.* > interpolation_report
|
$script_dir/operations/bulk_interpolation_fix.sh fort.* > interpolation_report
|
||||||
|
|
||||||
tar cf ngc5548_mehdipour_4thdexgrid_${cldndir}.tar *
|
tar cf ngc5548_mehdipour_$(basename ${base_dir})_${cldndir}.tar *
|
||||||
gzip ngc5548_mehdipour_4thdexgrid_${cldndir}.tar
|
gzip ngc5548_mehdipour_$(basename ${base_dir})_${cldndir}.tar
|
||||||
mv ngc5548_mehdipour_4thdexgrid_${cldndir}.tar.gz $base_dir/..
|
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 {
|
else {
|
||||||
getline(inputfile,inputline);
|
getline(inputfile,inputline);
|
||||||
while (inputline.find(seek_string) == std::string::npos)
|
while (inputline.find(seek_string) == std::string::npos)
|
||||||
getline(inputfile,inputline);
|
getline(inputfile,inputline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,39 @@ int main(int argc, char const *argv[]) {
|
|||||||
<< " emission lines.\n";
|
<< " emission lines.\n";
|
||||||
std::list<agn::eqwidth_table> tables = agn::compile_eqwidth_tables(grid,lines_to_print,1215.00);
|
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
|
std::cout
|
||||||
<< "Printing "
|
<< "Printing "
|
||||||
<< tables.size()
|
<< tables.size()
|
||||||
<< " tables to fortfiles.\n";
|
<< " tables to fortfiles.\n";
|
||||||
std::list<agn::eqwidth_table>::iterator table_it = tables.begin();
|
table_it = tables.begin();
|
||||||
int fortfilenum=11;
|
int fortfilenum=11;
|
||||||
while(table_it != tables.end()) {
|
while(table_it != tables.end()) {
|
||||||
std::ofstream outfile;
|
std::ofstream outfile;
|
||||||
|
@ -21,6 +21,7 @@ struct eqwidth_table {
|
|||||||
std::string header[2];
|
std::string header[2];
|
||||||
table2d value;
|
table2d value;
|
||||||
};
|
};
|
||||||
|
bool is_zero(const eqwidth_table&);
|
||||||
eqwidth_table read_eqwidth_table(std::ifstream& table_file);
|
eqwidth_table read_eqwidth_table(std::ifstream& table_file);
|
||||||
std::string format_eqwidth_table(eqwidth_table table);
|
std::string format_eqwidth_table(eqwidth_table table);
|
||||||
std::string format_eqwidth_table_slice(eqwidth_table table,iterator2d x);
|
std::string format_eqwidth_table_slice(eqwidth_table table,iterator2d x);
|
||||||
@ -64,11 +65,24 @@ std::ostream& operator<< (std::ostream&,eqwidth_table);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Definitions
|
// 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 agn::read_eqwidth_table(std::ifstream& table_file) {
|
||||||
agn::eqwidth_table resultant;
|
agn::eqwidth_table resultant;
|
||||||
|
@ -68,7 +68,8 @@ int main(int argc, char const *argv[])
|
|||||||
std::cout
|
std::cout
|
||||||
<< first_line
|
<< first_line
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< "HDen Phi(H) ScaInten"
|
//<< "HDen Phi(H) ScaInten"
|
||||||
|
<< second_line
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
for (int i=0; i<table_entries; i++) {
|
for (int i=0; i<table_entries; i++) {
|
||||||
@ -85,5 +86,7 @@ int main(int argc, char const *argv[])
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table1.close();
|
||||||
|
table2.close();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user