Skip to content

Commit 9439daa

Browse files
author
Martin D. Weinberg
committed
Python deprojection test routine; add possibility of a separate Python functor for deprojection in EmpCylSL
1 parent 84bef8f commit 9439daa

4 files changed

Lines changed: 241 additions & 81 deletions

File tree

expui/BiorthBasis.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ namespace BasisClasses
996996
//! Basis construction parameters
997997
double aratio, hratio, dweight, rwidth, ashift, rfactor, rtrunc, ppow, Mfac, HERNA;
998998
bool Ignore, deproject;
999-
std::string pyname;
999+
std::string pyname, pyproj;
10001000

10011001
//! DiskType support
10021002
//!

expui/BiorthBasis.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,8 @@ namespace BasisClasses
12701270
"playback",
12711271
"coefCompute",
12721272
"coefMaster",
1273-
"pyname"
1273+
"pyname",
1274+
"pyproj"
12741275
};
12751276

12761277
Cylindrical::Cylindrical(const YAML::Node& CONF) :
@@ -1519,6 +1520,7 @@ namespace BasisClasses
15191520
if (conf["dtype" ]) dtype = conf["dtype" ].as<std::string>();
15201521
if (conf["vflag" ]) vflag = conf["vflag" ].as<int>();
15211522
if (conf["pyname" ]) pyname = conf["pyname" ].as<std::string>();
1523+
if (conf["pyproj" ]) pyname = conf["pyproj" ].as<std::string>();
15221524
if (conf["pcavar"] ) pcavar = conf["pcavar" ].as<bool>();
15231525
if (conf["subsamp"] ) sampT = conf["subsamp" ].as<int>();
15241526

@@ -1712,11 +1714,13 @@ namespace BasisClasses
17121714
[](unsigned char c){ return std::tolower(c); });
17131715

17141716
// Map legacy/short model names to canonical keys expected by dplookup
1717+
//
17151718
if (dmodel == "exp") {
17161719
dmodel = "exponential";
17171720
}
17181721

17191722
// Check for map entry
1723+
//
17201724
try {
17211725
PTYPE = dplookup.at(dmodel);
17221726

@@ -1740,9 +1744,8 @@ namespace BasisClasses
17401744
model = std::make_shared<MNdisk>(1.0, H);
17411745
else if (PTYPE == DeprojType::toomre) {
17421746
model = std::make_shared<Toomre>(1.0, H, 5.0);
1743-
} else if (PTYPE == DeprojType::python and
1744-
DTYPE == DiskType::python) {
1745-
model = std::make_shared<AxiSymPyModel>(pyname, acyl);
1747+
} else if (PTYPE == DeprojType::python) {
1748+
model = std::make_shared<AxiSymPyModel>(pyproj, acyl);
17461749
std::cout << "Using AxiSymPyModel for deprojection from Python function <"
17471750
<< pyname << ">" << std::endl;
17481751
} else { // Default to exponential

utils/Test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ foreach(program ${bin_PROGRAMS})
4747
# install(TARGETS ${program} DESTINATION bin)
4848
endforeach()
4949

50+
# For Python interpreter...
51+
target_link_libraries(testEmp ${common_LINKLIB} pybind11::embed)
52+
5053
install(TARGETS expyaml DESTINATION bin)

0 commit comments

Comments
 (0)