FML
|
This namespace deals with reading and writing files to disc. More...
Namespaces | |
namespace | GADGET |
Reading and writing GADGET files (DM only). | |
namespace | RAMSES |
Reading RAMSES files (DM only). | |
Data Structures | |
struct | FileFormatPowerCAMB |
The format of a CAMB P(k) file. More... | |
struct | FileFormatTransferCAMB |
The format of a CAMB transfer function file. More... | |
class | LinearTransferData |
This class reads transfer/power-spectrum data from the output of a Einstein-Boltzmann solver. More... | |
class | LuaFileParser |
Read Lua scripts. More... | |
Typedefs | |
using | DVector = FML::INTERPOLATION::SPLINE::DVector |
using | Spline = FML::INTERPOLATION::SPLINE::Spline |
using | DVector2D = FML::INTERPOLATION::SPLINE::DVector2D |
using | Spline2D = FML::INTERPOLATION::SPLINE::Spline2D |
Functions | |
DVector2D | read_regular_ascii (std::string filename, int ncols, std::vector< int > cols_to_keep, int nskip, size_t nestimated_lines=10000) |
Read a regular ascii files with nskip header lines and containing ncol collums nestimated_lines is the amount we allocate for originally. More... | |
DVector2D | read_regular_ascii_subsampled (std::string filename, int ncols, std::vector< int > cols_to_keep, int nskip, size_t nestimated_lines=10000, double fraction_to_read=1.0, unsigned int randomSeed=1234) |
As above, but include every line read with probabillity fraction_to_read. More... | |
std::pair< DVector, DVector > | read_file_and_extract_two_columns (std::string filename, int col1, int col2) |
Read a regular file and extract two columns (numbering starting with 0) More... | |
DVector2D | loadtxt (std::string filename, int nreserve_rows, int nreserve_cols) |
Similar to pythons loadtxt function Gives warning if file is not regular Skips lines starting with #, ! or /. More... | |
std::pair< DVector, DVector > | read_file_and_extract_two_columns (int col1, int col2) |
Read a regular file and extract two columns (numbering starting with 0) More... | |
This namespace deals with reading and writing files to disc.
typedef std::vector< double > FML::FILEUTILS::DVector |
Definition at line 13 of file CAMBReader.h.
typedef std::vector< DVector > FML::FILEUTILS::DVector2D |
Definition at line 15 of file CAMBReader.h.
using FML::FILEUTILS::Spline = typedef FML::INTERPOLATION::SPLINE::Spline |
Definition at line 14 of file CAMBReader.h.
using FML::FILEUTILS::Spline2D = typedef FML::INTERPOLATION::SPLINE::Spline2D |
Definition at line 16 of file CAMBReader.h.
DVector2D FML::FILEUTILS::loadtxt | ( | std::string | filename, |
int | nreserve_rows, | ||
int | nreserve_cols | ||
) |
Similar to pythons loadtxt function Gives warning if file is not regular Skips lines starting with #, ! or /.
Similar to pythons loadtxt.
Definition at line 189 of file FileUtils.cpp.
std::pair< DVector, DVector > FML::FILEUTILS::read_file_and_extract_two_columns | ( | int | col1, |
int | col2 | ||
) |
Read a regular file and extract two columns (numbering starting with 0)
std::pair< DVector, DVector > FML::FILEUTILS::read_file_and_extract_two_columns | ( | std::string | filename, |
int | col1, | ||
int | col2 | ||
) |
Read a regular file and extract two columns (numbering starting with 0)
Definition at line 175 of file FileUtils.cpp.
DVector2D FML::FILEUTILS::read_regular_ascii | ( | std::string | filename, |
int | ncols, | ||
std::vector< int > | cols_to_keep, | ||
int | nskip, | ||
size_t | nestimated_lines = 10000 |
||
) |
Read a regular ascii files with nskip header lines and containing ncol collums nestimated_lines is the amount we allocate for originally.
Reallocated if file is larger Not perfect for realy large files due to all the allocations we have to do
Definition at line 14 of file FileUtils.cpp.
DVector2D FML::FILEUTILS::read_regular_ascii_subsampled | ( | std::string | filename, |
int | ncols, | ||
std::vector< int > | cols_to_keep, | ||
int | nskip, | ||
size_t | nestimated_lines, | ||
double | fraction_to_read, | ||
unsigned int | randomSeed | ||
) |
As above, but include every line read with probabillity fraction_to_read.
Definition at line 92 of file FileUtils.cpp.