changed the way powerlaw drawing alpha is limited
This commit is contained in:
@@ -37,6 +37,8 @@ VelocityDistributionFromDensityField::VelocityDistributionFromDensityField(
|
||||
pitchAngleBinBorders_(density_field->pitchAngleBinning()->binBorders()),
|
||||
theta_distribution_(std::uniform_real_distribution<double>(0.,1.)),
|
||||
mass_kg_(mass_kg) {
|
||||
alpha_lower_limit = -300/std::log10(energyBinBorders_.front());
|
||||
alpha_upper_limit = 300/std::log10(energyBinBorders_.back());
|
||||
// necessary to include the underflow bin in the energy domain
|
||||
energyBinBorders_.insert(energyBinBorders_.begin(), 0);
|
||||
}
|
||||
@@ -243,7 +245,8 @@ CartesianVector VelocityDistributionFromDensityField::drawVelocity(
|
||||
energyBinBorders_[index(4) + 1]);
|
||||
}
|
||||
|
||||
alpha = std::abs(alpha) > 100 ?(alpha/std::abs(alpha))*100 : alpha;
|
||||
// alpha = std::abs(alpha) > 100 ?(alpha/std::abs(alpha))*100 : alpha;
|
||||
alpha = std::min(std::max(alpha, alpha_lower_limit), alpha_upper_limit);
|
||||
|
||||
if(alpha == -1) {
|
||||
energy_eV = std::pow(energyBinBorders_[index(4) + 2]
|
||||
@@ -290,6 +293,15 @@ CartesianVector VelocityDistributionFromDensityField::drawVelocity(
|
||||
std::stringstream out;
|
||||
out << "pitchAngle: " << pitchAngle;
|
||||
out << "\nenergy value: " << energy_eV;
|
||||
out << "\nalpha: " << alpha;
|
||||
out << "\ncurrent index: " << index;
|
||||
out << "\nNl: " << density_field_->particleNumber(index);
|
||||
out << "\nNl: " << density_field_->particleNumber(index +
|
||||
blitz::TinyVector<int, 5>(0,0,0,0,1));
|
||||
out << "\nEl: " << energyBinBorders_[index(4) + 1];
|
||||
out << "\nEr: " << energyBinBorders_[index(4) + 2];
|
||||
out << "\nEl^(alpha+1): " << std::pow(energyBinBorders_[index(4) + 1], alpha + 1);
|
||||
out << "\nEr^(alpha+1): " << std::pow(energyBinBorders_[index(4) + 2], alpha + 1);
|
||||
// out << "\nenergy values: " << energyValues;
|
||||
// out << "\npitch angle values: " << pitchAngleValues;
|
||||
out << "\nenergy bin borders: [ ";
|
||||
|
||||
Reference in New Issue
Block a user