|
Triumvirate C++ API 0.5.0.post1.dev301+g026f21751
Three-point clustering measurements in large-scale structure analyses.
|
Particle catalogue. More...
#include <particles.hpp>
Collaboration diagram for trv::ParticleCatalogue:Public Member Functions | |
| ParticleCatalogue (int verbose=-1) | |
| Construct the particle catalogue with initial values. | |
| ~ParticleCatalogue () | |
| Destruct the particle catalogue. | |
| void | initialise_particles (const int num) |
| Initialise particle data container. | |
| void | finalise_particles () |
| Finalise particle data container. | |
| void | reset_particles () |
| Reset particle data container. | |
| ParticleData & | operator[] (const int pid) |
| Return individual particle information. | |
| int | load_catalogue_file (const std::string &catalogue_filepath, const std::string &catalogue_columns, const std::string &catalogue_dataset="", double volume=0.) |
| Read in a catalogue file. | |
| int | load_particle_data (std::vector< double > x, std::vector< double > y, std::vector< double > z, std::vector< double > nz, std::vector< double > ws, std::vector< double > wc) |
| Read in particle data. | |
| void | calc_total_weights () |
| Calculate total overall weight of particles. | |
| void | calc_pos_extents (bool init=true) |
| Calculate the extents of particle positions. | |
| void | offset_coords (const double dpos[3]) |
| Offset particle positions by a given vector. | |
| void | offset_coords_for_periodicity (const double boxsize[3]) |
| Offset particle positions for periodic boundary conditions. | |
Static Public Member Functions | |
| static void | centre_in_box (ParticleCatalogue &catalogue, const double boxsize[3]) |
| Centre a catalogue in a box. | |
| static void | centre_in_box (ParticleCatalogue &catalogue, ParticleCatalogue &catalogue_ref, const double boxsize[3]) |
| Centre a pair of catalogues in a box. | |
| static void | pad_in_box (ParticleCatalogue &catalogue, const double boxsize[3], const double boxsize_pad[3]) |
| Pad a catalogue in a box. | |
| static void | pad_in_box (ParticleCatalogue &catalogue, ParticleCatalogue &catalogue_ref, const double boxsize[3], const double boxsize_pad[3]) |
| Pad a pair of catalogues in a box. | |
| static void | pad_grids (ParticleCatalogue &catalogue, const double boxsize[3], const int ngrid[3], const double ngrid_pad[3]) |
| Pad a catalogue in a box. | |
| static void | pad_grids (ParticleCatalogue &catalogue, ParticleCatalogue &catalogue_ref, const double boxsize[3], const int ngrid[3], const double ngrid_pad[3]) |
| Pad a catalogue in a box. | |
Public Attributes | |
| std::string | source |
| catalogue source | |
| ParticleData * | pdata = nullptr |
| particle data | |
| int | ntotal = 0 |
| total number of particles | |
| double | wtotal = 0. |
| total overall weight of particles | |
| double | wstotal = 0. |
| total sample weight of particles | |
| double | pos_min [3] = {0., 0., 0.} |
| minimum particle coordinates | |
| double | pos_max [3] = {0., 0., 0.} |
| maximum particle coordinates | |
| double | pos_span [3] = {0., 0., 0.} |
| span of particle coordinates | |
Particle catalogue.
The catalogue object contains particle data and summary information, as well as methods for computing its attributes.
Definition at line 78 of file particles.hpp.
|
explicit |
Construct the particle catalogue with initial values.
| verbose | Logger verbosity (default is -1 for no change). |
verbose is optional and used to control the logging level when an instance is created as a standalone without ParameterSet . Definition at line 39 of file particles.cpp.
Here is the caller graph for this function:| trv::ParticleCatalogue::~ParticleCatalogue | ( | ) |
Destruct the particle catalogue.
Definition at line 45 of file particles.cpp.
Here is the call graph for this function:| void trv::ParticleCatalogue::initialise_particles | ( | const int | num | ) |
Initialise particle data container.
| num | Number of data units (i.e. particles). |
Definition at line 47 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void trv::ParticleCatalogue::finalise_particles | ( | ) |
Finalise particle data container.
Definition at line 68 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void trv::ParticleCatalogue::reset_particles | ( | ) |
Reset particle data container.
This is an explicit method to free the resources occupied by trv::ParticleCatalogue::pdata and may be called outside the class destructor.
Definition at line 72 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| ParticleData & trv::ParticleCatalogue::operator[] | ( | const int | pid | ) |
Return individual particle information.
| pid | Particle index. |
Definition at line 85 of file particles.cpp.
| int trv::ParticleCatalogue::load_catalogue_file | ( | const std::string & | catalogue_filepath, |
| const std::string & | catalogue_columns, | ||
| const std::string & | catalogue_dataset = "", | ||
| double | volume = 0. ) |
Read in a catalogue file.
| catalogue_filepath | Catalogue file path. |
| catalogue_columns | Catalogue data column names (as a comma-separated list without space or an attribute name prefixed by "attr:"). |
| catalogue_dataset | Catalogue dataset name/path (default is empty; for HDF5 files only). |
| volume | Catalogue volume (default is 0.) used for computing the default 'nz' value when the field is missing. |
catalogue_dataset is empty for HDF5 files, the first dataset found is used (which may not be the intended one). catalogue_columns is empty for HDF5 files, the first dataset attribute found is used (which may not be the intended one). Definition at line 94 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| int trv::ParticleCatalogue::load_particle_data | ( | std::vector< double > | x, |
| std::vector< double > | y, | ||
| std::vector< double > | z, | ||
| std::vector< double > | nz, | ||
| std::vector< double > | ws, | ||
| std::vector< double > | wc ) |
Read in particle data.
| x,y,z,nz,ws,wc | Particle data by column. |
Definition at line 512 of file particles.cpp.
Here is the call graph for this function:| void trv::ParticleCatalogue::calc_total_weights | ( | ) |
Calculate total overall weight of particles.
Definition at line 570 of file particles.cpp.
Here is the caller graph for this function:| void trv::ParticleCatalogue::calc_pos_extents | ( | bool | init = true | ) |
Calculate the extents of particle positions.
| init | Initialisation flag (default is true). |
Definition at line 604 of file particles.cpp.
Here is the caller graph for this function:| void trv::ParticleCatalogue::offset_coords | ( | const double | dpos[3] | ) |
Offset particle positions by a given vector.
The position specified by the input vector is the new origin.
| dpos | (Subtractive) offset position vector. |
Definition at line 658 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void trv::ParticleCatalogue::offset_coords_for_periodicity | ( | const double | boxsize[3] | ) |
Offset particle positions for periodic boundary conditions.
| boxsize | Periodic box size in each dimension. |
Definition at line 678 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Centre a catalogue in a box.
| catalogue | Particle catalogue. |
| boxsize | Box size in each dimension. |
Definition at line 701 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Centre a pair of catalogues in a box.
The secondary catalogue's centre is used as the reference point to also offset the primary catalogue's particle positions.
| catalogue | Primary particle catalogue. |
| catalogue_ref | Secondary reference particle catalogue. |
| boxsize | Box size in each dimension. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 732 of file particles.cpp.
Here is the call graph for this function:
|
static |
Pad a catalogue in a box.
The amount of padding is a fraction of the box size.
| catalogue | Particle catalogue. |
| boxsize | Box size in each dimension. |
| boxsize_pad | Box size padding factor in each dimension. |
Definition at line 780 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Pad a pair of catalogues in a box.
The amount of padding is a fraction of the box size.
The secondary catalogue's extents are used as the reference points to also offset the primary catalogue's particle positions.
| catalogue | Primary particle catalogue. |
| catalogue_ref | Secondary reference particle catalogue. |
| boxsize | Box size in each dimension. |
| boxsize_pad | Box size padding factor in each dimension. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 809 of file particles.cpp.
Here is the call graph for this function:
|
static |
Pad a catalogue in a box.
The amount of padding is a multiple of the mesh grid size.
| catalogue | Particle catalogue. |
| boxsize | Box size in each dimension. |
| ngrid | Grid cell number in each dimension. |
| ngrid_pad | Grid cell number factor for padding. |
Definition at line 855 of file particles.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Pad a catalogue in a box.
The amount of padding is a multiple of the mesh grid size.
The secondary catalogue's extents are used as the reference points to also offset the primary catalogue's particle positions.
| catalogue | Primary particle catalogue. |
| catalogue_ref | Secondary reference particle catalogue. |
| boxsize | Box size in each dimension. |
| ngrid | Grid cell number in each dimension. |
| ngrid_pad | Grid cell number factor for padding. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 872 of file particles.cpp.
Here is the call graph for this function:| std::string trv::ParticleCatalogue::source |
catalogue source
Definition at line 80 of file particles.hpp.
| ParticleData* trv::ParticleCatalogue::pdata = nullptr |
particle data
Definition at line 82 of file particles.hpp.
| int trv::ParticleCatalogue::ntotal = 0 |
total number of particles
Definition at line 84 of file particles.hpp.
| double trv::ParticleCatalogue::wtotal = 0. |
total overall weight of particles
Definition at line 85 of file particles.hpp.
| double trv::ParticleCatalogue::wstotal = 0. |
total sample weight of particles
Definition at line 86 of file particles.hpp.
| double trv::ParticleCatalogue::pos_min[3] = {0., 0., 0.} |
minimum particle coordinates
Definition at line 88 of file particles.hpp.
| double trv::ParticleCatalogue::pos_max[3] = {0., 0., 0.} |
maximum particle coordinates
Definition at line 89 of file particles.hpp.
| double trv::ParticleCatalogue::pos_span[3] = {0., 0., 0.} |
span of particle coordinates
Definition at line 90 of file particles.hpp.