-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Continuous Flux Injection from Differential MCEq Profile as a new Body Class and Corresponding Updates #41
base: master
Are you sure you want to change the base?
Conversation
@@ -29,6 +29,7 @@ | |||
#include <stdexcept> | |||
#include <type_traits> | |||
#include <utility> | |||
#include <fstream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required for reading the datafile in line 966
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code is generally on the right track, and will be really great once we tune it up a bit.
This does need to be extended to handle anti-neutrinos. EmittingEarthAtm::injected_neutrino_flux
is currently hard-coded to only fill the rho=0
entries in the flux
array, but it should be mindful of whether the propagation is neutrinos only, anti-neutrinos only, or both together (which is the most common case people will want to calculate). The input data file should likewise be able to (and probably required to) provide anti-neutrino fluxes. Related to this, the nu_tau flux needs to be handled if the number of flavors is >= 3, even if just by explicitly setting it to zero, to prevent leaving garbage value in the flux array, and likewise any sterile flavors.
Since it would generally be odd to compute/predict neutrino fluxes without anti-neutrino fluxes, I propose that the text file format should always require them to be present together. It could then have a fixed set of abscissa columns (zenith angle, height, energy), and a variable number of ordinate columns for different neutrino flavors, but with the requirement that the number of ordinate columns should be even. If there are two columns (after the required three), they would be nu_e and nu_e_bar fluxes, if there are four they would be nu_e, nu_e_bar, nu_mu, nu_mu_bar, etc.
include/nuSQuIDS/body.h
Outdated
/// \brief indices for the electron and muon flavors | ||
/// defaulted to the first and second flavor states | ||
int E_nu_index = 0; | ||
int Mu_nu_index = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think E_nu_index
and Mu_nu_index
should be removed. We should use the usual implicit flavor ordering (nu_e, nu_mu, nu_tau). It would also be good to change all remaining comments an variable names to the standard form (e.g. correct E_nu
to nu_e
).
adjust EmittingEarthAtm implementation
adjustments to EmittingEarthAtm implementation
update description of requirements for user supplied data file
Ok. I believe I've fixed all of these except the removal of the ability to
change the nu_e and nu_mu indices. However, I did not include the ability
to change them in the example file and I added multiple warnings in body.h
telling the user what else they need to do in order to safely use the
function that redefines the indices. Attached is a google drive link to
the new data file with antineutrino fluxes as well, to replace the old one
in the same folder.
PROD_MODEL_MCEQ.dat
<https://drive.google.com/file/d/15iCA9PpLWriVlSVG1TAHmuLRj8VY8a8q/view?usp=drive_web>
…On Tue, Nov 14, 2023 at 9:49 AM C. Weaver ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/body.cpp
<#41 (comment)>:
> + heights.resize(0,atm_heights.size());
+ for (unsigned int i=0; i < height_number; i++){
+ heights[i] = atm_heights[i];
+ }
+
+ unique_sort(atm_energy, energy_min, energy_max, energy_number);
+ energies.resize(0,atm_energy.size());
+ for (unsigned int i=0; i < energy_number; i++){
+ energies[i] = atm_energy[i];
+ }
+
+ marray<double, 3> nuEmatrix{czen_number, height_number, energy_number};
+ marray<double, 3> nuMumatrix{czen_number, height_number, energy_number};
+
+
+ std::ifstream InputFile(filepath);
We shouldn't read the file again; unless I misunderstand we already have
all of this data in atm_prod_model, so at a minimum we should loop over
that instead of repaeting all of the text parsing.
—
Reply to this email directly, view it on GitHub
<#41 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH46WOKPBB6NQYDISRTXTA3YEOAIPAVCNFSM6AAAAAA7B4YA76VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMRZHEZDKNBZGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Adds a new body type EmittingEarthAtm as a derived class from EarthAtm in both body.h and body.cpp that uses TriCubicInterpolator to calculate the differential flux production dependent on coszen, heaght, and energy in the atmosphere.
Modifies nuSQUIDSAtm to allow for a second template that is derived from EarthAtm.
Updates how nuSQUIDSAtm checks for the base class of a template.
Adds functions to nuSQUIDSAtm to allow for the manipulation of the class in the body template.
Adds a new file in examples to that explains the use of nuSQUIDSAtm with the EmittingEarthAtm class.
Adds this example to the configure file so it appears with the old examples in the makefile.
To be added: a new file in data called "atmos_prod" that should contain the differential flux production profile. All data has been calculated, but is currently too large in .dat format to upload.