sfof
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
FoF Class Reference

Class for perfoming friends-of-friends cluster detection. More...

#include <fof_class.hpp>

Public Member Functions

 FoF (int max_ngal_val)
 Initialise FoF instance. More...
 
void setup (double, double, const std::string &)
 This method sets-up a FoF instance. More...
 
void remove (int)
 This method removes Cluster instances that have too few member Galaxy instances. More...
 
int friends_of_friends (int, const std::vector< Zbin > &, std::vector< Galaxy > &, const Kdtree &)
 This method performs a friends-of-friends search for Cluster instances in a given Zbin instance. More...
 

Public Attributes

std::vector< Clusterlist_of_clusters
 Vector of Cluster instances. More...
 

Private Member Functions

bool bin_check (int, const std::vector< int > &)
 This method checks if a Galaxy instance is compatible with a given Zbin instance. More...
 
bool friendship (const Zbin &, const Galaxy &, const Galaxy &, double)
 This method checks if two Galaxy instances satisfy the linking conditions in a given Zbin instance. More...
 
void new_cluster (const Zbin &, Galaxy *, Galaxy *)
 This method creates a new Cluster instance. More...
 
void add_member (const Zbin &, Galaxy *, Cluster &)
 This method adds a new member Galaxy instance to an existing Cluster instance. More...
 
int find_friends (const Zbin &, Galaxy &, double, std::vector< Galaxy > &, const Kdtree &)
 This method finds Galaxy instances linked to a given Galaxy instance in a given Zbin instance. More...
 
int find_friends_of_friends (const Zbin &, Cluster &, double, std::vector< Galaxy > &, const Kdtree &)
 This method finds Galaxy instances linked to the members of a given Cluster instance in a given Zbin instance. More...
 

Private Attributes

Astro astro
 Include Astro class. More...
 
int cluster_count
 Count of current number of Cluster instances. More...
 
int max_ngal
 Maximum number of cluster members. More...
 
double link_r
 Transverse linking parameter. More...
 
double link_z
 Line-of-sight linking parameter. More...
 
std::string mode
 FoF mode ["spec"/"phot"]. More...
 

Detailed Description

Class for perfoming friends-of-friends cluster detection.

This class produces a vector of Cluster instances by performing a friends-of-friends search in a given Zbin instance.

Constructor & Destructor Documentation

◆ FoF()

FoF::FoF ( int  max_ngal_val)

Initialise FoF instance.

Member Function Documentation

◆ add_member()

void FoF::add_member ( const Zbin zbin,
Galaxy gal,
Cluster cluster 
)
private

This method adds a new member Galaxy instance to an existing Cluster instance.

Parameters
[in]zbinZbin instance.
[in]galGalaxy instance.
[in]clusterCluster instance.

◆ bin_check()

bool FoF::bin_check ( int  bin_num,
const std::vector< int > &  gal_bins 
)
private

This method checks if a Galaxy instance is compatible with a given Zbin instance.

Parameters
[in]bin_numBin number.
[in]gal_binsGalaxy bins.

◆ find_friends()

int FoF::find_friends ( const Zbin zbin,
Galaxy gal,
double  rfriend,
std::vector< Galaxy > &  gal_list,
const Kdtree tree 
)
private

This method finds Galaxy instances linked to a given Galaxy instance in a given Zbin instance.

Parameters
[in]zbinZbin instance.
[in]galGalaxy instance.
[in]rfriendR_friend value.
[in]gal_listVector of Galaxy instances.
[in]treeVector of Kdtree node instances.

Function to find galaxies linked to the galaxy in question.

< Loop through kd-tree nodes

< Create new cluster

◆ find_friends_of_friends()

int FoF::find_friends_of_friends ( const Zbin zbin,
Cluster cluster,
double  rfriend,
std::vector< Galaxy > &  gal_list,
const Kdtree tree 
)
private

This method finds Galaxy instances linked to the members of a given Cluster instance in a given Zbin instance.

Parameters
[in]zbinZbin instance.
[in]clusterCluster instance.
[in]rfriendR_friend value.
[in]gal_listVector of Galaxy instances.
[in]treeVector of Kdtree node instances.

◆ friends_of_friends()

int FoF::friends_of_friends ( int  bin_num,
const std::vector< Zbin > &  zbin_list,
std::vector< Galaxy > &  gal_list,
const Kdtree tree 
)

This method performs a friends-of-friends search for Cluster instances in a given Zbin instance.

Parameters
[in]bin_numZbin number.
[in]zbin_listVector of Zbin instances.
[in]gal_listVector of Galaxy instances.
[in]treeVector of Kdtree node instances.

◆ friendship()

bool FoF::friendship ( const Zbin zbin,
const Galaxy gal1,
const Galaxy gal2,
double  rfriend 
)
private

This method checks if two Galaxy instances satisfy the linking conditions in a given Zbin instance.

Parameters
[in]zbinZbin instance.
[in]gal1Galaxy instance 1.
[in]gal2Galaxy instance 2.
[in]rfriendR_friend value.

◆ new_cluster()

void FoF::new_cluster ( const Zbin zbin,
Galaxy gal1,
Galaxy gal2 
)
private

This method creates a new Cluster instance.

Parameters
[in]zbinZbin instance.
[in]gal1Galaxy instance 1.
[in]gal2Galaxy instance 2.

◆ remove()

void FoF::remove ( int  min_ngal)

This method removes Cluster instances that have too few member Galaxy instances.

Parameters
[in]min_ngalMinimum number of member Galaxy instances required.

◆ setup()

void FoF::setup ( double  link_r_val,
double  link_z_val,
const std::string &  mode_val 
)

This method sets-up a FoF instance.

Parameters
[in]link_r_valTransverse linking parameter value.
[in]link_z_valLine-of-sight linking parameter value.
[in]mode_valFoF mode ["spec"/"phot"].

Member Data Documentation

◆ astro

Astro FoF::astro
private

Include Astro class.

◆ cluster_count

int FoF::cluster_count
private

Count of current number of Cluster instances.

◆ link_r

double FoF::link_r
private

Transverse linking parameter.

◆ link_z

double FoF::link_z
private

Line-of-sight linking parameter.

◆ list_of_clusters

std::vector<Cluster> FoF::list_of_clusters

Vector of Cluster instances.

◆ max_ngal

int FoF::max_ngal
private

Maximum number of cluster members.

◆ mode

std::string FoF::mode
private

FoF mode ["spec"/"phot"].


The documentation for this class was generated from the following files: