sfof
|
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... | |
Class for file input and output.
This class contains functions for reading and writing ASCII and FITS files.
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.
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.
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.
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.
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.
[in] | file_name | N(z) data file name. |
[out] | z_vals | Redshift values from N(z) data file. |
[out] | count_vals | Count values from N(z) data file. |
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]
[in] | id_col_val | Column number for galaxy ID. |
[in] | ra_col_val | Column number for galaxy right ascension. |
[in] | dec_col_val | Column number for galaxy declination. |
[in] | z_col_val | Column number for galaxy spectroscopic redshift. |
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]
[in] | id_col_val | Column number for galaxy ID. |
[in] | ra_col_val | Column number for galaxy right ascension. |
[in] | dec_col_val | Column number for galaxy declination. |
[in] | z_col_val | Column number for galaxy photometric redshift. |
[in] | z_err_col_val | Column number for galaxy photometric redshift error. |
void Fileio::split | ( | const std::string & | str, |
std::vector< std::string > & | tokens, | ||
const std::string & | delimiter | ||
) |
This method splits a string into columns.
[in] | str | String. |
[out] | tokens | Vector of column data. |
[in] | delimiter | Column delimiter. |
void Fileio::write_ascii | ( | const std::vector< Cluster > & | cluster_list, |
const std::string & | cluster_file_name, | ||
const std::string & | member_file_name | ||
) |
void Fileio::write_fits | ( | const std::vector< Cluster > & | cluster_list, |
const std::string & | cluster_file_name, | ||
const std::string & | member_file_name | ||
) |
|
private |
Column number for galaxy declination.
|
private |
Column number for galaxy ID.
|
private |
Column number for galaxy right ascension.
|
private |
Column number for galaxy redshift.
|
private |
Column number for galaxy photometric redshift error.