Skip to content
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

Merged
merged 66 commits into from
Jul 11, 2018

Conversation

ts4051
Copy link
Contributor

@ts4051 ts4051 commented Jul 9, 2018

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:

  1. 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]

  2. 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]

  3. A couple of tweaks to log more information when things go wrong. [analysis.py,pipeline.py]

  4. 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) stage pi_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]

  5. 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]

  6. 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 into dev in the meantime. [nusquids_osc.py,pi_nusquids.py]

Thomas Stuttard and others added 30 commits January 16, 2018 07:43
…to PISA events. Will now start to flesh out the details.
…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.
…oherence.py and layers.py according to comments from pull request 472
…alculation. Including support for decoherence in this.
@philippeller
Copy link
Collaborator

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:

  • we need to try not to duplicated code by leaving choices like hyperplanes and hyperplanes_new and so forth. Is there any reason the old ones cannot simply be replaced? And would it be very difficulat to make the new stage backwards compatible to accept existing fit files?

@ts4051
Copy link
Contributor Author

ts4051 commented Jul 9, 2018

Hi Philipp, thanks for taking a look.

I agree it is nicer not to have <file> and <file>_new cases, and definitely don't want these hanging around for long.

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 new version.

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 fridge/common/scripts/plotting/plot_hyperplane_fits.py. There are quite a few changes here too so probably whoever wrote the original plotting should also run this and check they are happy with how the plots look now (there is some new formatting and also entirely new plots).

@philippeller
Copy link
Collaborator

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

Copy link
Collaborator

@philippeller philippeller left a 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


def get_separate_t23_octant_params(hypo_maker,inflection_point) :

#TODO Document
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -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
Copy link
Collaborator

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

Copy link
Contributor

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

Copy link
Collaborator

@philippeller philippeller Jul 9, 2018

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (parentheses added)

@@ -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
Copy link
Collaborator

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

Copy link
Contributor Author

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.

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])
Copy link
Collaborator

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

Copy link
Contributor Author

@ts4051 ts4051 Jul 10, 2018

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
Copy link
Collaborator

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

Copy link
Contributor Author

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 )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtype?

Copy link
Contributor Author

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')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens else?

Copy link
Contributor Author

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__

self.osc_params.eps_tautau = 0.
'''

import datetime
Copy link
Collaborator

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

Copy link
Contributor

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

Copy link
Contributor Author

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.

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
Copy link
Collaborator

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?

Copy link
Contributor Author

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

container['weights'].mark_changed(WHERE)


# vectorized function to apply (flux * prob)
Copy link
Collaborator

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

Copy link
Contributor Author

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


weight_scale : dimensionless Quantity

Notes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no empty sections

Copy link
Contributor Author

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
----------
Copy link
Contributor

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

Copy link
Contributor Author

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()
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

self.osc_params.eps_tautau = 0.
'''

import datetime
Copy link
Contributor

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

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp

Copy link
Contributor Author

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
@ts4051
Copy link
Contributor Author

ts4051 commented Jul 10, 2018

I've mades the changes to the hyperplane stuff now, so we now use the new script but have backwards compatibility with old files.

@ts4051
Copy link
Contributor Author

ts4051 commented Jul 11, 2018

All comments now addressed, this is now ready to be merged.

@philippeller philippeller merged commit 99e9c17 into icecube:dev Jul 11, 2018
jllanfranchi pushed a commit that referenced this pull request Nov 15, 2018
* 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
jllanfranchi pushed a commit that referenced this pull request Feb 13, 2019
* 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
jllanfranchi pushed a commit that referenced this pull request Feb 13, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants