diff --git a/CHANGES.rst b/CHANGES.rst new file mode 100644 index 000000000..70857dbbe --- /dev/null +++ b/CHANGES.rst @@ -0,0 +1,300 @@ +pyirf 0.8.1 (2023-03-16) +======================== + + +New Features +------------ + +- Migrating the interpolation methods from ``pyirf.interpolation`` to interpolator + objects, allowing for later inheritance for new algorithms and reusability. [`#210 `__] + + +Maintenance +----------- + +- Add and enable ``towncrier`` in CI. [`#207 `__] + +- Add a fixture containing three IRFs from `the prod5 IRF data-release `_ + for unit testing. Specifically the fixture contains the contents of: + + - Prod5-North-20deg-AverageAz-4LSTs.180000s-v0.1.fits.gz. + - Prod5-North-40deg-AverageAz-4LSTs.180000s-v0.1.fits.gz + - Prod5-North-60deg-AverageAz-4LSTs.180000s-v0.1.fits.gz + + The user has to download these irfs to ``irfs/`` using ``download_irfs.py``, + github's CI does so automatically and caches them for convenience. [`#211 `__] + + +Older releases +============== + +For releases between v0.4.1 and v0.8.1, please refer to `the GitHub releases page `_. + + +.. _pyirf_0p4p1_release: + +`0.4.1 `__ (2021-03-22) +------------------------------------------------------------------------------------- + +Summary ++++++++ + +- Released March 22nd, 2021 +- 1 Contributors + +Contributors +++++++++++++ + +- Maximilian Nöthe + + +Merged Pull Requests +++++++++++++++++++++ + +- `#135 `_ Add functions to convert pyirf results to the corresponding gammapy classes +- `#137 `_ Add example notebook for calculating point-lile IRFs from the FACT open data + + +.. _pyirf_0p4p0_release: + +`0.4.0 `__ (2020-11-09) +------------------------------------------------------------------------------------- + +Summary ++++++++ + +- Released November 11th, 2020 +- 2 Contributors + +Contributors +++++++++++++ + +In order of number of commits: + +- Maximilian Nöthe +- Michele Peresano + + +Description ++++++++++++ + +This release is an important update that introduces three +changes in the cut optimization, background estimation and sensitivity calculation. + +Together, these changes bring the calculated sensitivities much closer to the ones calculated by +EventDisplay. + +* Scale the relative flux calculated to reach the target sensitivity + up if the requirements on the minimum number of signal events are not met. + Essentially, instead of always calculating the flux that + yields ``target_sensitivity`` and then checking if the two other conditions are met, + we increase the required flux to meet the other requirements. + This can result in new sensitivities where before pyirf would report no sensitivities, + and report better sensitivities everywhere where the event number conditions where not + met before at the target significance. + The best sensitivity now is the lowest flux that just barely satisfies all + requirements (so is at the minimum requirement of one of the three). + +* Differentiate between `reco_source_fov_offset` and `true_source_fov_offset`, + using the former for background rates and the latter for everything concerning + signal events. + +* Change ``optimize_gh_cut`` to do the optimization in terms of efficiency and + limit this efficiency to max. 80 % in the EventDisplay comparison. + + +Smaller improvements also include: + +* It is now possible to include a ``particle_type`` column in the event lists, + which will result in additionally reporting all event counts also per ``particle_type``. + E.g. if ``particle_type`` is included in the background table consisting of both + electrons and protons, ``estimate_background`` will not only report ``n_background(_weighted)`` + but also ``n_electron(_weighted)`` and ``n_proton(_weighted)`` + +* ``relative_sensitivity`` now supports vectorized application and broadcasting + of inputs, as previously wrongly advertized in the docstring. + + +Related news +++++++++++++ + +GammaPy ``0.18.0`` was released and includes fixes for IRF axis orders. +The output of ``pyirf`` in GADF fits format can now be read by gammapy without +problems. +The workarounds for installing GammaPy is also no longer needed. + + +Merged Pull Requests +++++++++++++++++++++ + +Feature changes +""""""""""""""" + +- `#110 `_ Optimize cuts in efficiency steps with maximum efficiency of 80% for EventDisplay comparison +- `#104 `_ Scale flux for conditions, differenatiate reco and true source_fov_offset +- `#108 `_ Add counts / weighted counts per particle type +- `#107 `_ Small update to installation instructions +- `#106 `_ Use vectorize for relative_sensitivity + +Project maintenance +""""""""""""""""""" + +- `#102 `_ Require astropy >= 4.0.2 +- `#100 `_ Fix deploy condition in travis yml + + +.. _pyirf_0p3p0_release: + +`0.3.0 `__ (2020-10-05) +------------------------------------------------------------------------------------- + +Summary ++++++++ + +- Released October 5th, 2020 +- 5 Contributors + +Contributors +++++++++++++ + +In order of number of commits: + +- Maximilian Nöthe +- Michele Peresano +- Noah Biederbeck +- Lukas Nickel +- Gaia Verna + + +Description ++++++++++++ + +This release is the result of the IRF sprint week in September 2020. +Many bug fixes and improvements were made to the code. + +As the target for the sprint week was to reproduce the approach of ``EventDisplay`` and +the resulting IRFs, one scheme of cut optimization is implemented. +The ``examples/calculate_eventdisplay_irfs.py`` should follow the approach +of ``EventDisplay`` closely and shows what is currently implemented in ``pyirf``. +In the central and upper energy range, ``pyirf`` now reproduces the ``EventDisplay`` sensitivity +exactly, the lower energy bins still show some disagreement. +The cut optimization seems not yet to be the same as EventDisplay's and will be further investigated. +This example could be used as a starting point if you also want to do cut optimization for best sensitivity. + + +At least one version of each IRF is now implemented and can be stored in the GADF format. +Computation of full-enclosure IRFs should be possible but is of now not yet tested +on a reference dataset. + + +Merged Pull Requests +++++++++++++++++++++ + +- `#97 `_ Store correct signal amount, store information on which checks failed for sensitivity bins (Maximilian Nöthe) +- `#96 `_ Add integration test (Michele Peresano) +- `#98 `_ Remove option point_like for psf (Maximilian Nöthe) +- `#95 `_ Cut updates (Maximilian Nöthe) +- `#91 `_ Fix conditions to take relative sensitivity into account, fixes #90 (Maximilian Nöthe) +- `#89 `_ Fix brentq returning the lower bound of 0 for flat li ma function (Maximilian Nöthe) +- `#85 `_ Improve comparison to EventDisplay (Maximilian Nöthe) +- `#75 `_ Add a function to check a table for required cols / units (Maximilian Nöthe) +- `#86 `_ Fix Li & Ma significance for n_off = 0 (Maximilian Nöthe) +- `#76 `_ Feature resample histogram (Noah Biederbeck, Lukas Nickel) +- `#79 `_ Fix integration of power law pdf in simulations.py (Gaia Verna) +- `#80 `_ Estimate unique runs taking pointing pos into account (Maximilian Nöthe) +- `#71 `_ Background estimation (Maximilian Nöthe) +- `#78 `_ Change argument order in create_rad_max_hdu (Lukas Nickel) +- `#77 `_ Calculate optimized cut on only the events surviving gh separation (Maximilian Nöthe) +- `#68 `_ Effective area 2d (Maximilian Nöthe) +- `#67 `_ Add method integrating sim. events in FOV bins (Maximilian Nöthe) +- `#63 `_ Verify hdus using ogadf-schema (Maximilian Nöthe) +- `#58 `_ Implement Background2d (Maximilian Nöthe) +- `#52 `_ Add sections about tests, coverage and building docs to docs (Maximilian Nöthe) +- `#46 `_ Add PyPI deploy and metadata (Maximilian Nöthe) + + +.. _pyirf_0p2p0_release: + +`0.2.0 `__ (2020-09-27) +------------------------------------------------------------------------------------- + +Summary ++++++++ + +- Released September 27th, 2020 +- 4 Contributors + +Contributors +++++++++++++ + +In order of number of commits: + +- Maximilian Nöthe +- Michele Peresano +- Lukas Nickel +- Hugo van Kemenade + + +Description ++++++++++++ + +For this version, pyirf's API was completely rewritten from scratch, +merging code from several projects (pyirf, pyfact, fact-project/irf) to provide a library to compute IACT +IRFs and sensitivity and store them in the GADF data format. + +The class based API using a configuration file was replaced by a finer grained +function based API. + +Implemented are point-like IRFs and sensitivity. + +This release was the starting point for the IRF sprint week in September 2020, +where the refactoring continued. + + +Merged Pull Requests +++++++++++++++++++++ + +- `#36 `_ Start refactoring pyirf (Maximilian Nöthe, Michele Peresano, Lukas Nickel) +- `#35 `_ Cleanup example notebook (Maximilian Nöthe, Michele Peresano, Lukas Nickel) +- `#37 `_ Move to python >= 3.6 (Hugo van Kemenade) + + + +.. _pyirf_0p1p0_release: + +`0.1.0 `__ (2020-09-16) +------------------------------------------------------------------------------------- + +This is a pre-release. + +- Released September 16th, 2020 + + +.. _pyirf_0p1p0alpha_prerelease: + +`0.1.0-alpha `__ (2020-05-27) +------------------------------------------------------------------------------------------------- + +Summary ++++++++ + +This is a pre-release. + +- Released May 27th, 2020 +- 3 contributors + +Description ++++++++++++ + +- Started basic maintenance +- Started refactoring +- First tests with CTA-LST data + +Contributors +++++++++++++ + +In alphabetical order by last name: + +- Lea Jouvin +- Michele Peresano +- Thomas Vuillaume diff --git a/docs/changelog.rst b/docs/changelog.rst index 17bb1fd86..31c6f9c84 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,276 +1,7 @@ .. _changelog: +========= Changelog ========= - -For newer releases than v0.4.1, please refer to the GitHub releases page `_. - - -.. _pyirf_0p4p1_release: - -`0.4.1 `__ (2021-03-22) -------------------------------------------------------------------------------------- - -Summary -+++++++ - -- Released March 22nd, 2021 -- 1 Contributors - -Contributors -++++++++++++ - -- Maximilian Nöthe - - -Merged Pull Requests -++++++++++++++++++++ - -- `#135 `_ Add functions to convert pyirf results to the corresponding gammapy classes -- `#137 `_ Add example notebook for calculating point-lile IRFs from the FACT open data - - -.. _pyirf_0p4p0_release: - -`0.4.0 `__ (2020-11-09) -------------------------------------------------------------------------------------- - -Summary -+++++++ - -- Released November 11th, 2020 -- 2 Contributors - -Contributors -++++++++++++ - -In order of number of commits: - -- Maximilian Nöthe -- Michele Peresano - - -Description -+++++++++++ - -This release is an important update that introduces three -changes in the cut optimization, background estimation and sensitivity calculation. - -Together, these changes bring the calculated sensitivities much closer to the ones calculated by -EventDisplay. - -* Scale the relative flux calculated to reach the target sensitivity - up if the requirements on the minimum number of signal events are not met. - Essentially, instead of always calculating the flux that - yields ``target_sensitivity`` and then checking if the two other conditions are met, - we increase the required flux to meet the other requirements. - This can result in new sensitivities where before pyirf would report no sensitivities, - and report better sensitivities everywhere where the event number conditions where not - met before at the target significance. - The best sensitivity now is the lowest flux that just barely satisfies all - requirements (so is at the minimum requirement of one of the three). - -* Differentiate between `reco_source_fov_offset` and `true_source_fov_offset`, - using the former for background rates and the latter for everything concerning - signal events. - -* Change ``optimize_gh_cut`` to do the optimization in terms of efficiency and - limit this efficiency to max. 80 % in the EventDisplay comparison. - - -Smaller improvements also include: - -* It is now possible to include a ``particle_type`` column in the event lists, - which will result in additionally reporting all event counts also per ``particle_type``. - E.g. if ``particle_type`` is included in the background table consisting of both - electrons and protons, ``estimate_background`` will not only report ``n_background(_weighted)`` - but also ``n_electron(_weighted)`` and ``n_proton(_weighted)`` - -* ``relative_sensitivity`` now supports vectorized application and broadcasting - of inputs, as previously wrongly advertized in the docstring. - - -Related news -++++++++++++ - -GammaPy ``0.18.0`` was released and includes fixes for IRF axis orders. -The output of ``pyirf`` in GADF fits format can now be read by gammapy without -problems. -The workarounds for installing GammaPy is also no longer needed. - - -Merged Pull Requests -++++++++++++++++++++ - -Feature changes -""""""""""""""" - -- `#110 `_ Optimize cuts in efficiency steps with maximum efficiency of 80% for EventDisplay comparison -- `#104 `_ Scale flux for conditions, differenatiate reco and true source_fov_offset -- `#108 `_ Add counts / weighted counts per particle type -- `#107 `_ Small update to installation instructions -- `#106 `_ Use vectorize for relative_sensitivity - -Project maintenance -""""""""""""""""""" - -- `#102 `_ Require astropy >= 4.0.2 -- `#100 `_ Fix deploy condition in travis yml - - -.. _pyirf_0p3p0_release: - -`0.3.0 `__ (2020-10-05) -------------------------------------------------------------------------------------- - -Summary -+++++++ - -- Released October 5th, 2020 -- 5 Contributors - -Contributors -++++++++++++ - -In order of number of commits: - -- Maximilian Nöthe -- Michele Peresano -- Noah Biederbeck -- Lukas Nickel -- Gaia Verna - - -Description -+++++++++++ - -This release is the result of the IRF sprint week in September 2020. -Many bug fixes and improvements were made to the code. - -As the target for the sprint week was to reproduce the approach of ``EventDisplay`` and -the resulting IRFs, one scheme of cut optimization is implemented. -The ``examples/calculate_eventdisplay_irfs.py`` should follow the approach -of ``EventDisplay`` closely and shows what is currently implemented in ``pyirf``. -In the central and upper energy range, ``pyirf`` now reproduces the ``EventDisplay`` sensitivity -exactly, the lower energy bins still show some disagreement. -The cut optimization seems not yet to be the same as EventDisplay's and will be further investigated. -This example could be used as a starting point if you also want to do cut optimization for best sensitivity. - - -At least one version of each IRF is now implemented and can be stored in the GADF format. -Computation of full-enclosure IRFs should be possible but is of now not yet tested -on a reference dataset. - - -Merged Pull Requests -++++++++++++++++++++ - -- `#97 `_ Store correct signal amount, store information on which checks failed for sensitivity bins (Maximilian Nöthe) -- `#96 `_ Add integration test (Michele Peresano) -- `#98 `_ Remove option point_like for psf (Maximilian Nöthe) -- `#95 `_ Cut updates (Maximilian Nöthe) -- `#91 `_ Fix conditions to take relative sensitivity into account, fixes #90 (Maximilian Nöthe) -- `#89 `_ Fix brentq returning the lower bound of 0 for flat li ma function (Maximilian Nöthe) -- `#85 `_ Improve comparison to EventDisplay (Maximilian Nöthe) -- `#75 `_ Add a function to check a table for required cols / units (Maximilian Nöthe) -- `#86 `_ Fix Li & Ma significance for n_off = 0 (Maximilian Nöthe) -- `#76 `_ Feature resample histogram (Noah Biederbeck, Lukas Nickel) -- `#79 `_ Fix integration of power law pdf in simulations.py (Gaia Verna) -- `#80 `_ Estimate unique runs taking pointing pos into account (Maximilian Nöthe) -- `#71 `_ Background estimation (Maximilian Nöthe) -- `#78 `_ Change argument order in create_rad_max_hdu (Lukas Nickel) -- `#77 `_ Calculate optimized cut on only the events surviving gh separation (Maximilian Nöthe) -- `#68 `_ Effective area 2d (Maximilian Nöthe) -- `#67 `_ Add method integrating sim. events in FOV bins (Maximilian Nöthe) -- `#63 `_ Verify hdus using ogadf-schema (Maximilian Nöthe) -- `#58 `_ Implement Background2d (Maximilian Nöthe) -- `#52 `_ Add sections about tests, coverage and building docs to docs (Maximilian Nöthe) -- `#46 `_ Add PyPI deploy and metadata (Maximilian Nöthe) - - -.. _pyirf_0p2p0_release: - -`0.2.0 `__ (2020-09-27) -------------------------------------------------------------------------------------- - -Summary -+++++++ - -- Released September 27th, 2020 -- 4 Contributors - -Contributors -++++++++++++ - -In order of number of commits: - -- Maximilian Nöthe -- Michele Peresano -- Lukas Nickel -- Hugo van Kemenade - - -Description -+++++++++++ - -For this version, pyirf's API was completely rewritten from scratch, -merging code from several projects (pyirf, pyfact, fact-project/irf) to provide a library to compute IACT -IRFs and sensitivity and store them in the GADF data format. - -The class based API using a configuration file was replaced by a finer grained -function based API. - -Implemented are point-like IRFs and sensitivity. - -This release was the starting point for the IRF sprint week in September 2020, -where the refactoring continued. - - -Merged Pull Requests -++++++++++++++++++++ - -- `#36 `_ Start refactoring pyirf (Maximilian Nöthe, Michele Peresano, Lukas Nickel) -- `#35 `_ Cleanup example notebook (Maximilian Nöthe, Michele Peresano, Lukas Nickel) -- `#37 `_ Move to python >= 3.6 (Hugo van Kemenade) - - - -.. _pyirf_0p1p0_release: - -`0.1.0 `__ (2020-09-16) -------------------------------------------------------------------------------------- - -This is a pre-release. - -- Released September 16th, 2020 - - -.. _pyirf_0p1p0alpha_prerelease: - -`0.1.0-alpha `__ (2020-05-27) -------------------------------------------------------------------------------------------------- - -Summary -+++++++ - -This is a pre-release. - -- Released May 27th, 2020 -- 3 contributors - -Description -+++++++++++ - -- Started basic maintenance -- Started refactoring -- First tests with CTA-LST data - -Contributors -++++++++++++ - -In alphabetical order by last name: - -- Lea Jouvin -- Michele Peresano -- Thomas Vuillaume +.. include:: ../CHANGES.rst diff --git a/docs/changes/207.maintenance.rst b/docs/changes/207.maintenance.rst deleted file mode 100644 index 8003e15c5..000000000 --- a/docs/changes/207.maintenance.rst +++ /dev/null @@ -1 +0,0 @@ -Add and enable ``towncrier`` in CI. \ No newline at end of file diff --git a/docs/changes/210.api.rst b/docs/changes/210.api.rst deleted file mode 100644 index b8b4e7721..000000000 --- a/docs/changes/210.api.rst +++ /dev/null @@ -1,2 +0,0 @@ -Migrating the interpolation methods from ``pyirf.interpolation`` to interpolator -objects, allowing for later inheritance for new algorithms and reusability. diff --git a/docs/changes/211.maintenance.rst b/docs/changes/211.maintenance.rst deleted file mode 100644 index b2ae05ad7..000000000 --- a/docs/changes/211.maintenance.rst +++ /dev/null @@ -1,8 +0,0 @@ -Add a fixture containing three IRFs from `the prod5 IRF data-release ` -for unit testing. Specifically the fixture contains the contents of: -* Prod5-North-20deg-AverageAz-4LSTs.180000s-v0.1.fits.gz. -* Prod5-North-40deg-AverageAz-4LSTs.180000s-v0.1.fits.gz -* Prod5-North-60deg-AverageAz-4LSTs.180000s-v0.1.fits.gz - -The user has to download these irfs to ``irfs/`` using ``download_irfs.py``, -github's CI does so automatically and caches them for convenience. diff --git a/setup.py b/setup.py index d5b148b7d..3f16f1503 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ "awkward1", "notebook", "tables", + "towncrier", gammapy, ], "tests": [