Skip to content
Snippets Groups Projects
Commit dcb5cc68 authored by Niklaus Johner's avatar Niklaus Johner
Browse files

changed mol.alg.CalculateAgreementWithDensityMap to

mol.alg.CalculateAverageAgreementWithDensityMap and adapted its output accordingly
parent 38b5a33e
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,6 @@ using namespace ost::mol::alg; ...@@ -27,6 +27,6 @@ using namespace ost::mol::alg;
void export_StructureAnalysis() void export_StructureAnalysis()
{ {
def("GetPosListFromView",&GetPosListFromView, (arg("view"))); def("GetPosListFromView",&GetPosListFromView, (arg("view")));
def("CalculateAgreementWithDensityMap",&CalculateAgreementWithDensityMap,(arg("pos_list"),arg("density_map"))); def("CalculateAverageAgreementWithDensityMap",&CalculateAverageAgreementWithDensityMap,(arg("pos_list"),arg("density_map")));
def("WrapEntityInPeriodicCell",&WrapEntityInPeriodicCell,(arg("Entity"),arg("cell_center"),arg("nasis_vec"))); def("WrapEntityInPeriodicCell",&WrapEntityInPeriodicCell,(arg("Entity"),arg("cell_center"),arg("nasis_vec")));
} }
\ No newline at end of file
...@@ -39,7 +39,7 @@ geom::Vec3List GetPosListFromView(const EntityView& view){ ...@@ -39,7 +39,7 @@ geom::Vec3List GetPosListFromView(const EntityView& view){
return vl; return vl;
} }
Real CalculateAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle& density_map){ Real CalculateAverageAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle& density_map){
Real sum,v; Real sum,v;
sum=0; sum=0;
CheckHandleValidity(density_map); CheckHandleValidity(density_map);
...@@ -48,7 +48,7 @@ Real CalculateAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle& ...@@ -48,7 +48,7 @@ Real CalculateAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle&
v=density_map.GetReal(p); v=density_map.GetReal(p);
sum=sum+v; sum=sum+v;
} }
return sum; return sum/float(vl.size());
} }
void DLLEXPORT_OST_MOL_ALG WrapEntityInPeriodicCell(EntityHandle eh, const geom::Vec3 cell_center, const geom::Vec3 basis_vec){ void DLLEXPORT_OST_MOL_ALG WrapEntityInPeriodicCell(EntityHandle eh, const geom::Vec3 cell_center, const geom::Vec3 basis_vec){
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
namespace ost { namespace mol { namespace alg { namespace ost { namespace mol { namespace alg {
geom::Vec3List DLLEXPORT_OST_MOL_ALG GetPosListFromView(const EntityView& view); geom::Vec3List DLLEXPORT_OST_MOL_ALG GetPosListFromView(const EntityView& view);
Real DLLEXPORT_OST_MOL_ALG CalculateAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle& density_map); Real DLLEXPORT_OST_MOL_ALG CalculateAverageAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle& density_map);
void DLLEXPORT_OST_MOL_ALG WrapEntityInPeriodicCell(EntityHandle eh, const geom::Vec3 cell_center, const geom::Vec3 basis_vec); void DLLEXPORT_OST_MOL_ALG WrapEntityInPeriodicCell(EntityHandle eh, const geom::Vec3 cell_center, const geom::Vec3 basis_vec);
}}}//ns }}}//ns
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment