37#ifndef TRIUMVIRATE_INCLUDE_FIELD_HPP_INCLUDED_
38#define TRIUMVIRATE_INCLUDE_FIELD_HPP_INCLUDED_
93 const std::string&
name =
"mesh-field"
109 fftw_plan& transform, fftw_plan& inv_transform,
110 const std::string&
name =
"mesh-field"
136 const fftw_complex&
operator[](
long long gid);
223 double alpha,
int ell,
int m
240 double alpha,
int ell,
int m
277 double alpha,
int ell,
int m
294 double alpha,
int ell,
int m
362 MeshField& field_fourier, std::vector< std::complex<double> >& ylm,
363 double k_band,
double dk_band,
364 double& k_eff,
int& nmodes
389 std::vector< std::complex<double> >& ylm,
413 std::vector<double> window;
415 int window_assign_order = -1;
418 fftw_complex* field_s =
nullptr;
423 fftw_plan transform_s;
425 fftw_plan inv_transform;
427 bool plan_ini =
false;
428 bool plan_ext =
false;
442 long long ret_grid_index(
int i,
int j,
int k);
449 void shift_grid_indices_fourier(
int& i,
int& j,
int& k);
457 void get_grid_pos_vector(
int i,
int j,
int k,
double rvec[3]);
465 void get_grid_wavevector(
int i,
int j,
int k,
double kvec[3]);
478 void assign_weighted_field_to_mesh_ngp(
489 void assign_weighted_field_to_mesh_cic(
500 void assign_weighted_field_to_mesh_tsc(
511 void assign_weighted_field_to_mesh_pcs(
524 double calc_assignment_window_in_fourier(
int i,
int j,
int k,
int order = 0);
534 void compute_assignment_window_in_fourier(
int order = 0);
554 std::vector<double>
k;
555 std::vector<double>
r;
557 std::vector< std::complex<double> >
sn;
559 std::vector< std::complex<double> >
pk;
561 std::vector< std::complex<double> >
xi;
681 std::vector< std::complex<double> >& ylm_a,
682 std::vector< std::complex<double> >& ylm_b,
683 std::complex<double> shotnoise_amp,
726 std::vector< std::complex<double> >& ylm_a,
727 std::vector< std::complex<double> >& ylm_b,
730 std::complex<double> shotnoise_amp,
731 double k_a,
double k_b
752 fftw_complex* twopt_3d =
nullptr;
754 fftw_plan inv_transform;
756 bool plan_ini =
false;
759 std::vector<double> alias_sn;
761 bool alias_ini =
false;
781 void resize_stats(
int num_bins);
791 long long ret_grid_index(
int i,
int j,
int k);
800 void shift_grid_indices_fourier(
int& i,
int& j,
int&
k);
817 std::function<double(
int,
int,
int)> ret_calc_shotnoise_aliasing();
826 void get_shotnoise_aliasing_sin2(
827 int i,
int j,
int k,
double& cx2,
double& cy2,
double& cz2
837 double calc_shotnoise_aliasing_ngp(
int i,
int j,
int k);
846 double calc_shotnoise_aliasing_cic(
int i,
int j,
int k);
855 double calc_shotnoise_aliasing_tsc(
int i,
int j,
int k);
864 double calc_shotnoise_aliasing_pcs(
int i,
int j,
int k);
870 void compute_shotnoise_aliasing();
Isotropic coordinate binning.
Field (pseudo-two-point) statistics.
std::vector< std::complex< double > > sn
shot-noise power in bins
void reset_stats()
Reset two-point statistics.
std::vector< std::complex< double > > pk
pseudo power spectrum in bins
void compute_uncoupled_shotnoise_for_3pcf(MeshField &field_a, MeshField &field_b, std::vector< std::complex< double > > &ylm_a, std::vector< std::complex< double > > &ylm_b, std::complex< double > shotnoise_amp, trv::Binning &rbinning)
Compute binned uncoupled three-point correlation function shot noise.
std::complex< double > compute_uncoupled_shotnoise_for_bispec_per_bin(MeshField &field_a, MeshField &field_b, std::vector< std::complex< double > > &ylm_a, std::vector< std::complex< double > > &ylm_b, trvm::SphericalBesselCalculator &sj_a, trvm::SphericalBesselCalculator &sj_b, std::complex< double > shotnoise_amp, double k_a, double k_b)
Compute unbinned uncoupled bispectrum shot noise on the FFT mesh grid.
~FieldStats()
Destruct two-point statistics.
std::vector< int > nmodes
number of wavevector modes in bins
FieldStats(trv::ParameterSet ¶ms, bool plan_ini=true)
Construct pseudo two-point statistics.
std::vector< double > k
average wavenumber in bins
std::vector< std::complex< double > > xi
pseudo two-point correlation function in bins
std::vector< int > npairs
number of separation pairs in bins
void compute_ylm_wgtd_2pt_stats_in_fourier(MeshField &field_a, MeshField &field_b, std::complex< double > shotnoise_amp, int ell, int m, trv::Binning &kbinning)
Compute binned two-point statistics in Fourier space.
trv::BinnedVectors record_binned_vectors(trv::Binning &binning, const std::string &save_file)
Record binned vectors given a binning scheme.
void compute_ylm_wgtd_2pt_stats_in_config(MeshField &field_a, MeshField &field_b, std::complex< double > shotnoise_amp, int ell, int m, trv::Binning &rbinning)
Compute binned two-point statistics in configuration space.
Discretely sampled field on a mesh grid from particle catalogues.
trv::ParameterSet params
parameter set
void inv_fourier_transform()
Inverse Fourier transform the (FFT-transformed) field.
void inv_fourier_transform_sjl_ylm_wgtd_field(MeshField &field_fourier, std::vector< std::complex< double > > &ylm, trvm::SphericalBesselCalculator &sjl, double r)
Inverse Fourier transform a field weighted by the spherical Bessel function and reduced spherical ha...
std::string name
field name
void assign_weighted_field_to_mesh(ParticleCatalogue &particles, fftw_complex *weights)
Assign a weighted field to a mesh by interpolation scheme.
double calc_grid_based_powlaw_norm(ParticleCatalogue &particles, int order)
void reset_density_field()
(Re-)initialise the complex field (and its shadow) on mesh.
void inv_fourier_transform_ylm_wgtd_field_band_limited(MeshField &field_fourier, std::vector< std::complex< double > > &ylm, double k_band, double dk_band, double &k_eff, int &nmodes)
Inverse Fourier transform a field weighted by the reduced spherical harmonics restricted to a wavenu...
double dr[3]
grid size in each dimension
void fourier_transform()
Fourier transform the field.
void compute_ylm_wgtd_field(ParticleCatalogue &particles_data, ParticleCatalogue &particles_rand, LineOfSight *los_data, LineOfSight *los_rand, double alpha, int ell, int m)
Compute the weighted field (fluctuations) further weighted by the reduced spherical harmonics.
void compute_unweighted_field(ParticleCatalogue &particles)
Compute the unweighted field.
void apply_wide_angle_pow_law_kernel()
Apply wide-angle correction kernel in configuration space.
void compute_ylm_wgtd_quad_field(ParticleCatalogue &particles_data, ParticleCatalogue &particles_rand, LineOfSight *los_data, LineOfSight *los_rand, double alpha, int ell, int m)
Compute the quadratic weighted field (fluctuations) further weighted by the reduced spherical harmoni...
fftw_complex * field
complex field on mesh
MeshField(trv::ParameterSet ¶ms, bool plan_ini=true, const std::string &name="mesh-field")
Construct the mesh field.
void compute_unweighted_field_fluctuations_insitu(ParticleCatalogue &particles)
Compute the unweighted field fluctuations.
double dk[3]
fundamental wavenumber in each dimension
~MeshField()
Destruct the mesh field.
double vol_cell
mesh grid cell volume
void apply_assignment_compensation()
Apply compensation needed after Fourier transform for assignment schemes.
const fftw_complex & operator[](long long gid)
Return mesh field grid cell value.
Interpolated spherical Bessel function of the first kind.
Clustering measurement data objects.
I/O support including custom exceptions and utility functions.
Mathematical calculations.
Provide tracking of program resources and exceptions.
Program parameter configuration.
Particle containers with I/O methods and operations.