ProSHADE  0.7.6.6 (JUL 2022)
Protein Shape Detection
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere Class Reference

This class contains all inputed data for the rotation function angle-axis converted spheres. More...

#include <ProSHADE_maths.hpp>

Public Member Functions

 ProSHADE_rotFun_sphere (proshade_double rad, proshade_double radRange, proshade_unsign dim, proshade_unsign rfDim, proshade_double repAng, proshade_unsign sphNo)
 Constructor for getting empty ProSHADE_rotFun_sphere class. More...
 
 ~ProSHADE_rotFun_sphere (void)
 Destructor for releasing memory from the ProSHADE_rotFun_sphere class. More...
 
proshade_double getRadius (void)
 Accessor function for the private variable radius. More...
 
proshade_double getMaxRadius (void)
 Accessor function for the private variable maximum radius. More...
 
proshade_double getMinRadius (void)
 Accessor function for the private variable minimal radius. More...
 
proshade_unsign getAngularDim (void)
 Accessor function for the private variable angular dim. More...
 
proshade_unsign getRotFunDim (void)
 Accessor function for the private variable rotastion function dim. More...
 
proshade_double getRepresentedAngle (void)
 Accessor function for the private variable represented angle. More...
 
proshade_unsign getSphereNumber (void)
 Accessor function for the private variable sphere number. More...
 
std::vector< std::pair< proshade_unsign, proshade_unsign > > getPeaks (void)
 Accessor function for the private variable containing all detected peaks. More...
 
proshade_double getSphereLatLonPosition (proshade_unsign lattitude, proshade_unsign longitude)
 Accessor function for specific lattitude and longitude point of the sphere sampling grid. More...
 
proshade_double getSphereLatLonLinearInterpolationPos (proshade_double lattitude, proshade_double longitude)
 Function for obtaining sphere values outside of the grid points. More...
 
std::vector< std::vector< proshade_double > > getCopyOfValues (void)
 Function for obtaining a copy of all sphere values. More...
 
void interpolateSphereValues (proshade_complex *rotFun)
 Function for interpolating the sphere grid values from angle-axis converted rotation function. More...
 
void findAllPeaks (proshade_signed noSmNeighbours, std::vector< proshade_double > *allHeights)
 Function for finding all peaks in the sampling grid. More...
 
void removeSmallPeaks (proshade_double peakThres)
 Function for removing peaks with too small height. More...
 

Detailed Description

This class contains all inputed data for the rotation function angle-axis converted spheres.

This class codes the object that contains all the information about a single concentric sphere in the angle-axis space obtained by conversion of the rotation function. It also contains all the functionality required to process such data.

Definition at line 57 of file ProSHADE_maths.hpp.

Constructor & Destructor Documentation

◆ ProSHADE_rotFun_sphere()

ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::ProSHADE_rotFun_sphere ( proshade_double  rad,
proshade_double  radRange,
proshade_unsign  dim,
proshade_unsign  rfDim,
proshade_double  repAng,
proshade_unsign  sphNo 
)

Constructor for getting empty ProSHADE_rotFun_sphere class.

This function simply creates an object of the ProSHADE_rotFun_sphere class and allocates the memory as required.

Parameters
[in]radThe radius of this sphere.
[in]radRangeThe range in the radial dimension covered by this sphere.
[in]dimThe required size of the sampling grid.
[in]rfDimThe dimension size of the rotation function (can be different from the angular dimension of the sphere due to oversampling of the E matrices)
[in]repAngThe angle represented by this sphere.
[in]sphNoThe number of this sphere in the spheres vector.
[out]XData object with all values set and ready to accept the rotation function values.

Definition at line 650 of file ProSHADE_spheres.cpp.

651 {
652  //================================================ Set internal values
653  this->radius = rad;
654  this->angularDim = dim;
655  this->rotFunDim = rfDim;
656  this->radiusMin = this->radius - ( radRange / 2.0 );
657  this->radiusMax = this->radius + ( radRange / 2.0 );
658  this->representedAngle = repAng;
659  this->sphereNumber = sphNo;
660 
661  //================================================ Allocate the axis field
662  this->axesValues = new proshade_double[dim*dim];
663  ProSHADE_internal_misc::checkMemoryAllocation ( this->axesValues, __FILE__, __LINE__, __func__ );
664 
665  //================================================ Fill axis field with zeroes
666  for ( proshade_unsign iter = 0; iter < ( dim * dim ); iter++ ) { this->axesValues[iter] = 0.0; }
667 
668 }

◆ ~ProSHADE_rotFun_sphere()

ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::~ProSHADE_rotFun_sphere ( void  )

Destructor for releasing memory from the ProSHADE_rotFun_sphere class.

Parameters
[out]XN/A.

Definition at line 674 of file ProSHADE_spheres.cpp.

675 {
676  //================================================ Release the allocated memory
677  if ( this->axesValues != nullptr )
678  {
679  delete[] this->axesValues;
680  }
681 }

Member Function Documentation

◆ findAllPeaks()

void ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::findAllPeaks ( proshade_signed  noSmNeighbours,
std::vector< proshade_double > *  allHeights 
)

Function for finding all peaks in the sampling grid.

This function takes the values on the sampling grid and does a naive peak search, saving the peak position into an internal variable.

Parameters
[in]noSmNeighboursThe number of surrounding peaks in any direction that need to be smaller for a value to be a peak.
[in]allHeightsA vector to which all detected non-peaks heights will be saved into. This will later be used to determine the threshold for "small" peaks.

Definition at line 965 of file ProSHADE_spheres.cpp.

966 {
967  //================================================ Initialise local variables
968  proshade_double currentHeight;
969  proshade_signed nbLat, nbLon;
970  bool isPeak;
971 
972  //================================================ Find all peaks
973  for ( proshade_signed latIt = 0; latIt < static_cast<proshade_signed> ( this->angularDim ); latIt++ )
974  {
975  for ( proshade_signed lonIt = 0; lonIt < static_cast<proshade_signed> ( this->angularDim ); lonIt++ )
976  {
977  //======================================== Initialise peak search
978  currentHeight = this->getSphereLatLonPosition ( static_cast< proshade_unsign > ( latIt ), static_cast< proshade_unsign > ( lonIt ) );
979  isPeak = true;
980 
981  //======================================== Find all neighbours in the same sphere
982  for ( proshade_signed latRound = -noSmNeighbours; latRound <= noSmNeighbours; latRound++ )
983  {
984  for ( proshade_signed lonRound = -noSmNeighbours; lonRound <= noSmNeighbours; lonRound++ )
985  {
986  //================================ Ignore same point
987  if ( latRound == 0 && lonRound == 0 ) { continue; }
988 
989  //================================ Get neighbour height
990  nbLat = latIt + latRound;
991  nbLon = lonIt + lonRound;
992  if ( nbLat < 0 ) { nbLat += this->angularDim; } if ( nbLat >= static_cast<proshade_signed> ( this->angularDim ) ) { nbLat -= this->angularDim; }
993  if ( nbLon < 0 ) { continue; } if ( nbLon >= static_cast<proshade_signed> ( this->angularDim ) ) { continue; }
994 
995  //================================ If this value is larger than the tested one, no peak
996  if ( this->getSphereLatLonPosition ( static_cast< proshade_unsign > ( nbLat ), static_cast< proshade_unsign > ( nbLon ) ) > currentHeight ) { isPeak = false; break; }
997  }
998 
999  if ( !isPeak ) { break; }
1000  }
1001 
1002  if ( isPeak )
1003  {
1004  //==================================== Save!
1005  this->peaks.emplace_back ( std::pair<proshade_unsign,proshade_unsign> ( latIt, lonIt ) );
1006  }
1007  else
1008  {
1009  ProSHADE_internal_misc::addToDoubleVector ( allHeights, currentHeight );
1010  }
1011  }
1012  }
1013 
1014  //================================================ Done
1015  return ;
1016 
1017 }

◆ getAngularDim()

proshade_unsign ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getAngularDim ( void  )

Accessor function for the private variable angular dim.

Parameters
[out]angularDimThe dimension size of the angular sampling grid.

Definition at line 719 of file ProSHADE_spheres.cpp.

720 {
721  //================================================ Done
722  return ( this->angularDim );
723 
724 }

◆ getCopyOfValues()

std::vector< std::vector< proshade_double > > ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getCopyOfValues ( void  )

Function for obtaining a copy of all sphere values.

This function gives access to the mapped sphere values.

Parameters
[out]retA vector of vectors of doubles indexed longitude, latitude containing all sphere mapped RF values.

Definition at line 936 of file ProSHADE_spheres.cpp.

937 {
938  //================================================ Initialise variables
939  std::vector< std::vector< proshade_double > > ret ( this->angularDim );
940  std::vector< proshade_double > retHlp ( this->angularDim, 0.0 );
941 
942  //================================================ Fill in the values
943  for ( size_t lonIt = 0; lonIt < this->angularDim; lonIt++ )
944  {
945  for ( size_t latIt = 0; latIt < this->angularDim; latIt++ )
946  {
947  retHlp.at(latIt) = this->getSphereLatLonPosition ( static_cast< proshade_unsign > ( latIt ), static_cast< proshade_unsign > ( lonIt ) );
948  }
949 
950  ret.at(lonIt) = retHlp;
951  }
952 
953  //================================================ Done
954  return ( ret );
955 
956 }

◆ getMaxRadius()

proshade_double ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getMaxRadius ( void  )

Accessor function for the private variable maximum radius.

Parameters
[out]radiusThe value of the maximum radius of this specific concentric shell.

Definition at line 697 of file ProSHADE_spheres.cpp.

698 {
699  //================================================ Done
700  return ( this->radiusMax );
701 
702 }

◆ getMinRadius()

proshade_double ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getMinRadius ( void  )

Accessor function for the private variable minimal radius.

Parameters
[out]radiusThe value of the minimal radius of this specific concentric shell.

Definition at line 730 of file ProSHADE_spheres.cpp.

731 {
732  //================================================ Done
733  return ( this->radiusMin );
734 
735 }

◆ getPeaks()

std::vector< std::pair< proshade_unsign, proshade_unsign > > ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getPeaks ( void  )

Accessor function for the private variable containing all detected peaks.

Parameters
[out]peaksThe vector containing all detected peaks.

Definition at line 763 of file ProSHADE_spheres.cpp.

764 {
765  //================================================ Done
766  return ( this->peaks );
767 
768 }

◆ getRadius()

proshade_double ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getRadius ( void  )

Accessor function for the private variable radius.

Parameters
[out]radiusThe value of the radius of this specific concentric shell.

Definition at line 687 of file ProSHADE_spheres.cpp.

688 {
689  //================================================ Done
690  return ( this->radius );
691 }

◆ getRepresentedAngle()

proshade_double ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getRepresentedAngle ( void  )

Accessor function for the private variable represented angle.

Parameters
[out]radiusThe value of the angle represented by this sphere.

Definition at line 741 of file ProSHADE_spheres.cpp.

742 {
743  //================================================ Done
744  return ( this->representedAngle );
745 
746 }

◆ getRotFunDim()

proshade_unsign ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getRotFunDim ( void  )

Accessor function for the private variable rotastion function dim.

Parameters
[out]rotFunDimThe dimension size of the rotation function sampling grid.

Definition at line 708 of file ProSHADE_spheres.cpp.

709 {
710  //================================================ Done
711  return ( this->rotFunDim );
712 
713 }

◆ getSphereLatLonLinearInterpolationPos()

proshade_double ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getSphereLatLonLinearInterpolationPos ( proshade_double  lattitude,
proshade_double  longitude 
)

Function for obtaining sphere values outside of the grid points.

This function computes linear interpolation value for any grid position of the sampling grid of this sphere.

Parameters
[in]lattitudeThe lattitude index decimal place of the requested sampling grid position.
[in]longitudeThe longitude index of the requested sampling grid position.
[out]radiusThe value of the sampling grid position at given lattitude and longitude.

Definition at line 891 of file ProSHADE_spheres.cpp.

892 {
893  //================================================ Initialise variables
894  proshade_double c00, c01, c10, c11, c0, c1, latRelative, lonRelative;
895  proshade_signed latTop, latBottom, lonTop, lonBottom, gridIndex;
896 
897  //================================================ Find lower and higher indices and deal with boundaries
898  latBottom = static_cast< proshade_signed > ( std::floor ( lattitude ) ); if ( latBottom < 0 ) { latBottom += this->angularDim; } if ( latBottom >= static_cast<proshade_signed> ( this->angularDim ) ) { latBottom -= this->angularDim; }
899  lonBottom = static_cast< proshade_signed > ( std::floor ( longitude ) ); if ( lonBottom < 0 ) { lonBottom += this->angularDim; } if ( lonBottom >= static_cast<proshade_signed> ( this->angularDim ) ) { lonBottom -= this->angularDim; }
900  latTop = static_cast< proshade_signed > ( std::ceil ( lattitude ) ); if ( latTop < 0 ) { latTop += this->angularDim; } if ( latTop >= static_cast<proshade_signed> ( this->angularDim ) ) { latTop -= this->angularDim; }
901  lonTop = static_cast< proshade_signed > ( std::ceil ( longitude ) ); if ( lonTop < 0 ) { lonTop += this->angularDim; } if ( lonTop >= static_cast<proshade_signed> ( this->angularDim ) ) { lonTop -= this->angularDim; }
902 
903  //================================================ Interpolate
904  gridIndex = lonBottom + ( latBottom * static_cast< proshade_signed > ( this->angularDim ) );
905  c00 = this->axesValues[gridIndex];
906 
907  gridIndex = lonBottom + ( latTop * static_cast< proshade_signed > ( this->angularDim ) );
908  c01 = this->axesValues[gridIndex];
909 
910  gridIndex = lonTop + ( latBottom * static_cast< proshade_signed > ( this->angularDim ) );
911  c10 = this->axesValues[gridIndex];
912 
913  gridIndex = lonTop + ( latTop * static_cast< proshade_signed > ( this->angularDim ) );
914  c11 = this->axesValues[gridIndex];
915 
916  //================================================ Solve for longitude
917  lonRelative = longitude - std::floor( longitude );
918  c0 = ( c00 * ( 1.0 - lonRelative ) ) + ( c10 * lonRelative );
919  c1 = ( c01 * ( 1.0 - lonRelative ) ) + ( c11 * lonRelative );
920 
921  //================================================ Solve for lattitude
922  latRelative = lattitude - std::floor ( lattitude );
923  proshade_double res = ( c0 * ( 1.0 - latRelative ) ) + ( c1 * latRelative );
924 
925  //================================================ Done
926  return ( res );
927 
928 }

◆ getSphereLatLonPosition()

proshade_double ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getSphereLatLonPosition ( proshade_unsign  lattitude,
proshade_unsign  longitude 
)

Accessor function for specific lattitude and longitude point of the sphere sampling grid.

Parameters
[in]lattitudeThe lattitude index of the requested sampling grid point.
[in]longitudeThe longitude index of the requested sampling grid point.
[out]radiusThe value of the sampling grid point at given lattitude and longitude position.

Definition at line 877 of file ProSHADE_spheres.cpp.

878 {
879  //================================================ Done
880  return ( this->axesValues[longitude + ( lattitude * static_cast<proshade_unsign> ( this->angularDim ) )] );
881 }

◆ getSphereNumber()

proshade_unsign ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getSphereNumber ( void  )

Accessor function for the private variable sphere number.

Parameters
[out]sphereNumberThe sphere number.

Definition at line 752 of file ProSHADE_spheres.cpp.

753 {
754  //================================================ Done
755  return ( this->sphereNumber );
756 
757 }

◆ interpolateSphereValues()

void ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::interpolateSphereValues ( proshade_complex *  rotFun)

Function for interpolating the sphere grid values from angle-axis converted rotation function.

This function starts by converting each of the sphere sampling points lattitude and longitude to the XYZ position and by adding the represented rotation angle, obtains the angle-axis representation for the given point. It then proceeds to locate such points exact position in the indices space of the supplied rotation map. From there, it interpolates the exact correlation value for the given point, thus effectivelly re-sampling the rotation function space onto the sphere.

Parameters
[in]rotFunproshade_complex pointer to the rotation function values.

Definition at line 779 of file ProSHADE_spheres.cpp.

780 {
781  //================================================ Initialise variables
782  proshade_double lonSampling = ( M_PI ) / static_cast< proshade_double > ( this->angularDim );
783  proshade_double latSampling = ( M_PI * 2.0 ) / static_cast< proshade_double > ( this->angularDim );
784 
785  proshade_double lat, lon, cX, cY, cZ, c000, c001, c010, c011, c100, c101, c110, c111, c00, c01, c10, c11, c0, c1, xRelative, yRelative, zRelative, eulerAlpha, eulerBeta, eulerGamma, mapX, mapY, mapZ;
786  proshade_signed xBottom, xTop, yBottom, yTop, zBottom, zTop, mapIndex;
787 
788  //================================================ For each sphere grid position
789  for ( proshade_signed lonIt = 0; lonIt < static_cast<proshade_signed> ( this->angularDim ); lonIt++ )
790  {
791  for ( proshade_signed latIt = 0; latIt < static_cast<proshade_signed> ( this->angularDim ); latIt++ )
792  {
793  //======================================== Convert to XYZ position on unit sphere. The radius here is not important, as it does not change the direction of the vector.
794  lon = static_cast<proshade_double> ( lonIt ) * lonSampling;
795  lat = static_cast<proshade_double> ( latIt ) * latSampling;
796  cX = 1.0 * std::sin ( lon ) * std::cos ( lat );
797  cY = 1.0 * std::sin ( lon ) * std::sin ( lat );
798  cZ = 1.0 * std::cos ( lon );
799 
800  //======================================== Convert to ZYZ Euler angles
801  ProSHADE_internal_maths::getEulerZYZFromAngleAxis ( cX, cY, cZ, this->representedAngle, &eulerAlpha, &eulerBeta, &eulerGamma );
802 
803  //======================================== Convert to SOFT map position (decimal, not indices)
804  ProSHADE_internal_maths::getSOFTPositionFromEulerZYZ ( this->rotFunDim / 2, eulerAlpha, eulerBeta, eulerGamma, &mapX, &mapY, &mapZ );
805 
806  //======================================== Find lower and higher points and deal with boundaries
807  xBottom = static_cast< proshade_signed > ( std::floor ( mapX ) ); if ( xBottom < 0 ) { xBottom = 0; } if ( xBottom >= static_cast< proshade_signed > ( this->rotFunDim ) ) { xBottom = static_cast<proshade_signed> ( this->rotFunDim - 2 ); }
808  yBottom = static_cast< proshade_signed > ( std::floor ( mapY ) ); if ( yBottom < 0 ) { yBottom = 0; } if ( yBottom >= static_cast< proshade_signed > ( this->rotFunDim ) ) { yBottom = static_cast<proshade_signed> ( this->rotFunDim - 2 ); }
809  zBottom = static_cast< proshade_signed > ( std::floor ( mapZ ) ); if ( zBottom < 0 ) { zBottom = 0; } if ( zBottom >= static_cast< proshade_signed > ( this->rotFunDim ) ) { zBottom = static_cast<proshade_signed> ( this->rotFunDim - 2 ); }
810  xTop = static_cast< proshade_signed > ( std::ceil ( mapX ) ); if ( xTop < 1 ) { xTop = 1; } if ( xTop >= static_cast< proshade_signed > ( this->rotFunDim ) ) { xTop = static_cast<proshade_signed> ( this->rotFunDim - 1 ); }
811  yTop = static_cast< proshade_signed > ( std::ceil ( mapY ) ); if ( yTop < 1 ) { yTop = 1; } if ( yTop >= static_cast< proshade_signed > ( this->rotFunDim ) ) { yTop = static_cast<proshade_signed> ( this->rotFunDim - 1 ); }
812  zTop = static_cast< proshade_signed > ( std::ceil ( mapZ ) ); if ( zTop < 1 ) { zTop = 1; } if ( zTop >= static_cast< proshade_signed > ( this->rotFunDim ) ) { zTop = static_cast<proshade_signed> ( this->rotFunDim - 1 ); }
813 
814  //======================================== Start X interpolation - bottom, bottom, bottom
815  mapIndex = zBottom + static_cast< proshade_signed > ( this->rotFunDim ) * ( yBottom + static_cast< proshade_signed > ( this->rotFunDim ) * xBottom );
816  c000 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
817 
818  //======================================== X interpolation - bottom, bottom, top
819  mapIndex = zTop + static_cast< proshade_signed > ( this->rotFunDim ) * ( yBottom + static_cast< proshade_signed > ( this->rotFunDim ) * xBottom );
820  c001 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
821 
822  //======================================== X interpolation - bottom, top, bottom
823  mapIndex = zBottom + static_cast< proshade_signed > ( this->rotFunDim ) * ( yTop + static_cast< proshade_signed > ( this->rotFunDim ) * xBottom );
824  c010 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
825 
826  //======================================== X interpolation - bottom, top, top
827  mapIndex = zTop + static_cast< proshade_signed > ( this->rotFunDim ) * ( yTop + static_cast< proshade_signed > ( this->rotFunDim ) * xBottom );
828  c011 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
829 
830  //======================================== X interpolation - top, bottom, bottom
831  mapIndex = zBottom + static_cast< proshade_signed > ( this->rotFunDim ) * ( yBottom + static_cast< proshade_signed > ( this->rotFunDim ) * xTop );
832  c100 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
833 
834  //======================================== X interpolation - top, bottom, top
835  mapIndex = zTop + static_cast< proshade_signed > ( this->rotFunDim ) * ( yBottom + static_cast< proshade_signed > ( this->rotFunDim ) * xTop );
836  c101 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
837 
838  //======================================== X interpolation - top, top, bottom
839  mapIndex = zBottom + static_cast< proshade_signed > ( this->rotFunDim ) * ( yTop + static_cast< proshade_signed > ( this->rotFunDim ) * xTop );
840  c110 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
841 
842  //======================================== X interpolation - top, top, top
843  mapIndex = zTop + static_cast< proshade_signed > ( this->rotFunDim ) * ( yTop + static_cast< proshade_signed > ( this->rotFunDim ) * xTop );
844  c111 = pow( rotFun[mapIndex][0], 2.0 ) + pow( rotFun[mapIndex][1], 2.0 );
845 
846  //======================================== Solve for X
847  xRelative = mapX - std::floor( mapX );
848  c00 = ( c000 * ( 1.0 - xRelative ) ) + ( c100 * xRelative );
849  c01 = ( c001 * ( 1.0 - xRelative ) ) + ( c101 * xRelative );
850  c10 = ( c010 * ( 1.0 - xRelative ) ) + ( c110 * xRelative );
851  c11 = ( c011 * ( 1.0 - xRelative ) ) + ( c111 * xRelative );
852 
853  //======================================== Solve for Y
854  yRelative = mapY - std::floor( mapY );
855  c0 = ( c00 * ( 1.0 - yRelative ) ) + ( c10 * yRelative );
856  c1 = ( c01 * ( 1.0 - yRelative ) ) + ( c11 * yRelative );
857 
858  //======================================== Solve for Z
859  zRelative = mapZ - std::floor( mapZ );
860 
861  //======================================== Save result
862  mapIndex = lonIt + ( latIt * static_cast< proshade_signed > ( this->angularDim ) );
863  this->axesValues[mapIndex] = ( c0 * ( 1.0 - zRelative ) ) + ( c1 * zRelative );
864  }
865  }
866  //================================================ Done
867  return ;
868 
869 }

◆ removeSmallPeaks()

void ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::removeSmallPeaks ( proshade_double  peakThres)

Function for removing peaks with too small height.

This function takes the threshold for peaks being too small (computed from all peaks as returned by findAllPeaks() function, but could be any other value) and removes all peaks with height below this threshold.

Parameters
[in]peakThresThe height above which a peak needs to be in order not to be deleted.
[in]minThresThe minimum threshold that needs to be passed for a peak to be believed in.

Definition at line 1027 of file ProSHADE_spheres.cpp.

1028 {
1029  //================================================ Initialise variables
1030  proshade_double curHeight;
1031  std::vector< proshade_unsign > dels ( 0, static_cast< proshade_unsign > ( this->peaks.size() ) );
1032 
1033  //================================================ For each peak in this sphere
1034  for ( proshade_unsign peakIt = 0; peakIt < static_cast<proshade_unsign> ( this->peaks.size() ); peakIt++ )
1035  {
1036  //============================================ Find the peak height
1037  curHeight = this->getSphereLatLonPosition ( this->peaks.at(peakIt).first, this->peaks.at(peakIt).second );
1038 
1039  //============================================ Should this peak be deleted?
1040  if ( curHeight < peakThres )
1041  {
1043  }
1044  }
1045 
1046  //================================================ Descending sort to avoid changing the order
1047  std::sort ( dels.begin(), dels.end(), std::greater <proshade_unsign>() );
1048 
1049  //================================================ Delete the low peaks
1050  for ( proshade_unsign delIt = 0; delIt < static_cast< proshade_unsign > ( dels.size() ); delIt++ )
1051  {
1052  this->peaks.erase ( this->peaks.begin() + static_cast< long int > ( dels.at(delIt) ) );
1053  }
1054 
1055  //================================================ Done
1056  return ;
1057 
1058 }

The documentation for this class was generated from the following files:
ProSHADE_internal_maths::getSOFTPositionFromEulerZYZ
void getSOFTPositionFromEulerZYZ(proshade_signed band, proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double *x, proshade_double *y, proshade_double *z)
Function to find the index position in the inverse SOFT map from given Euler angles (ZYZ convention).
Definition: ProSHADE_maths.cpp:991
ProSHADE_internal_misc::addToDoubleVector
void addToDoubleVector(std::vector< proshade_double > *vecToAddTo, proshade_double elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:77
ProSHADE_internal_maths::getEulerZYZFromAngleAxis
void getEulerZYZFromAngleAxis(proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axAng, proshade_double *eA, proshade_double *eB, proshade_double *eG)
This function converts angle-axis representation to the Euler ZYZ angles representation.
Definition: ProSHADE_maths.cpp:1612
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getSphereLatLonPosition
proshade_double getSphereLatLonPosition(proshade_unsign lattitude, proshade_unsign longitude)
Accessor function for specific lattitude and longitude point of the sphere sampling grid.
Definition: ProSHADE_spheres.cpp:877
ProSHADE_internal_misc::checkMemoryAllocation
void checkMemoryAllocation(chVar checkVar, std::string fileP, unsigned int lineP, std::string funcP, std::string infoP="This error may occurs when ProSHADE requests memory to be\n : allocated to it and this operation fails. This could\n : happen when not enough memory is available, either due to\n : other processes using a lot of memory, or when the machine\n : does not have sufficient memory available. Re-run to see\n : if this problem persists.")
Checks if memory was allocated properly.
Definition: ProSHADE_misc.hpp:73
ProSHADE_internal_misc::addToUnsignVector
void addToUnsignVector(std::vector< proshade_unsign > *vecToAddTo, proshade_unsign elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:99