Ctapipe

Latest version: v0.24.0

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.24.0

============================


Bug Fixes
---------

- Fix ``SubarrayDescription.info()`` in cases
of different ``TelescopeDescription`` with the same string representation. [`2673 <https://github.com/cta-observatory/ctapipe/pull/2673>`__]

- Make sure that the configuration stored in the provenance
information actually contains the full configuration
and can be used to re-create the application. [`2688 <https://github.com/cta-observatory/ctapipe/pull/2688>`__]

- Fix the function grouping telescope ids into ranges for
the case of unsigned integer telescope ids. [`2692 <https://github.com/cta-observatory/ctapipe/pull/2692>`__]

- Fix ``Tool`` not exposing all options defined by ``traitlets.Application``
by default.

Fix ``--show-config`` and ``--show-config-json`` by not running ``setup`` and
``finish`` steps in case those options are given. [`2703 <https://github.com/cta-observatory/ctapipe/pull/2703>`__]

- Fix processing gain-selected dl1 data with the ``PixelStatisticsCalculatorTool``. [`2715 <https://github.com/cta-observatory/ctapipe/pull/2715>`__]


Data Model Changes
------------------
- Change definition of DVR bits in PixelStatus to new definition in DL0 data model. [`2725 <https://github.com/cta-observatory/ctapipe/pull/2725>`__]

- Change format in which event timestamps are written to HDF5 files.
Instead of a single float64 MJD value which has ~µs precision,
the CTAO high precision time format is used now.
This stores the timestamp as two uint32 values: seconds
and quarter nanoseconds since ``1970-01-01T00:00:00.0 TAI``.

This only affects the storage format and the precision,
the in-memory API is unchanged as it relies on ``astropy.time.Time``
and values are converted when reading/writing from/to HDF5. [`2707 <https://github.com/cta-observatory/ctapipe/pull/2707>`__]


New Features
------------

- Add a ``ctapipe-optimize-event-selection`` tool to produce cut-selection files,
based on a gamma, and optionally a proton and an electron DL2 file.
Two components for calculating G/H and optionally theta cuts are added:
``PercentileCuts`` keeps a certain percentage of gamma events in each bin and
``PointSourceSensitivityOptimizer`` optimizes G/H cuts for maximum point source sensitivity and
optionally calculates percentile theta cuts.

- Add a ``ctapipe-compute-irf`` tool to produce irfs given a cut-selection file, a gamma,
and optionally a proton, and an electron DL2 input file.
Given only a gamma file, the energy dispersion, effective area, and point spread function are calculated.
Optionally, the bias and resolution of the energy reconstruction and the angular resolution can be calculated
and saved in a separate output file.
If a proton or a proton and an electron file is also given, a background model can be calculated,
as well as the point source sensitivity.

Irfs can be calculated with and without applying a direction cut.
Only radially symmetric parameterizations of the irf components are implemented so far. [`2473 <https://github.com/cta-observatory/ctapipe/pull/2473>`__]

- Add a generic stats-calculation tool utilizing the PixelStatisticsCalculator. [`2628 <https://github.com/cta-observatory/ctapipe/pull/2628>`__]

- Add ChunkInterpolator to ctapipe.monitoring.interpolation as a tool to select data from chunks. The planned use for this is to select calibration data. [`2634 <https://github.com/cta-observatory/ctapipe/pull/2634>`__]

- Adds psf models to ``ctapipe.instrument.optics`` with the parent class ``PSFModel`` and a psf model based on pure coma aberration called ``ComaPSFModel``
- The function ``PSFModel.pdf`` gives the value of the PSF in a given location [`2643 <https://github.com/cta-observatory/ctapipe/pull/2643>`__]

- Add new fields to the MuonParametersContainer.

Implement the computation of the new features listed below
and refactor the code using the existing containers.

Added fields:
- ring_intensity
- intensity_outside_ring
- n_pixels_in_ring
- mean_intensity_outside_ring
- radial_std_dev
- skeweness
- excess_kurtosis [`2670 <https://github.com/cta-observatory/ctapipe/pull/2670>`__]

- Store also the SubarrayDescription in the camera monitoring data produced by the stats tool [`2696 <https://github.com/cta-observatory/ctapipe/pull/2696>`__]

- Add a method ``read_scheduling_blocks`` in the ``TableLoader`` class to read scheduling block information. [`2709 <https://github.com/cta-observatory/ctapipe/pull/2709>`__]

- Adding a ``meta_convention`` option to ``SubarrayDescription.to_table()`` method to choose
between hdf and fits conventions mainly for the reference location. Default is set to 'hdf'.
In Addition ``TableLoader`` does not join metadata of instrument table when
``instrument=true``. [`2722 <https://github.com/cta-observatory/ctapipe/pull/2722>`__]


Maintenance
-----------

- Add a tutorial to the docs on how to use the machine learning tools
to process dl1b (image parameters) files to dl2 for a mono analysis.

Perform minor updates to other parts of the api docs and the user-guide. [`2691 <https://github.com/cta-observatory/ctapipe/pull/2691>`__]

0.23.2

============================

Bug Fixes
---------

- Fill ``ctapipe.containers.SimulatedCameraContainer.true_image_sum`` in
``HDF5EventSource``. Always returned default value of -1 before the fix. [`2680 <https://github.com/cta-observatory/ctapipe/pull/2680>`__]

Maintenance
-----------

- Add compatibility with numpy>=2.1. [`2682 <https://github.com/cta-observatory/ctapipe/pull/2682>`__]

0.23.1

============================

Bug Fixes
---------

- Fix ``<reconstruction_property>_uncert`` calculations in ``ctapipe.reco.StereoMeanCombiner``.
Add helper functions for vectorized numpy calculations as new ``ctapipe.reco.telescope_event_handling`` module. [`2658 <https://github.com/cta-observatory/ctapipe/pull/2658>`__]

- Fix error in ``ctapipe-process`` when in the middle of a simtel file
that has true images available, a telescope event is missing the true image.
This can happen rarely in case a telescope triggered on pure NSB or
is oversaturated to the point where the true pe didn't fit into memory constraints.

The error was due to the ``DataWriter`` trying to write a ``None`` into an
already setup table for the true images.

The ``SimTelEventSource`` will now create an invalid true image filled with ``-1``
for such events. [`2659 <https://github.com/cta-observatory/ctapipe/pull/2659>`__]

- In ``SimTelEventSource``, ignore telescope events that did not take part in the stereo event trigger.
This happens rarely in Prod6 files in conjunction with the random mono trigger system.

- Fix the order in which ``Tool`` runs final operations to fix an issue
of provenance not being correctly recorded. [`2662 <https://github.com/cta-observatory/ctapipe/pull/2662>`__]

- Fix data type of ``tel_id`` in the output of ``SubarrayDescription.to_table``

- Fixed a bug where if a configuration file with unknown file extension was passed
to a tool, e.g. ``--config myconf.conf`` instead of ``--config myconf.yaml``, it
was silently ignored, despite an info log saying "Loading config file
myconf.conf". Configuration files must now have one of the following extensions
to be recognized: yml, yaml, toml, json, py. If not a ``ToolConfigurationError``
is raised. [`2666 <https://github.com/cta-observatory/ctapipe/pull/2666>`__]

Maintenance
-----------

- Add support for astropy 7.0. [`2639 <https://github.com/cta-observatory/ctapipe/pull/2639>`__]
- Change data server for test datasets from in2p3 to DESY hosted server. [`2664 <https://github.com/cta-observatory/ctapipe/pull/2664>`__]

0.23.0

============================


API Changes
-----------

- Add possibility to use ``HIPPARCOS`` catalog to get star positions

- add catalogs enumerator to ``ctapipe.utils.astro``
- update ``get_bright_stars`` in ``ctapipe.utils.astro`` to allow catalog selection
- ensure application of proper motion
- add possibility to select stars on proximity to a given position and on apparent magnitude
- Bundle star catalogs in the python package
- API change: ``ctapipe.utils.astro.get_bright_stars`` now requires a timestamp to apply proper motion.
In the prevision revision, the time argument was missing and the proper motion was not applied. [`2625 <https://github.com/cta-observatory/ctapipe/pull/2625>`__]

- Move the simulated shower distribution from something
that was specific to ``SimTelEventSource`` to a general interface
of ``EventSource``. Implement the new interface in both ``SimTelEventSource``
and ``HDF5EventSource`` and adapt writing of this information in ``DataWriter``.

This makes sure that the ``SimulatedShowerDistribution`` information is always
included, also when running ``ctapipe-process`` consecutively. [`2633 <https://github.com/cta-observatory/ctapipe/pull/2633>`__]

- The following dependencies are now optional:

* eventio, used for ``ctapipe.io.SimTelEventSource``.
* matplotlib, used ``ctapipe.visualization.CameraDisplay``, ``ctapipe.visualization.ArrayDisplay``,
and most default visualization tasks, e.g. ``.peek()`` methods.
* iminuit, used for the ``ctapipe.image.muon`` and ``ctapipe.reco.impact`` fitting routines.
* bokeh, for ``ctapipe.visualiation.bokeh``

Code that needs these dependencies will now raise ``ctapipe.exceptions.OptionalDependencyMissing``
in case such functionality is used and the dependency in question is not installed.

These packages will now longer be installed by default when using e.g. ``pip install ctapipe``.

If you want to install ctapipe with all optional dependencies included, do ``pip install "ctapipe[all]"``.

For ``conda``, we will publish to packages: ``ctapipe`` will include all optional dependencies
and a new ``ctapipe-base`` package will only include the required dependencies.

[`2641 <https://github.com/cta-observatory/ctapipe/pull/2641>`__]

- * Add possibility to directly pass the reference metadata to
``Provenance.add_input_file``.
* Remove the call to ``Provenace.add_input_file`` from the
``EventSource`` base class.
* Add the proper calls to ``Provenance.add_input_file`` in
``HDF5EventSource`` (providing the metadata) and
``SimTelEventSource`` (not providing metadata yet, but avoiding a warning)
* Plugin implementations of ``EventSource`` should make sure they
register their input files using ``Provenance.add_input_file``, preferably
providing also the reference metadata. [`2648 <https://github.com/cta-observatory/ctapipe/pull/2648>`__]


Bug Fixes
---------

- Fix ensuring that hdf5 files created with older versions of ctapipe, e.g.
the public dataset created with 0.17 can be read by ctapipe-process.
These files contain pointing information at a different location and
are missing the subarray reference location, which was introduced
in later versions of ctapipe. A dummy location (lon=0, lat=0)
is used for these now, the same value is already used for simtel files
lacking this information. [`2627 <https://github.com/cta-observatory/ctapipe/pull/2627>`__]

New Features
------------

- Add option ``override_obs_id`` to ``SimTelEventSource`` which allows
assigning new, unique ``obs_ids`` in case productions reuse CORSIKA run
numbers. [`2411 <https://github.com/cta-observatory/ctapipe/pull/2411>`__]

- Add calibration calculators which aggregates statistics, detects outliers, handles faulty data chunks. [`2609 <https://github.com/cta-observatory/ctapipe/pull/2609>`__]

- Update ``CameraCalibrator`` in ``ctapipe.calib.camera.calibrator`` allowing it to correctly calibrate variance images generated with the ``VarianceExtractor``.
- If the ``VarianceExtractor`` is used for the ``CameraCalibrator`` the element-wise square of the relative and absolute gain calibration factors are applied to the image;
- For other image extractors the plain factors are still applied.
- The ``VarianceExtractor`` provides no peak time and the calibrator will skip shifting the peak time for extractors like the ``VarianceExtractor`` that similarly do not provide a peak time [`2636 <https://github.com/cta-observatory/ctapipe/pull/2636>`__]

- Add ``__repr__`` methods to all objects that were missing
them in ``ctapipe.io.metadata``, update the existing ones
for consistency. [`2650 <https://github.com/cta-observatory/ctapipe/pull/2650>`__]

0.22.0

============================

API Changes
-----------

- The ``PointingInterpolator`` was moved from ``ctapipe.io`` to ``ctapipe.monitoring``. [`2615 <https://github.com/cta-observatory/ctapipe/pull/2615>`__]


Bug Fixes
---------

- Fix a redundant error message in ``Tool`` caused by normal ``SystemExit(0)`` [`2575 <https://github.com/cta-observatory/ctapipe/pull/2575>`__]

- Fix error message for non-existent config files. [`2591 <https://github.com/cta-observatory/ctapipe/pull/2591>`__]


New Features
------------

- ctapipe is now compatible with numpy 2.0. [`2580 <https://github.com/cta-observatory/ctapipe/pull/2580>`__]
Note: not all new behaviour of numpy 2.0 is followed, as the core dependency ``numba`` does not yet implement
all changes from numpy 2.0. See `the numba announcement for more detail <https://numba.discourse.group/t/communicating-numpy-2-0-changes-to-numba-users/2457>`_.

- Add lstchains image cleaning procedure including its pedestal cleaning method. [`2541 <https://github.com/cta-observatory/ctapipe/pull/2541>`__]

- A new ImageExtractor called ``VarianceExtractor`` was added
An Enum class was added to containers.py that is used in the metadata of the VarianceExtractor output [`2543 <https://github.com/cta-observatory/ctapipe/pull/2543>`__]

- Add API to extract the statistics from a sequence of images. [`2554 <https://github.com/cta-observatory/ctapipe/pull/2554>`__]

- The provenance system now records the reference metadata
of input and output files, if available. [`2598 <https://github.com/cta-observatory/ctapipe/pull/2598>`__]

- Add Interpolator class to generalize the PointingInterpolator in the monitoring collection. [`2600 <https://github.com/cta-observatory/ctapipe/pull/2600>`__]

- Add outlier detection components to identify faulty pixels. [`2604 <https://github.com/cta-observatory/ctapipe/pull/2604>`__]

- The ``ctapipe-merge`` tool now checks for duplicated input files and
raises an error in that case.

The ``HDF5Merger`` class, and thus also the ``ctapipe-merge`` tool,
now checks for duplicated obs_ids during merging, to prevent
invalid output files. [`2611 <https://github.com/cta-observatory/ctapipe/pull/2611>`__]

- The ``Instrument.site`` metadata item now accepts any string,
not just a pre-defined list of sites. [`2616 <https://github.com/cta-observatory/ctapipe/pull/2616>`__]

Refactoring and Optimization
----------------------------

- Update exception handling in tools

- Add a possibility to handle custom exception in ``Tool.run()``
with the preservation of the exit code. [`2594 <https://github.com/cta-observatory/ctapipe/pull/2594>`__]

0.21.2

============================

A small bugfix release to add support for scipy 1.14.

Also contains a small new feature regarding exit code handling in ``Tool``.

Bug Fixes
---------

- Replace deprecated usage of scipy sparse matrices, adds support for scipy 1.14. [`2569 <https://github.com/cta-observatory/ctapipe/pull/2569>`__]


New Features
------------

- Add ``SystemExit`` handling at the ``ctapipe.core.Tool`` level

If a ``SystemExit`` with a custom error code is generated during the tool execution,
the tool will be terminated gracefully and the error code will be preserved and propagated.

The ``Activity`` statuses have been updated to ``["running", "success", "interrupted", "error"]``.
The ``"running"`` status is assigned at init. [`2566 <https://github.com/cta-observatory/ctapipe/pull/2566>`__]


Maintenance
-----------

- made plugin detection less verbose in logs: DEBUG level used instead of INFO [`2560 <https://github.com/cta-observatory/ctapipe/pull/2560>`__]

Page 1 of 4

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.