-
Notifications
You must be signed in to change notification settings - Fork 47
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
Rebase after Atlanta/PANE/Neutrino/thesis onslaught #502
Conversation
…to PISA events. Will now start to flesh out the details.
…vents in to nu vs nubar, and NC vs CC.
…ow it is minimally different to the existing one, but I'll start to add more significant changes now
…t (e.g. single layer of keys, possibility of non-neutrino events). Added a main function to events_pi.py so can print the contents of an events file easily.
… can see progress (takes a while)
…oherence.py and layers.py according to comments from pull request 472
…alculation. Including support for decoherence in this.
…o make offline plots. Also handles corner cases that previouslu choked the sytstem such as empty bins in histogram.
…in fit_discrete_sys_nd_new.py
Looks like some very useful additions and changes! I'm happy to take a closer look to review the changes. One request that i have regardless already:
|
Hi Philipp, thanks for taking a look. I agree it is nicer not to have In terms of the hyperplanes, it would be very straight forward I think to make this backwards compatible, I will do this and remove the In terms of the fitting script itself, it has all of the functionality of the old one and should just work. But it would be nice for someone to check it with their event sample files, maybe you, Feifei or Thomas could try this with the DRAGON files? The plotting of the hyperplanes is now external can be found in |
separating the plotting from the fitting is a good idea! And the new stage/fitting script completely replacing the old ones definitely the best solution....so I wait for you making these changes. In the meantime will take a look at all other files |
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 had a glance over the code and a couple of comments/questions/requests (except the hyperplane stuff, since this will be merged with the old stage, i take a look at it then).
Overall seems to be in not a bad shape
pisa/analysis/analysis.py
Outdated
|
||
def get_separate_t23_octant_params(hypo_maker,inflection_point) : | ||
|
||
#TODO Document |
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.
docstring to be added before merge
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.
Done
pisa/analysis/analysis.py
Outdated
@@ -375,30 +429,51 @@ def fit_hypo(self, data_dist, hypo_maker, hypo_param_selections, metric, | |||
# Saves the current minimizer start values for the octant check | |||
minimizer_start_params = hypo_maker.params | |||
|
|||
# Determine if checking theta23 octant | |||
peforming_octant_check = check_octant and 'theta23' in hypo_maker.params.free.names |
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.
is this supposed to be a comparison, i.e. ==
or an assignment operation (=
). I the latter is the case, split this up into separate statements for readability
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.
Alternative opinion: I think this code is clear in what it's doing
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.
ah, i read it wrong....maybe some parentheses could increase readability....or maybe it's just my lack of ability to read
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.
Done (parentheses added)
pisa/core/events_pi.py
Outdated
@@ -255,13 +259,17 @@ def keep_inbounds(self, binning): | |||
logging.debug("All inbounds criteria '%s' have already been" | |||
" applied. Returning events unmodified.", new_cuts) | |||
return self | |||
all_cuts = deepcopy(current_cuts) + unapplied_cuts |
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.
what is this variable for? cannot see it being used. Also there are a bit many deepcopy constructors called all over the place
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.
Realised looking at this function that it had fallen out of date. Updated now to call apply_cuts
to avoid code reproduction.
pisa/core/events_pi.py
Outdated
output_data[output_key] = collections.OrderedDict() | ||
for var_key,var_array in cat_data.items() : | ||
if var_key in output_data[output_key] : | ||
output_data[output_key][var_key] = np.append(output_data[output_key][var_key],var_array[mask]) |
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.
these are about 8 indentation levels, which is rather excessive. 😉 Can we try to simplify? E.g. make one loop instead of three. Also you could do if np.sum(mask) <= 0: continue
etc to make the code a bit less crazy
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.
Have made this function much nicer to look at. Also added a neutrinos
flag to the EventsPi
to toggle dedicated behaviour when loading events (defaults to true).
@@ -1,6 +1,9 @@ | |||
""" | |||
A Stage to load data from a PISA style hdf5 file into a PISA pi ContainerSet | |||
""" | |||
|
|||
#TODO This class is become dcereasingly "simple"! Make it into a more specific stage for our purposes and recreate a much more simple HDF5 file loader that is generic for any PISA task |
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.
maybe add this TODO to the issue tracker
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.
Done, see #503
#TODO Check inputs | ||
self.energy_nodes = energy_nodes | ||
self.coszen_nodes = coszen_nodes #TODO private? | ||
self.prob_e_buffer = np.full( self.shape, np.NaN ) |
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.
dtype?
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.
Currently this code is commented out, may end up being removed but doesn't affect anything right now
elif self.num_decoherence_gamma == 3 : | ||
self.osc_params.gamma21 = self.params.gamma21.value.m_as('eV') | ||
self.osc_params.gamma31 = self.params.gamma31.value.m_as('eV') | ||
self.osc_params.gamma32 = self.params.gamma32.value.m_as('eV') |
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.
what happens else
?
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.
num_decoherence_gamma
is enforced to be 1 or 3 in __init__
pisa/stages/osc/pi_nusquids.py
Outdated
self.osc_params.eps_tautau = 0. | ||
''' | ||
|
||
import datetime |
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.
imports should be at beginning of module
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.
Furthermore, you should use time
not datetime
for timings. and use the logging
module, don't put print
statements that you comment out. In other words: either remove all of the timing stuff, or use time
and logging
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.
Sorry, forgot to remove this. This was a quick bit of debugging on my side.
pisa/stages/osc/pi_nusquids.py
Outdated
prob_e_buff,prob_mu_buff = container['prob_e'].get(WHERE), container['prob_mu'].get(WHERE) | ||
|
||
# Get the oscillation probs, writing them to the container | ||
_,_ = osc_probs( # pylint: disable=unused-variable |
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.
what are these return values and why are they being unpacked if not used?
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.
Removed the unpacking of these unused return values
pisa/stages/osc/pi_nusquids.py
Outdated
container['weights'].mark_changed(WHERE) | ||
|
||
|
||
# vectorized function to apply (flux * prob) |
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.
is this the same fucntion as used in prob3 stage? if so, then import rather than copy paste
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.
Now importing from pi_prob3
pisa/stages/aeff/pi_weight.py
Outdated
|
||
weight_scale : dimensionless Quantity | ||
|
||
Notes |
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.
no empty sections
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.
Removed
The weight is then multiplied by the livetime to get an event count. | ||
|
||
Paramaters | ||
---------- |
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.
update this with correct docs; don't have blank line after dash line
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.
Done
nuSQ.Set_DecoherenceGammaMatrix(osc_params.gamma21,osc_params.gamma31,osc_params.gamma32) | ||
nuSQ.Set_EnergyDependence(osc_params.n_energy) | ||
|
||
#t2 = datetime.datetime.now() |
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.
remove the commented-out code here and below, remove extra blank lines
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.
Done
for (i, (cz, en)) in enumerate(zip(true_coszens, true_energies)): | ||
for (input_name, nuSQ) in propagators.iteritems(): | ||
if not isinstance(en.dtype,np.float64) : en = np.float64(en) #TODO Current nuSQuIDS pybindings can only accept double, not float. Fix this (overload) and remove this hack |
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.
don't put statements on same line as the conditional expressions
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.
Fixed
pisa/stages/osc/pi_nusquids.py
Outdated
self.osc_params.eps_tautau = 0. | ||
''' | ||
|
||
import datetime |
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.
Furthermore, you should use time
not datetime
for timings. and use the logging
module, don't put print
statements that you comment out. In other words: either remove all of the timing stuff, or use time
and logging
pisa/analysis/analysis.py
Outdated
@@ -42,7 +42,7 @@ | |||
Unless required by applicable law or agreed to in writing, software | |||
distributed under the License is distributed on an "AS IS" BASIS, | |||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
See the License for the specific language governing permissions and | |||
See the LicAnalysisense for the specific language governing permissions and |
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.
sp
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.
Not sure what happened there! Fixed
…planes.py updated to use the new fitting script, but also to be backwards compatible with files generated using the old script
I've mades the changes to the hyperplane stuff now, so we now use the new script but have backwards compatibility with old files. |
All comments now addressed, this is now ready to be merged. |
* First commit of the barebones of a script for converting .i3 files into PISA events. Will now start to flesh out the details. * Started a GRECO i3 -> PISA converter * Added support to the i3 -> PISA file scripts for splitting neutrino events in to nu vs nubar, and NC vs CC. * Added weighted_aeff to i3->PISA converter * Added support for metadata * Started a new Events class as agreed upon at the code sprint. Right now it is minimally different to the existing one, but I'll start to add more significant changes now * Added zenith -> coszen conversion * Updated 'add_flux_to_events_file.py' to support new evnets file format (e.g. single layer of keys, possibility of non-neutrino events). Added a main function to events_pi.py so can print the contents of an events file easily. * Have started adding GENIE support * Making the pi Events class backwards compatible with the existing DRAGON hdf5 files * Added GRECO post-L7 cuts * Moved the i3 -> PISA converters to the 'fridge' repository * Only add flux to neutrino events (not muons, noise, etc) * Add some logging whilst fluxes are being added to events so that user can see progress (takes a while) * Merging updates to nominal flux variable naming and EventsPi structure * Implementing chanegs from comments in pull request #456 * Fixing license, docstrings, and shifting to OrderedDict in EventsPi * Adding decoherence model to PISA pi dev * Fixed bugs in thetaXY getter properties in pi_osc_params. Updated decoherence.py and layers.py according to comments from pull request 472 * Added comments to clarify indexing of neutrino flavors when using function. * A few small changes following comments in pull request 472 * Bug fix, do not try to set NSI params when NSI-supporting nuSQuIDS is not available * Adding PISA pi stage for using nuSQuIDS for oscillation probability calculation. Including support for decoherence in this. * Updating pi_nusquids to use latest nuSQuIDS decoherence model * REplaced something accidentally removed * (1) Changed , and params in to contructor args. They shouldn't really be params as they are not expected to change, and they may take different values for different pipelines in the same distribution maker. (2) Fixed handling for using initial weights (from input) files as the starting point for event weights in the analysis. * Enforce input data arrays use SmartArray for PISA pi stages (this is assumed by essentially all stages) * Adding stage for atmospheric muon background * Adding MuonGun flux uncertainty spline * Fix bug where weights were not being reset at the start of each new minimizdr iteration * Added option to fit tboth theta23 octants separately and choose the best fit * Added an oscillation spline fo nuSQuIDS to speed things up. Needs cleaning up, but is working at least * Add basic weighting stage for use with non-neutrino events * added the possibility of including an external prior penalty * fixed issue with external_priors_penalty * Make EventsPu and simple_data_loader more robust to other input formats, in particular events that are not already broken up into flavor/interaction * Updated fit_discrete_sys_nd.py to handle empty bins * Temporary new version of hyperplane fit script, will be merged in future * More organised data structure for hyperplane fits, making it easier to make offline plots. Also handles corner cases that previouslu choked the sytstem such as empty bins in histogram. * Removing some debug printing * added energy dependent decoherence * Printing error when minimizer fails * Handle cases with empty bins where the uncertainty is zero * Tidying up the event file parsing * Fixed bug in nusquids_osc where nu and nubar were being swotched * Undoing changed to fit_discrete_sys_nd.py, since they have been made in fit_discrete_sys_nd_new.py * Switched to using the new version of fit_discrete_sys_nd.py. pi_hyperplanes.py updated to use the new fitting script, but also to be backwards compatible with files generated using the old script * Making changes as working throuhg PR #502 * Second commit due to comments for PR #502 * Removed a rogue bit fo test code * Fix to handling of old style files * Added ability to set params in a hyperplane fit * Fixed bug in . Added code to automatically create from if coszen not present * A PISA pi stage for adding simple reco/PID in the absence of reco values in the file * Tuning some reco parameterisations * Adding some documentation to placeholder.py * Correction in docs * Moving away from deposited_energy parameter to reco placeholder, as it has some issues due to I3MCTree limitations * Simpler arg for dumping events file to command line * Can choose fit method for hyperplanes. Can patch stage settings (e.g. constructor args). Update to nuSQuIDS decoherence API * Added option to downsample number of events loaded, using 'fraction_events_to_keep' argument to EventsPi or simple_data_loader * Minor improvements to docs * Updated placeholder.py (now renamed to simple_param.py) as per PR 508. Mainly docuemtnation updates * Use a random state rather than forcing the global seed * Fixing spelling, commenting conventions, etc as per PR 508 comments. Enforcing user must provide a random state for reco parameterisation functions. * Removed stuff for now to resolve PR 508. Will look for a new system to achieve same results soon * Removed settings_patches stuff for now to resolve PR 508. Will look for a new system to achieve same results soon
* First commit of the barebones of a script for converting .i3 files into PISA events. Will now start to flesh out the details. * Started a GRECO i3 -> PISA converter * Added support to the i3 -> PISA file scripts for splitting neutrino events in to nu vs nubar, and NC vs CC. * Added weighted_aeff to i3->PISA converter * Added support for metadata * Started a new Events class as agreed upon at the code sprint. Right now it is minimally different to the existing one, but I'll start to add more significant changes now * Added zenith -> coszen conversion * Updated 'add_flux_to_events_file.py' to support new evnets file format (e.g. single layer of keys, possibility of non-neutrino events). Added a main function to events_pi.py so can print the contents of an events file easily. * Have started adding GENIE support * Making the pi Events class backwards compatible with the existing DRAGON hdf5 files * Added GRECO post-L7 cuts * Moved the i3 -> PISA converters to the 'fridge' repository * Only add flux to neutrino events (not muons, noise, etc) * Add some logging whilst fluxes are being added to events so that user can see progress (takes a while) * Merging updates to nominal flux variable naming and EventsPi structure * Implementing chanegs from comments in pull request #456 * Fixing license, docstrings, and shifting to OrderedDict in EventsPi * Adding decoherence model to PISA pi dev * Fixed bugs in thetaXY getter properties in pi_osc_params. Updated decoherence.py and layers.py according to comments from pull request 472 * Added comments to clarify indexing of neutrino flavors when using function. * A few small changes following comments in pull request 472 * Bug fix, do not try to set NSI params when NSI-supporting nuSQuIDS is not available * Adding PISA pi stage for using nuSQuIDS for oscillation probability calculation. Including support for decoherence in this. * Updating pi_nusquids to use latest nuSQuIDS decoherence model * REplaced something accidentally removed * (1) Changed , and params in to contructor args. They shouldn't really be params as they are not expected to change, and they may take different values for different pipelines in the same distribution maker. (2) Fixed handling for using initial weights (from input) files as the starting point for event weights in the analysis. * Enforce input data arrays use SmartArray for PISA pi stages (this is assumed by essentially all stages) * Adding stage for atmospheric muon background * Adding MuonGun flux uncertainty spline * Fix bug where weights were not being reset at the start of each new minimizdr iteration * Added option to fit tboth theta23 octants separately and choose the best fit * Added an oscillation spline fo nuSQuIDS to speed things up. Needs cleaning up, but is working at least * Add basic weighting stage for use with non-neutrino events * added the possibility of including an external prior penalty * fixed issue with external_priors_penalty * Make EventsPu and simple_data_loader more robust to other input formats, in particular events that are not already broken up into flavor/interaction * Updated fit_discrete_sys_nd.py to handle empty bins * Temporary new version of hyperplane fit script, will be merged in future * More organised data structure for hyperplane fits, making it easier to make offline plots. Also handles corner cases that previouslu choked the sytstem such as empty bins in histogram. * Removing some debug printing * added energy dependent decoherence * Printing error when minimizer fails * Handle cases with empty bins where the uncertainty is zero * Tidying up the event file parsing * Fixed bug in nusquids_osc where nu and nubar were being swotched * Undoing changed to fit_discrete_sys_nd.py, since they have been made in fit_discrete_sys_nd_new.py * Switched to using the new version of fit_discrete_sys_nd.py. pi_hyperplanes.py updated to use the new fitting script, but also to be backwards compatible with files generated using the old script * Making changes as working throuhg PR #502 * Second commit due to comments for PR #502 * Removed a rogue bit fo test code
* First commit of the barebones of a script for converting .i3 files into PISA events. Will now start to flesh out the details. * Started a GRECO i3 -> PISA converter * Added support to the i3 -> PISA file scripts for splitting neutrino events in to nu vs nubar, and NC vs CC. * Added weighted_aeff to i3->PISA converter * Added support for metadata * Started a new Events class as agreed upon at the code sprint. Right now it is minimally different to the existing one, but I'll start to add more significant changes now * Added zenith -> coszen conversion * Updated 'add_flux_to_events_file.py' to support new evnets file format (e.g. single layer of keys, possibility of non-neutrino events). Added a main function to events_pi.py so can print the contents of an events file easily. * Have started adding GENIE support * Making the pi Events class backwards compatible with the existing DRAGON hdf5 files * Added GRECO post-L7 cuts * Moved the i3 -> PISA converters to the 'fridge' repository * Only add flux to neutrino events (not muons, noise, etc) * Add some logging whilst fluxes are being added to events so that user can see progress (takes a while) * Merging updates to nominal flux variable naming and EventsPi structure * Implementing chanegs from comments in pull request #456 * Fixing license, docstrings, and shifting to OrderedDict in EventsPi * Adding decoherence model to PISA pi dev * Fixed bugs in thetaXY getter properties in pi_osc_params. Updated decoherence.py and layers.py according to comments from pull request 472 * Added comments to clarify indexing of neutrino flavors when using function. * A few small changes following comments in pull request 472 * Bug fix, do not try to set NSI params when NSI-supporting nuSQuIDS is not available * Adding PISA pi stage for using nuSQuIDS for oscillation probability calculation. Including support for decoherence in this. * Updating pi_nusquids to use latest nuSQuIDS decoherence model * REplaced something accidentally removed * (1) Changed , and params in to contructor args. They shouldn't really be params as they are not expected to change, and they may take different values for different pipelines in the same distribution maker. (2) Fixed handling for using initial weights (from input) files as the starting point for event weights in the analysis. * Enforce input data arrays use SmartArray for PISA pi stages (this is assumed by essentially all stages) * Adding stage for atmospheric muon background * Adding MuonGun flux uncertainty spline * Fix bug where weights were not being reset at the start of each new minimizdr iteration * Added option to fit tboth theta23 octants separately and choose the best fit * Added an oscillation spline fo nuSQuIDS to speed things up. Needs cleaning up, but is working at least * Add basic weighting stage for use with non-neutrino events * added the possibility of including an external prior penalty * fixed issue with external_priors_penalty * Make EventsPu and simple_data_loader more robust to other input formats, in particular events that are not already broken up into flavor/interaction * Updated fit_discrete_sys_nd.py to handle empty bins * Temporary new version of hyperplane fit script, will be merged in future * More organised data structure for hyperplane fits, making it easier to make offline plots. Also handles corner cases that previouslu choked the sytstem such as empty bins in histogram. * Removing some debug printing * added energy dependent decoherence * Printing error when minimizer fails * Handle cases with empty bins where the uncertainty is zero * Tidying up the event file parsing * Fixed bug in nusquids_osc where nu and nubar were being swotched * Undoing changed to fit_discrete_sys_nd.py, since they have been made in fit_discrete_sys_nd_new.py * Switched to using the new version of fit_discrete_sys_nd.py. pi_hyperplanes.py updated to use the new fitting script, but also to be backwards compatible with files generated using the old script * Making changes as working throuhg PR #502 * Second commit due to comments for PR #502 * Removed a rogue bit fo test code * Fix to handling of old style files * Added ability to set params in a hyperplane fit * Fixed bug in . Added code to automatically create from if coszen not present * A PISA pi stage for adding simple reco/PID in the absence of reco values in the file * Tuning some reco parameterisations * Adding some documentation to placeholder.py * Correction in docs * Moving away from deposited_energy parameter to reco placeholder, as it has some issues due to I3MCTree limitations * Simpler arg for dumping events file to command line * Can choose fit method for hyperplanes. Can patch stage settings (e.g. constructor args). Update to nuSQuIDS decoherence API * Added option to downsample number of events loaded, using 'fraction_events_to_keep' argument to EventsPi or simple_data_loader * Minor improvements to docs * Updated placeholder.py (now renamed to simple_param.py) as per PR 508. Mainly docuemtnation updates * Use a random state rather than forcing the global seed * Fixing spelling, commenting conventions, etc as per PR 508 comments. Enforcing user must provide a random state for reco parameterisation functions. * Removed stuff for now to resolve PR 508. Will look for a new system to achieve same results soon * Removed settings_patches stuff for now to resolve PR 508. Will look for a new system to achieve same results soon
Mikkel and I have made a bunch of changes as we've been preparing for the various meetings/conferences and also Mikkel's thesis. The changes are a fairly random assortment, and I'd like to get this merged now and clean the slate so that we can get into better habits going forwards make future changes in dedicated feature branches that are much nicer to merge. The changes are either small or implemented in new files that don't affect anyone else.
A summary of changes is below:
Merged in our method of handling the theta23 octant in fits (do separate fits in either octant and take best) from a pre-pi branch. This preserves the current options for handling this case. [
analysis.py
]General improvements to robustness and backwards compatibility in HDF5 file parsing. Includes tweaks to allow the use of PISA to re-weight OscNext pre-final-level files. [
events_pi.py
,simple_data_loader.py
]A couple of tweaks to log more information when things go wrong. [
analysis.py
,pipeline.py
]Have made a new hyperplane fitting script
fit_discrete_sys_nd_new.py
. This is based on the existing one (fit_discrete_sys_nd.py
) but makes significant improvements in robustness, including handling empty bins. Also improves the output data format such that plotting of the fits can be done independently, e.g. without needing to re-run the fits each time. This should replace the existing script but that can be a separate review later (I expect to make a few more changes first) that does not need to block this merge. A new(and only slightly modified) stagepi_hyperplanes_new.py
has been created to account for the new data structure which should also be part of this future review/merge. [pi_hyperplanes_new.py
,pi_hyperplanes_new.py
]Fix to handling of input weights in events file, and generic weight stage added. Both these features required for MuonGun events. [
simple_data_loader.py
,pi_weight.py
]Many tweaks, fixes and improvements to the pi nuSQuIDS implementation, including support for decoherence. This currently does not exist in
dev
. There is still plenty to do and test in this implementation, but since noone else uses it can be merged safely intodev
in the meantime. [nusquids_osc.py
,pi_nusquids.py
]