@@ -1186,6 +1186,7 @@ namespace BasisClasses
11861186 " rcylmin" ,
11871187 " rcylmax" ,
11881188 " acyl" ,
1189+ " bias" ,
11891190 " hcyl" ,
11901191 " sech2" ,
11911192 " snr" ,
@@ -1376,6 +1377,7 @@ namespace BasisClasses
13761377 rcylmin = 0.001 ;
13771378 rcylmax = 20.0 ;
13781379 acyl = 0.01 ;
1380+ bias = 1.0 ;
13791381 hcyl = 0.002 ;
13801382 nmax = 18 ;
13811383 mmax = 6 ;
@@ -1400,7 +1402,7 @@ namespace BasisClasses
14001402 EVEN_M = false ;
14011403 cmapR = 1 ;
14021404 cmapZ = 1 ;
1403- mtype = " exponential " ;
1405+ mtype = " Exponential " ;
14041406 dtype = " exponential" ;
14051407 vflag = 0 ;
14061408
@@ -1454,6 +1456,7 @@ namespace BasisClasses
14541456 if (conf[" rcylmax" ]) rcylmax = conf[" rcylmax" ].as <double >();
14551457
14561458 if (conf[" acyl" ]) acyl = conf[" acyl" ].as <double >();
1459+ if (conf[" bias" ]) bias = conf[" bias" ].as <double >();
14571460 if (conf[" hcyl" ]) hcyl = conf[" hcyl" ].as <double >();
14581461 if (conf[" sech2" ]) sech2 = conf[" sech2" ].as <bool >();
14591462 if (conf[" lmaxfid" ]) lmaxfid = conf[" lmaxfid" ].as <int >();
@@ -1540,6 +1543,17 @@ namespace BasisClasses
15401543 pnum = std::max<int >(1 , pnum);
15411544 tnum = std::max<int >(10 , tnum);
15421545
1546+ // Validate bias parameter
1547+ //
1548+ if (!std::isfinite (bias)) {
1549+ throw std::runtime_error (" Cylindrical: 'bias' parameter must be finite" );
1550+ }
1551+ if (bias <= 0.0 ) {
1552+ std::ostringstream sout;
1553+ sout << " Cylindrical: 'bias' parameter must be positive, got " << bias;
1554+ throw std::runtime_error (sout.str ());
1555+ }
1556+
15431557 EmpCylSL::RMIN = rcylmin;
15441558 EmpCylSL::RMAX = rcylmax;
15451559 EmpCylSL::NUMX = ncylnx;
@@ -1550,6 +1564,40 @@ namespace BasisClasses
15501564 EmpCylSL::logarithmic = logarithmic;
15511565 EmpCylSL::VFLAG = vflag;
15521566
1567+ // Set deprojected model type
1568+ //
1569+ // Convert mtype string to lower case
1570+ std::transform (mtype.begin (), mtype.end (), mtype.begin (),
1571+ [](unsigned char c){ return std::tolower (c); });
1572+
1573+ // Set EmpCylSL mtype. This is the spherical function used to
1574+ // generate the EOF basis. If "deproject" is set, this will be
1575+ // overriden in EmpCylSL.
1576+ //
1577+ EmpCylSL::mtype = EmpCylSL::Exponential; // Default
1578+ if (mtype.compare (" exponential" )==0 ) {
1579+ EmpCylSL::mtype = EmpCylSL::Exponential;
1580+ if (myid==0 ) {
1581+ std::cout << " ---- Cylindrical: using original exponential deprojected disk for EOF conditioning" << std::endl;
1582+ std::cout << " ---- Cylindrical: consider using the exact, spherically deprojected exponential with 'mtype: ExpSphere'" << std::endl;
1583+ }
1584+ } else if (mtype.compare (" expsphere" )==0 )
1585+ EmpCylSL::mtype = EmpCylSL::ExpSphere;
1586+ else if (mtype.compare (" gaussian" )==0 )
1587+ EmpCylSL::mtype = EmpCylSL::Gaussian;
1588+ else if (mtype.compare (" plummer" )==0 )
1589+ EmpCylSL::mtype = EmpCylSL::Plummer;
1590+ else if (mtype.compare (" power" )==0 ) {
1591+ EmpCylSL::mtype = EmpCylSL::Power;
1592+ EmpCylSL::PPOW = ppow;
1593+ } else {
1594+ if (myid==0 ) std::cout << " No EmpCylSL EmpModel named <"
1595+ << mtype << " >, valid types are: "
1596+ << " Exponential, ExpSphere, Gaussian, Plummer, Power "
1597+ << " (not case sensitive)" << std::endl;
1598+ throw std::runtime_error (" Cylindrical:initialize: EmpCylSL bad parameter" );
1599+ }
1600+
15531601 // Check for non-null cache file name. This must be specified
15541602 // to prevent recomputation and unexpected behavior.
15551603 //
@@ -1565,7 +1613,7 @@ namespace BasisClasses
15651613 // Make the empirical orthogonal basis instance
15661614 //
15671615 sl = std::make_shared<EmpCylSL>
1568- (nmaxfid, lmaxfid, mmax, nmax, acyl, hcyl, ncylodd, cachename);
1616+ (nmaxfid, lmaxfid, mmax, nmax, bias* acyl, hcyl, ncylodd, cachename);
15691617
15701618 // Set azimuthal harmonic order restriction?
15711619 //
@@ -1598,33 +1646,6 @@ namespace BasisClasses
15981646 << " ---- remove 'ignore' from your YAML configuration." << std::endl;
15991647 }
16001648
1601- // Convert mtype string to lower case
1602- //
1603- std::transform (mtype.begin (), mtype.end (), mtype.begin (),
1604- [](unsigned char c){ return std::tolower (c); });
1605-
1606- // Set EmpCylSL mtype. This is the spherical function used to
1607- // generate the EOF basis. If "deproject" is set, this will be
1608- // overriden in EmpCylSL.
1609- //
1610- EmpCylSL::mtype = EmpCylSL::Exponential;
1611- if (mtype.compare (" exponential" )==0 )
1612- EmpCylSL::mtype = EmpCylSL::Exponential;
1613- else if (mtype.compare (" gaussian" )==0 )
1614- EmpCylSL::mtype = EmpCylSL::Gaussian;
1615- else if (mtype.compare (" plummer" )==0 )
1616- EmpCylSL::mtype = EmpCylSL::Plummer;
1617- else if (mtype.compare (" power" )==0 ) {
1618- EmpCylSL::mtype = EmpCylSL::Power;
1619- EmpCylSL::PPOW = ppow;
1620- } else {
1621- if (myid==0 ) std::cout << " No EmpCylSL EmpModel named <"
1622- << mtype << " >, valid types are: "
1623- << " Exponential, Gaussian, Plummer, Power "
1624- << " (not case sensitive)" << std::endl;
1625- throw std::runtime_error (" Cylindrical:initialize: EmpCylSL bad parameter" );
1626- }
1627-
16281649 // Convert dtype string to lower case
16291650 //
16301651 std::transform (dtype.begin (), dtype.end (), dtype.begin (),
@@ -5184,6 +5205,7 @@ namespace BasisClasses
51845205 file.createAttribute <double >(" rcylmin" , HighFive::DataSpace::From (rcylmin)).write (rcylmin);
51855206 file.createAttribute <double >(" rcylmax" , HighFive::DataSpace::From (rcylmax)).write (rcylmax);
51865207 file.createAttribute <double >(" acyl" , HighFive::DataSpace::From (acyl)).write (acyl);
5208+ file.createAttribute <double >(" bias" , HighFive::DataSpace::From (bias)).write (bias);
51875209 file.createAttribute <double >(" hcyl" , HighFive::DataSpace::From (hcyl)).write (hcyl);
51885210 }
51895211
0 commit comments