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

Parameter handling #149

Merged
merged 624 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
624 commits
Select commit Hold shift + click to select a range
7f4b790
Comply with flake8
martwo Apr 28, 2023
257a0fb
Add get_param method
martwo Apr 28, 2023
f2e0218
Create the src_param_recarray based on detsigyield
martwo Apr 28, 2023
6c8cdb0
Style fixes
martwo Apr 29, 2023
b24ac3e
Adapt to SkyLLH2
martwo Apr 29, 2023
5b30bae
Move tdm_field_func_psi to utils
martwo Apr 29, 2023
2eb6935
Fix doc string
martwo May 1, 2023
c15f8f3
Fix doc string
martwo May 1, 2023
650d45b
Draw poisson mean only once
martwo May 1, 2023
83350d9
Improve doc strings and code style
martwo May 1, 2023
85c78f3
Comply with flake8
martwo May 2, 2023
572134c
Comply with flake8
martwo May 2, 2023
5496b96
Comply with flake8
martwo May 2, 2023
fb9e29b
Rework of the signal generator framework to support multiple detectors
martwo May 2, 2023
850f924
Introduce weight services to the Analysis class
martwo May 3, 2023
965aef7
Don't construct progressbar when not shown
martwo May 3, 2023
e334465
Style fixes
martwo May 3, 2023
073bf55
Style fixes
martwo May 3, 2023
a0f419b
Cleanup signal generator code
martwo May 3, 2023
485218e
Comply with flake
martwo May 6, 2023
167cc8e
Fix numpy data types
martwo May 6, 2023
9f6d529
Comply with flake
martwo May 6, 2023
3dcdf72
Fix numpy dtype
martwo May 6, 2023
a92f3d9
Fix numpy dtype
martwo May 6, 2023
1ad61b3
array_split needs an array
martwo May 6, 2023
0aa0f2a
Reran notebook
martwo May 6, 2023
a2f11e4
Remove Python2 legacy code
martwo May 6, 2023
21f1e0e
Comply with flake
martwo May 6, 2023
c813900
Call change_shg_mgr of individual datasets
martwo May 6, 2023
6ec8272
Create the inv CDF spline only once for each source
martwo May 6, 2023
fc44f20
Accept None as filename
martwo May 7, 2023
be4d8d0
Improve code style
martwo May 7, 2023
bb13b3d
Use scripting module
martwo May 7, 2023
08053bf
Avoid an invalid cast from nan to int
martwo May 7, 2023
c45b9cc
Remove obsolte code
martwo May 7, 2023
5af21bf
Add dummy classes
martwo May 7, 2023
3ab9e20
Restrain to [start, end]
martwo May 7, 2023
3bd4b7b
Remove obsolete file
martwo May 7, 2023
a462016
Add demonstration for a SignalTimePDF
martwo May 7, 2023
6bb6edd
Comply with flake
martwo May 7, 2023
b66ceaf
Pre-calc PD values
martwo May 11, 2023
d5c5913
Add FixedBoxSignalTimePDF
martwo May 11, 2023
4c57228
Pre-compute pd values
martwo May 11, 2023
5457bb7
Comply with flake and add new LiveTime constructor
martwo May 11, 2023
a554d03
Use better property name
martwo May 11, 2023
9795558
Add constructor method
martwo May 11, 2023
5b01cfd
Comply with flake8
martwo May 11, 2023
0223558
Add tdm_list property to Analysis class
martwo May 11, 2023
2f3b83a
Adapt time-dep analysis to SkyLLH2
martwo May 11, 2023
b37218e
Adapt TimeDep signal generator to new PDDatasetSignalGenertor
martwo May 12, 2023
ee7e60f
Need to construct signal generator for possible later use
martwo May 12, 2023
e739f4e
Use the time dependent signal generator
martwo May 12, 2023
c814c7d
Comply with flake and remove obsolete code
martwo May 12, 2023
3466a87
Comply with flake8
martwo May 12, 2023
05c3416
Add function to clean GRL
martwo May 12, 2023
109021f
Sort the GRL data according to start time
martwo May 12, 2023
626ea2c
Provide user with better error info
martwo May 12, 2023
ab4cc69
Fix code style
martwo May 12, 2023
195afcc
Add test script
martwo May 12, 2023
d16b2f4
Add time axes
martwo May 12, 2023
809eb98
Fix types
martwo May 12, 2023
1c49981
Fix typo
martwo May 12, 2023
2542492
time axes don't need to match
martwo May 12, 2023
7f526dd
Fix type
martwo May 12, 2023
10f91d4
Use time within dataset
martwo May 12, 2023
d282321
Comply with flake
martwo May 13, 2023
973f1a6
Rename property t_end to t_start
martwo May 13, 2023
897db4a
Fix typo
martwo May 13, 2023
7d4d18f
Add flux_model utils file
martwo May 13, 2023
4906fa7
Add doc string
martwo May 13, 2023
093601b
Utilize a possible cdf method of the TimeFluxProfile class
martwo May 13, 2023
90fe586
Add cdf method to BoxTimeFluxProfile
martwo May 13, 2023
7de9ab6
Add cdf method to GaussianTimeFluxProfile
martwo May 13, 2023
d62a558
random state will be provided later
martwo May 14, 2023
61c0c05
Change end to stop
martwo May 14, 2023
66c15a3
Use a TimeFluxProfile to generate signal events
martwo May 14, 2023
d93fa18
Adapt to new signal generator interface + style fixes
martwo May 14, 2023
abd5db6
Update docs
martwo May 14, 2023
5632394
Use Livetime instance within the signal generator
martwo May 14, 2023
2760bb8
Comply with flake8
martwo May 14, 2023
e15cc8d
Comply with flake8
martwo May 14, 2023
3e111d5
Adjust to new FluxModel interface
martwo May 14, 2023
4cb206e
Comply with flake
martwo May 14, 2023
af7333b
Fix example
martwo May 14, 2023
768187b
Remove obsolete file
martwo May 14, 2023
3a0658c
Fix type
martwo May 14, 2023
aa1309b
Comply with flake
martwo May 14, 2023
fbb24ae
Fix unit test
martwo May 14, 2023
a1bd2f8
Comply with flake
martwo May 14, 2023
8df9b09
Fix type
martwo May 14, 2023
722fcfc
Introduce DetSigYieldService and fix unit test
martwo May 15, 2023
1d1c72c
Fix format
martwo May 15, 2023
8f1cc27
Use DetSigYieldService and propagate source changes
martwo May 15, 2023
f326d9f
Fix unit test
martwo May 15, 2023
fc2c9f2
Comply with flake
martwo May 15, 2023
0fdc8e1
Comply with flake
martwo May 15, 2023
9b2fb59
Move SrcDetSigYieldWeightsService into services.py
martwo May 15, 2023
6ae8b58
Save property
martwo May 15, 2023
7dd76a4
Move DatasetSignalWeightFactorsService into services.py
martwo May 15, 2023
2f8a1bd
Remove obsolete file
martwo May 15, 2023
e940197
Fix normalization
martwo May 15, 2023
d383cec
Add example howto create SignalTimePDF
martwo May 15, 2023
64f1833
Fix normalization
martwo May 15, 2023
24f23e4
Add examples docs
martwo May 15, 2023
8b468c7
Mask out detetcor off times
martwo May 15, 2023
e1a9258
Improve example
martwo May 15, 2023
a369924
Set axes labels
martwo May 15, 2023
3ec1dea
improve docs
martwo May 15, 2023
77189c3
Ignore Sphinx built files
martwo May 15, 2023
aadd856
Fix doc syntax
martwo May 15, 2023
23863db
Use new signal generator
martwo May 15, 2023
976ec1e
Fix doc strings for autodoc
martwo May 15, 2023
6a5388f
Set correct raw_mimetype
martwo May 15, 2023
2ba2855
Add method to test local parameter names to be global floating parame…
martwo May 16, 2023
ee687a9
Use numpy functions
martwo May 16, 2023
c01b9d8
Allow floating parameters to be nan
martwo May 16, 2023
b3cbd84
Make pmm optional. Only compute S
martwo May 16, 2023
0ebc9f6
Precompute pd values if PDF is constant
martwo May 16, 2023
ac45cbb
Update example
martwo May 16, 2023
e600dd5
Fix method calls
martwo May 16, 2023
30c2ed9
Use SignalTimePDF class
martwo May 16, 2023
f8563c4
Remove obsolete time PDF classes
martwo May 16, 2023
45fb122
Add CatmullRomRegular1DSpline class
martwo May 18, 2023
108d35e
Add comment
martwo May 18, 2023
5636616
Fix argument name
martwo May 24, 2023
e49a4ea
Use published source parameters
martwo May 24, 2023
627e1f6
Fix argument
martwo May 25, 2023
3f80e9e
Fix typo
martwo May 25, 2023
b99abfe
Fix argument name
martwo May 25, 2023
6be44bc
Add function to perform trials with the EM method
martwo May 25, 2023
cf578d3
Add notebook for EM fits
martwo May 25, 2023
f7cadf6
update notebook
martwo May 25, 2023
bde6f30
Fix import
martwo May 26, 2023
c2646ac
Add progess bars
martwo May 26, 2023
217e359
Allow for negative TS
martwo May 26, 2023
af377b9
Fix typo
martwo May 26, 2023
442912d
Improve code, use numpy arrays
martwo May 26, 2023
d72ca4f
Comply with flake8
martwo May 27, 2023
3d25b2d
Factor out a single trial
martwo May 27, 2023
6aceb39
Adjust to new interface
martwo May 27, 2023
904e69a
Remove obsolete line of code
martwo May 27, 2023
9da0d06
Allow to deactivate progress bar
martwo May 27, 2023
5169ccd
Parallelize the do_trials_with_em function
martwo May 27, 2023
e41bd1b
Add tutorial for time dep
martwo May 27, 2023
a702065
Calc also the TS when unblinding
martwo May 29, 2023
30fcf89
Improve text
martwo May 29, 2023
a5c5c16
Comply with flake8
martwo May 29, 2023
369ae27
Remove obsolete code for NDPhotosplinePDF
martwo May 29, 2023
f2c1018
Remove obsolete classes
martwo May 30, 2023
5b2f74f
Fix contour plot
martwo May 30, 2023
5777e16
Implement CutoffPowerLawEnergyFluxProfile
martwo May 30, 2023
cc0ac77
Update timedep tutorial
martwo May 31, 2023
9b8243f
Update timedep tutorial
martwo May 31, 2023
98efe4c
Provide default get_integral implementation for EnergyFluxProfile
martwo May 31, 2023
f5c0241
Implement LogParabolaPowerLawEnergyFluxProfile
martwo May 31, 2023
8420bb9
Add title
martwo May 31, 2023
1dbb265
Improve doc string
martwo May 31, 2023
24121b0
Remove hypothesis documentation
martwo May 31, 2023
220b8dc
Use mathjax
martwo May 31, 2023
dedcf6e
Improve doc string
martwo May 31, 2023
6728f78
Fix clean target
martwo May 31, 2023
78b9ddf
Fix sphinx makefile
martwo May 31, 2023
5a76c2b
Remove obsolete file
martwo May 31, 2023
d2ecf8a
Move SourceModel to physics.source_model
martwo May 31, 2023
79d3b89
Add unit tests for flux models
martwo May 31, 2023
2a358c2
Fix source_model unit tests
martwo May 31, 2023
e029f6b
Fix unit test for BoxTimeFluxProfile
martwo May 31, 2023
90b8b35
Remove obselete file
martwo May 31, 2023
d73aecc
Rename file
martwo May 31, 2023
cbeecc6
Merge branch 'master' into parameter_handling
martwo May 31, 2023
d2a54b6
Move source_model from physics into core
martwo May 31, 2023
1ed60fd
Move unit test
martwo May 31, 2023
4456f0f
Move flux_model from physics to core
martwo May 31, 2023
ccd04da
Move unit test
martwo May 31, 2023
578cc1f
Remove obsolete directories
martwo May 31, 2023
02d12ce
Fix import
martwo May 31, 2023
37811f0
Set correct default value
martwo Jun 4, 2023
e4dcfdf
Remove physics test directory
martwo Jun 4, 2023
73d9235
Add support for Parquet data files
martwo Jun 6, 2023
3431e03
Introduce tool module for optional python packages
martwo Jun 7, 2023
78c9fc1
Improve doc string
martwo Jun 7, 2023
5a1ef02
Add function to get class of function
martwo Jun 7, 2023
96127f2
Add tool requires decorator
martwo Jun 7, 2023
2e88c14
Comply with flake8
martwo Jun 8, 2023
031d262
Fix imports
martwo Jun 8, 2023
244a500
Fix unit test
martwo Jun 8, 2023
423bfe3
Add from_grl_data unittest
martwo Jun 8, 2023
4e9f5f9
Fix unit test
martwo Jun 8, 2023
e01e1d8
Fix unit test
martwo Jun 8, 2023
a668bbc
Fix unit test
martwo Jun 8, 2023
4693c07
Add list of publications
martwo Jun 8, 2023
d3e14fd
Fix format
martwo Jun 8, 2023
805a230
Update skyllh/core/detsigyield.py
martwo Jun 9, 2023
9c344b7
Update .gitignore
martwo Jun 9, 2023
8ed8eb5
Fix docs
martwo Jun 9, 2023
4c38019
Fixed docs
martwo Jun 9, 2023
2632f67
Fix docs
martwo Jun 9, 2023
162b38b
Fix docs
martwo Jun 9, 2023
9eaf5c2
Improve docs
martwo Jun 11, 2023
0f9e433
Merge branch 'parameter_handling' of https://github.com/icecube/skyll…
martwo Jun 11, 2023
1e14030
Add changelog file
martwo Jun 11, 2023
53a7fd1
Use psi_floor=0 as default
martwo Jun 12, 2023
ac268f5
Fix doc string
martwo Jun 12, 2023
a592481
No psi_floor needed here
martwo Jun 12, 2023
a7480a8
Use None, which is a faster implementation
martwo Jun 12, 2023
3a680ab
Use ra and dec
martwo Jun 12, 2023
e034cde
Update skyllh/core/py.py
martwo Jun 12, 2023
88f8347
Fix doc string
martwo Jun 12, 2023
45e9247
Merge branch 'parameter_handling' of https://github.com/icecube/skyll…
martwo Jun 12, 2023
50531cb
Remove obsolete argument
martwo Jun 12, 2023
7cb45a3
Fix signal generator Type check
tomaskontrimas Jun 13, 2023
9351493
Calc livetime from GRL before preparing data
martwo Jun 14, 2023
e9d86ad
Use correct function argument
martwo Jun 14, 2023
c354064
Add function to add required mc fields for the analysis
martwo Jun 14, 2023
c14aab9
Encapsulate into function
martwo Jun 14, 2023
13994c8
Comply with flake8
martwo Jun 14, 2023
8ccaa15
Comply with flake8
martwo Jun 14, 2023
1c92c46
Comply with flake8
martwo Jun 14, 2023
c6612ed
Make livetime argument optional
martwo Jun 15, 2023
4eba176
Add useful error message
martwo Jun 19, 2023
2618f00
log info message when cutting runs. Also match GRL definition for sto…
martwo Jun 20, 2023
d2b7444
Add base class for photospline energy flux profiles
martwo Jun 20, 2023
5ebb215
Merge master into parameter_handling branch
martwo Jun 20, 2023
19e2358
Improve doc string
martwo Jun 21, 2023
dafa71b
Fix typo
martwo Jun 21, 2023
f0fa251
Use correct fluxmodel call signature
martwo Jun 21, 2023
f7560e6
Construct correct grid params array
martwo Jun 21, 2023
620e49e
Improve doc string
martwo Jun 21, 2023
e8982c9
Fix typo
martwo Jun 21, 2023
d412acf
Improve code structure
martwo Jun 21, 2023
c9802e2
Merge branch 'master' into parameter_handling
martwo Jun 22, 2023
a209027
Merge branch 'master' into parameter_handling
martwo Jun 22, 2023
50e290d
Improved CHANGELOG
martwo Jun 22, 2023
ec45049
Use correct MRO
martwo Jun 22, 2023
a210c60
Add pretty string methods
martwo Jun 22, 2023
b85c017
Allow multiple SHGs to map to one PDF
martwo Jun 22, 2023
ce04771
Add function to get time unit conversion factor
martwo Jun 24, 2023
6f3279c
Sort MC values for faster histogramming
martwo Jun 24, 2023
075bd58
Introduce detsigyield construction factory concept
martwo Jun 25, 2023
8371952
Implement detsigyield factory
martwo Jun 25, 2023
7833326
Factor-out creation of detsigyield
martwo Jun 25, 2023
b72547b
Improve code structure for Python3
martwo Jun 25, 2023
29fc246
Parallelize detsigyield construction for fixed fluxes
martwo Jun 25, 2023
ecfa4ed
Update CHANGELOG
martwo Jun 25, 2023
ebb1d56
Group SHGs based on builder instance instead of class
martwo Jun 26, 2023
8b3104d
Change interface for construct_detsigyield: pass SHG
martwo Jun 26, 2023
d54840c
Comply with flake8
martwo Jun 26, 2023
0eb0ec1
Use flux and time unit conversion based on config
martwo Jun 27, 2023
e92f052
Use time unit based on config
martwo Jun 27, 2023
b7b8309
Use new tool module
martwo Jun 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
doc/sphinx/_build
doc/sphinx/reference

# PyBuilder
target/
Expand Down Expand Up @@ -127,3 +128,10 @@ dmypy.json

# Pyre type checker
.pyre/

# VisualCode IDE
.vscode

# Scalene profiling files
profile.json
profile.html
46 changes: 45 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,52 @@
This file contains a log-book for major changes between releases.

v23.2.0
=======
- Complete overhaul of SkyLLH for more generic handling of parameters
(fixed & fit parameters) and their mapping to sources.

- Single class core.parameters.Parameter for fixed and fit parameters.
- New class core.parameters.ParameterModelMapper to map global parameters
to local model (e.g. source) parameters.
- Class method core.pdf.PDF.get_pd takes structured numpy.ndarray as
argument, holding local parameter names and values for each source.

- Intrinsic support for multiple sources.

- New class property core.trialdata.TrialDataManager.src_evt_idxs with
source and event indices mapping selected events to the sources.

- Simplification of the class hierarchy & source code structure.
- New generic flux model function concept.
- New generic PDF class for time PDFs.
- Support for Parquet data files via optional pyarrow Python package.
- Introduce factory concept for detector signal yield construction.

DetSigYieldBuilder classes can provide a factory function to construct
DetSigYield instances efficiently for multiple flux models.

- Speed improvements for analysis creation and trial generation.

- i3.detsigyield.SingleParamFluxPointLikeSourceI3DetSigYieldBuilder:

MC events are sorted in sin(true_dec) before histograms are made for
each parameter value. Thus, numpy.histogram works faster.

- core.event_selection.SpatialBoxEventSelectionMethod:

Improved calculation of right-ascention difference. Thus, speed-up in
trial generation when using this event selection method.

- Usage of the tqdm Python package for progress bars.
- More unit tests.
- Improved documentation.
- Following PEP8 coding style standard.

v23.1.1
=======
- bugfix of core.pdf.MultiDimGridPDFSet
- bugfix of core.pdf.MappedMultiDimGridPDFSet
- removal of depricated proptery core.pdf.PDFSet.pdf_axes

v23.1.0
=======
=======
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ pip install skyllh

The current development version can be installed using pip:
```bash
pip install git+https://github.com/icecube/skyllh.git#egg=skyllh
pip install git+https://github.com/icecube/skyllh.git#egg=skyllh
```

Optionally, the editable package version with a specified reference can be installed by:
```bash
pip install -e git+https://github.com/icecube/skyllh.git@[ref]#egg=skyllh
pip install -e git+https://github.com/icecube/skyllh.git@[ref]#egg=skyllh
```
where
- `-e` is an editable flag
Expand All @@ -41,6 +41,15 @@ sys.path.insert(0, '/path/to/skyllh')
sys.path.insert(0, '/path/to/i3skyllh') # optional
```

# Publications

Several publications about the SkyLLH software are available:

- IceCube Collaboration, T. Kontrimas, M. Wolf, et al. PoS ICRC2021 (2022) 1073
[DOI](http://doi.org/10.22323/1.395.1073)
- IceCube Collaboration, M. Wolf, et al. PoS ICRC2019 (2020) 1035
[DOI](https://doi.org/10.22323/1.358.1035)

# i3skyllh

The [`i3skyllh`](https://github.com/icecube/i3skyllh) package provides complementary pre-defined common analyses and datasets for the [IceCube Neutrino Observatory](https://icecube.wisc.edu) detector in a private [repository](https://github.com/icecube/i3skyllh).
12 changes: 6 additions & 6 deletions doc/sphinx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)

.PHONY: help Makefile html clean

# Build html documentation.
html:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)

# Build html documentation for each branch separately.
html-multiversion:
sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)"

# Prepend clean target to remove skyllh API reference.
clean:
rm -rf reference
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rm -rf $(SOURCEDIR)/reference
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# "make mode" option.
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
94 changes: 94 additions & 0 deletions doc/sphinx/concepts/detsigyield.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "12151349",
"metadata": {},
"source": [
"# Detector Signal Yield"
]
},
{
"cell_type": "markdown",
"id": "69d138fc",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"Several parts of an analysis will require the calculation of the detector signal yield, which is the mean number of expected signal events in the detector for a given source hypothesis, i.e. source flux function $\\Phi(\\alpha,\\delta,E,t)$."
]
},
{
"cell_type": "raw",
"id": "a1560531",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"SkyLLH provides two abstract base classes for creating a detector signal yield instance, :py:class:`~skyllh.core.detsigyield.DetSigYieldBuilder` and :py:class:`~skyllh.core.detsigyield.DetSigYield`. The first is the builder class, which will build a :py:class:`~skyllh.core.detsigyield.DetSigYield` class instance."
]
},
{
"cell_type": "raw",
"id": "3b4bd127",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"The builder class has the abstract method :py:meth:`~skyllh.core.detsigyield.DetSigYieldBuilder.construct_detsigyield`, which will take a :py:class:`~skyllh.core.dataset.Dataset`, :py:class:`~skyllh.core.dataset.DatasetData`, :py:class:`~skyllh.physics.flux_model.FluxModel` instance, and live-time to construct a :py:class:`~skyllh.core.detsigyield.DetSigYield` class instance, which will provide an evaluation method to calculate the detector signal yield for a given source, for the given dataset. Hence, the detector signal yield is dataset and source model dependent."
]
},
{
"cell_type": "raw",
"id": "653d0c06",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"The :py:class:`~skyllh.core.detsigyield.DetSigYield` class has two abstract methods, :py:meth:`~skyllh.core.detsigyield.DetSigYield.source_to_array` and :py:meth:`~skyllh.core.detsigyield.DetSigYield.__call__`."
]
},
{
"cell_type": "raw",
"id": "60c16a6d",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"The :py:meth:`~skyllh.core.detsigyield.DetSigYield.source_to_array` method takes a sequence of source models and converts it into a numpy record array suitable for the :py:meth:`~skyllh.core.detsigyield.DetSigYield.__call__` method to evaluate the detector signal yield efficiently for a list of sources. The :py:meth:`~skyllh.core.detsigyield.DetSigYield.__call__` method evaluates the :py:class:`~skyllh.core.detsigyield.DetSigYield` instance. As arguments it takes the source record array created by the :py:meth:`~skyllh.core.detsigyield.DetSigYield.source_to_array` method, and the numpy record array holding the (local) source parameter values."
]
},
{
"cell_type": "raw",
"id": "d75df35f",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"The record array holding the local source parameter values can be generated through the :py:class:`~skyllh.core.parameters.ParameterModelMapper.create_src_params_recarray` of the :py:class:`~skyllh.core.parameters.ParameterModelMapper` instance of the analysis. See also the :ref:`Parameter to Model mapping <sec:ParameterToModelMapping>` section."
]
}
],
"metadata": {
"celltoolbar": "Raw Cell Format",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading