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

Class for file input and output. More...

#include <fileio_class.hpp>

Public Member Functions

void set_up (int, int, int, int)
 This method sets the column numbers where galaxy properties are stored in the input file. More...
 
void set_up (int, int, int, int, int)
 This method sets the column numbers where galaxy properties are stored in the input file. More...
 
void split (const std::string &, std::vector< std::string > &, const std::string &)
 This method splits a string into columns. More...
 
void read_ascii (const std::string &, const std::string &, double, double, double, std::vector< Galaxy > &)
 This method reads in an ASCII file and store the contents in a vector of Galaxy instances. More...
 
void read_fits (const std::string &, const std::string &, double, double, double, std::vector< Galaxy > &)
 This method reads in a FITS file and store the contents in a vector of Galaxy instances. More...
 
void output_cluster_name (const std::string &, const std::string &, const std::string &, double, double, std::string &)
 This method sets the cluster output file name. More...
 
void output_member_name (const std::string &, const std::string &, const std::string &, double, double, std::string &)
 This method sets the member output file name. More...
 
void write_ascii (const std::vector< Cluster > &, const std::string &, const std::string &)
 This method writes a list of the specified Cluster instances and a list of the corresponding member Galaxy instances to two ASCII files. More...
 
void write_fits (const std::vector< Cluster > &, const std::string &, const std::string &)
 This method writes a list of the specified Cluster instances and a list of the corresponding member Galaxy instances to two FITS files. More...
 
void read_nz_data (const std::string &, std::vector< double > &, std::vector< double > &)
 This method reads N(z) data from a file. More...
 

Private Attributes

int id_col
 Column number for galaxy ID. More...
 
int ra_col
 Column number for galaxy right ascension. More...
 
int dec_col
 Column number for galaxy declination. More...
 
int z_col
 Column number for galaxy redshift. More...
 
int z_err_col
 Column number for galaxy photometric redshift error. More...
 

Detailed Description

Class for file input and output.

This class contains functions for reading and writing ASCII and FITS files.

Member Function Documentation

◆ output_cluster_name()

void Fileio::output_cluster_name ( const std::string &  fname,
const std::string &  mode,
const std::string &  output,
double  link_r,
double  link_z,
std::string &  cluster_file_name 
)

This method sets the cluster output file name.

Parameters
[in]fnameInput file name.
[in]modeFoF mode ["spec"/"phot"].
[in]outputOuput mode ["ascii"/"fits"].
[in]link_rTransverse linking parameter value.
[in]link_zLine-of-sight linking parameter value.
[out]cluster_file_nameOutput Cluster list file name.

◆ output_member_name()

void Fileio::output_member_name ( const std::string &  fname,
const std::string &  mode,
const std::string &  output,
double  link_r,
double  link_z,
std::string &  member_file_name 
)

This method sets the member output file name.

Parameters
[in]fnameInput file name.
[in]modeFoF mode ["spec"/"phot"].
[in]outputOuput mode ["ascii"/"fits"].
[in]link_rTransverse linking parameter value.
[in]link_zLine-of-sight linking parameter value.
[out]member_file_nameOutput member Galaxy list file name.

◆ read_ascii()

void Fileio::read_ascii ( const std::string &  fname,
const std::string &  mode,
double  z_min,
double  z_max,
double  z_err_max,
std::vector< Galaxy > &  gals 
)

This method reads in an ASCII file and store the contents in a vector of Galaxy instances.

Parameters
[in]fnameInput file name.
[in]modeFoF mode ["spec"/"phot"].
[in]z_minMinimum redshift allowed.
[in]z_maxMaximum redshift allowed.
[in]z_err_maxMaximum photometric redshift error allowed.
[out]galsVector of Galaxy instances.

◆ read_fits()

void Fileio::read_fits ( const std::string &  fname,
const std::string &  mode,
double  z_min,
double  z_max,
double  z_err_max,
std::vector< Galaxy > &  gals 
)

This method reads in a FITS file and store the contents in a vector of Galaxy instances.

Parameters
[in]fnameInput file name.
[in]modeFoF mode ["spec"/"phot"].
[in]z_minMinimum redshift allowed.
[in]z_maxMaximum redshift allowed.
[in]z_err_maxMaximum photometric redshift error allowed.
[out]galsVector of Galaxy instances.

◆ read_nz_data()

void Fileio::read_nz_data ( const std::string &  file_name,
std::vector< double > &  z_vals,
std::vector< double > &  count_vals 
)

This method reads N(z) data from a file.

Parameters
[in]file_nameN(z) data file name.
[out]z_valsRedshift values from N(z) data file.
[out]count_valsCount values from N(z) data file.

◆ set_up() [1/2]

void Fileio::set_up ( int  id_col_val,
int  ra_col_val,
int  dec_col_val,
int  z_col_val 
)

This method sets the column numbers where galaxy properties are stored in the input file.

[Spectroscopic mode]

Parameters
[in]id_col_valColumn number for galaxy ID.
[in]ra_col_valColumn number for galaxy right ascension.
[in]dec_col_valColumn number for galaxy declination.
[in]z_col_valColumn number for galaxy spectroscopic redshift.

◆ set_up() [2/2]

void Fileio::set_up ( int  id_col_val,
int  ra_col_val,
int  dec_col_val,
int  z_col_val,
int  z_err_col_val 
)

This method sets the column numbers where galaxy properties are stored in the input file.

[Photometric mode]

Parameters
[in]id_col_valColumn number for galaxy ID.
[in]ra_col_valColumn number for galaxy right ascension.
[in]dec_col_valColumn number for galaxy declination.
[in]z_col_valColumn number for galaxy photometric redshift.
[in]z_err_col_valColumn number for galaxy photometric redshift error.

◆ split()

void Fileio::split ( const std::string &  str,
std::vector< std::string > &  tokens,
const std::string &  delimiter 
)

This method splits a string into columns.

Parameters
[in]strString.
[out]tokensVector of column data.
[in]delimiterColumn delimiter.

◆ write_ascii()

void Fileio::write_ascii ( const std::vector< Cluster > &  cluster_list,
const std::string &  cluster_file_name,
const std::string &  member_file_name 
)

This method writes a list of the specified Cluster instances and a list of the corresponding member Galaxy instances to two ASCII files.

Parameters
[in]cluster_listVector of Cluster instances.
[in]cluster_file_nameOutput Cluster list file name.
[in]member_file_nameOutput member Galaxy list file name.

◆ write_fits()

void Fileio::write_fits ( const std::vector< Cluster > &  cluster_list,
const std::string &  cluster_file_name,
const std::string &  member_file_name 
)

This method writes a list of the specified Cluster instances and a list of the corresponding member Galaxy instances to two FITS files.

Parameters
[in]cluster_listVector of Cluster instances.
[in]cluster_file_nameOutput Cluster list file name.
[in]member_file_nameOutput member Galaxy list file name.

Member Data Documentation

◆ dec_col

int Fileio::dec_col
private

Column number for galaxy declination.

◆ id_col

int Fileio::id_col
private

Column number for galaxy ID.

◆ ra_col

int Fileio::ra_col
private

Column number for galaxy right ascension.

◆ z_col

int Fileio::z_col
private

Column number for galaxy redshift.

◆ z_err_col

int Fileio::z_err_col
private

Column number for galaxy photometric redshift error.


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