Class TabularPhotonField

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class TabularPhotonField : public PhotonField

Photon field decorator for tabulated photon fields.

This class reads photon field data from files; The first file must be a list of photon energies [J], named fieldName_photonEnergy.txt The second file must be a list of comoving photon field densities [1/m^3], named fieldName_photonDensity.txt Optionally, a third file contains redshifts, named fieldName_redshift.txt

Subclassed by IRB_Dominguez11, IRB_Finke10, IRB_Franceschini08, IRB_Gilmore12, IRB_Kneiske04, IRB_Stecker05, IRB_Stecker16_lower, IRB_Stecker16_upper

Public Functions

TabularPhotonField(const std::string fieldName, const bool isRedshiftDependent = true)
double getPhotonDensity(double ePhoton, double z = 0.) const

returns comoving photon density [1/m^3]. multiply with (1+z^3) for physical number density.

Parameters
  • ePhoton: photon energy [J]
  • z: redshift (if redshift dependent, default = 0.)

double getRedshiftScaling(double z) const

returns overall comoving scaling factor (cf. CRPropa3-data/calc_scaling.py)

Parameters
  • z: redshift

bool hasRedshiftDependence() const
std::string getFieldName() const
size_t addReference() const
size_t removeReference() const
int removeReferenceNoDelete() const
size_t getReferenceCount() const

Protected Functions

void readPhotonEnergy(std::string filePath)
void readPhotonDensity(std::string filePath)
void readRedshift(std::string filePath)
void initRedshiftScaling()
void checkInputData() const

Protected Attributes

std::vector<double> photonEnergies
std::vector<double> photonDensity
std::vector<double> redshifts
std::vector<double> redshiftScalings
std::string fieldName
bool isRedshiftDependent
size_t _referenceCount