Ctapipe

Latest version: v0.21.0

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

Scan your dependencies

Page 1 of 3

0.21.0

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


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

- ``reference_location`` is now a required argument for ``SubarrayDescription``
[`2402 <https://github.com/cta-observatory/ctapipe/pull/2402>`__]

- ``CameraGeometry.position_to_pix_index`` will now return the minimum integer value for invalid
pixel coordinates instead of -1 due to the danger of using -1 as an index in python accessing
the last element of a data array for invalid pixels.
The function will now also no longer raise an error if the arguments are empty arrays and instead
just return an empty index array.
The function will also no longer log a warning in case of coordinates that do not match a camera pixel.
The function is very low-level and if not finding a pixel at the tested position warrants a warning or
is expected will depend on the calling code. [`2397 <https://github.com/cta-observatory/ctapipe/pull/2397>`__]

- Change the definition of the ``leakage_pixels_width_{1,2}`` image features
to give the ratio of pixels at the border to the pixels after cleaning
instead of to the total number of pixels of the camera. [`2432 <https://github.com/cta-observatory/ctapipe/pull/2432>`__]

- Change how the ``DataWriter`` writes pointing information.
Before, each unique pointing position was written in a table
with the event time as index column into ``dl1/monitoring/telescope/pointing``.

This has two issues: For observed data, each pointing will be unique
in horizontal coordinates due to tracking a fixed ICRS coordinate.
Resulting in a pointing position written for each event, although the
resolution of the monitoring is much lower.
For simulated events, the event time is the timestamp of the simulation
and pointing is fixed in ``AltAz``.
``ctapipe`` was using the closest point in time for simulated events when
reading data back in, however, this is problematic in case of many
simulation runs processed in parallel.

We now store the first received pointing information
in the ``configuration/telescope/pointing`` table per obs id,
only for simulation events. [`2438 <https://github.com/cta-observatory/ctapipe/pull/2438>`__]

- Replace ``n_signal`` and ``n_background`` options in ``ctapipe-train-particle-classifier``
with ``n_events`` and ``signal_fraction``, where ``signal_fraction`` = n_signal / (n_signal + n_background). [`2465 <https://github.com/cta-observatory/ctapipe/pull/2465>`__]

- Move the ``TableLoader`` options from being traitlets to
each ``read_...`` method allowing to load different data with the
same TableLoader-Instance.

In addition the default values for the options have changed. [`2482 <https://github.com/cta-observatory/ctapipe/pull/2482>`__]

- Adding monitoring: MonitoringCameraContainer as keyword argument to
the ``ImageCleaner`` API so cleaning algorithms can now access
relevant information for methods that e.g. require monitoring information. [`2511 <https://github.com/cta-observatory/ctapipe/pull/2511>`__]

- Unified the options for DataWriter and the data level names:

+-------------------------+--------------------------+
| Old | New |
+=========================+==========================+
| ``write_raw_waveforms`` | ``write_r0_waveforms`` |
+-------------------------+--------------------------+
| ``write_waveforms`` | ``write_r1_waveforms`` |
+-------------------------+--------------------------+
| ``write_images`` | ``write_dl1_images`` |
+-------------------------+--------------------------+
| ``write_parameters`` | ``write_dl1_parameters`` |
+-------------------------+--------------------------+
| ``write_showers`` | ``write_dl2`` |
+-------------------------+--------------------------+

This changes requires that existing configuration files are updated
if they use these parameters [`2520 <https://github.com/cta-observatory/ctapipe/pull/2520>`__]


Bug Fixes
---------

- Ensure that ``SubarrayDescription.reference_location`` is always generated by
SimTelEventSource``, even if the metadata is missing. In that case, construct a
dummy location with the correct observatory height and latitude and longitude
equal to zero ("Null Island").

- Fixed the definition of ``h_max``, which was both inconsistent between
`~ctapipe.reco.HillasReconstructor` and `~ctapipe.reco.HillasIntersection`
implementations, and was also incorrect since it was measured from the
observatory elevation rather than from sea level.

The value of ``h_max`` is now defined as the height above sea level of the
shower-max point (in meters), not the distance to that point. Therefore it is
not corrected for the zenith angle of the shower. This is consistent with the
options currently used for *CORSIKA*, where the *SLANT* option is set to false,
meaning heights are actual heights not distances from the impact point, and
``x_max`` is a *depth*, not a *slant depth*. Note that this definition may be
inconsistent with other observatories where slant-depths are used, and also note
that the slant depth or distance to shower max are the more useful quantities
for shower physics. [`2403 <https://github.com/cta-observatory/ctapipe/pull/2403>`__]

- Add the example config for ctapipe-train-disp-reconstructor
to the list of configs generated by ctapipe-quickstart. [`2414 <https://github.com/cta-observatory/ctapipe/pull/2414>`__]

- Do not use a hidden attribute of ``SKLearnReconstructor`` in ``ctapipe-apply-models``. [`2418 <https://github.com/cta-observatory/ctapipe/pull/2418>`__]

- Add docstring for ``ctapipe-train-disp-reconstructor``. [`2420 <https://github.com/cta-observatory/ctapipe/pull/2420>`__]

- Remove warnings about missing R1 or DL0 data when using the CameraCalibrator.
These were previously emitted directly as python warnings and did not use the
component logging system, which they now do.
As we do not actually expect R1 to be present it was also moved down to
debug level. [`2421 <https://github.com/cta-observatory/ctapipe/pull/2421>`__]

- Check that the array pointing is given in horizontal coordinates
before training a ``DispReconstructor``. [`2431 <https://github.com/cta-observatory/ctapipe/pull/2431>`__]

- Fix additional, unwanted columns being written into disp prediction output. [`2440 <https://github.com/cta-observatory/ctapipe/pull/2440>`__]

- Properly transform pixel coordinates between ``CameraFrame``
and ``TelescopeFrame`` in ``MuonIntensityFitter`` taking.
Before, ``MuonIntensityFitter`` always used the equivalent focal
length for transformations, now it is using the focal length
attached to the ``CameraGeometry``, thus respecting the
``focal_length_choice`` options of the event sources. [`2464 <https://github.com/cta-observatory/ctapipe/pull/2464>`__]

- Fix colored logging in case of custom log levels being defined. [`2505 <https://github.com/cta-observatory/ctapipe/pull/2505>`__]

- Fix a possible out-of-bounds array access in the FlashCamExtractor. [`2544 <https://github.com/cta-observatory/ctapipe/pull/2544>`__]


Data Model Changes
------------------

- Remove redundant ``is_valid`` field in ``DispContainer`` and rename the remaining field.
Use the same prefix for both containers filled by ``DispReconstructor``.

Fix default name of ``DispReconstructor`` target column.

Let ``HDF5EventSource`` load ``DispContainer``. [`2443 <https://github.com/cta-observatory/ctapipe/pull/2443>`__]

- Change R1- and DL0-waveforms datamodel shape from (n_pixels, n_samples)
to be always (n_channels, n_pixels, n_samples). ``HDF5EventSource`` was adjusted
accordingly to support also older datamodel versions.

Re-introduce also the possibility of running ``ImageExtractor``\s on data
consisting of multiple gain channels. [`2529 <https://github.com/cta-observatory/ctapipe/pull/2529>`__]


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

- Large updates to the Image Pixel-wise fit for Atmospheric Cherenkov Telescopes reconstruction method (https://doi.org/10.48550/arXiv.1403.2993)

* ImPACT - General code clean up and optimisation. Now updated to work similarly to other reconstructors using the standardised interface, such that it can be used ctapipe-process. Significant improvements to tests too
* ImPACT_utilities - Created new file to hold general usage functions, numba used in some areas for speedup
* template_network_interpolator - Now works with templates with different zenith and azimuth angles
* unstructured_interpolator - Significant speed improvements
* pixel_likelihood - Constants added back to neg_log_likelihood_approx, these are quite important to obtaining a well normalised goodness of fit.
* hillas_intersection - Fixed bug in core position being incorrectly calculated, fixed tests too [`2305 <https://github.com/cta-observatory/ctapipe/pull/2305>`__]

- Allow passing the matplotlib axes to the ``SubarrayDescription.peek`` function,
fix warnings in case of layout engine being already defined. [`2369 <https://github.com/cta-observatory/ctapipe/pull/2369>`__]

- Add support for interpolating a monitoring pointing table
in ``TableLoader``. The corresponding table is not yet written by ``ctapipe``,
but can be written by external tools.
This is to enable analysis of real observations, where the pointing changes over time in
alt/az. [`2409 <https://github.com/cta-observatory/ctapipe/pull/2409>`__]

- Implement the overburden-to height a.s.l. transformation function in the atmosphere module
and test that round-trip returns original value. [`2422 <https://github.com/cta-observatory/ctapipe/pull/2422>`__]

- In case no configuration is found for a telescope in ``TelescopeParameter``,
it is now checked whether the telescope exists at all to provide a better
error message. [`2429 <https://github.com/cta-observatory/ctapipe/pull/2429>`__]

- Allow setting n_jobs on the command line for the
train_* and apply_models tools using a new ``n_jobs`` flag.
This temporarily overwrites any settings in the (model) config(s). [`2430 <https://github.com/cta-observatory/ctapipe/pull/2430>`__]

- Add support for using ``str`` and ``Path`` objects as input
to ``ctapipe.io.get_hdf5_datalevels``. [`2451 <https://github.com/cta-observatory/ctapipe/pull/2451>`__]

- The recommended citation for ctapipe has been updated to the ICRC 2023 proceeding,
please update. [`2470 <https://github.com/cta-observatory/ctapipe/pull/2470>`__]

- Support astropy 6.0. [`2475 <https://github.com/cta-observatory/ctapipe/pull/2475>`__]

- The ``DispReconstructor`` now computes a score for how certain the prediction of the disp sign is. [`2479 <https://github.com/cta-observatory/ctapipe/pull/2479>`__]

- Also load the new fixed pointing information in ``TableLoader``.

Add option ``keep_order`` to ``ctapipe.io.astropy_helpers.join_allow_empty``
that will keep the original order of rows when performing left or right joins. [`2481 <https://github.com/cta-observatory/ctapipe/pull/2481>`__]

- Add an ``AstroQuantity`` trait which can hold any ``astropy.units.Quantity``. [`2524 <https://github.com/cta-observatory/ctapipe/pull/2524>`__]

- Add function ``ctapipe.coordinates.get_point_on_shower_axis``
that computes a point on the shower axis in alt/az as seen
from a telescope. [`2537 <https://github.com/cta-observatory/ctapipe/pull/2537>`__]

- Update bokeh dependency to version 3.x. [`2549 <https://github.com/cta-observatory/ctapipe/pull/2549>`__]


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

- The CI system now reports to the CTA SonarQube instance for code quality tracking [`2214 <https://github.com/cta-observatory/ctapipe/pull/2214>`__]

- Updated some numpy calls to not use deprecated functions. [`2406 <https://github.com/cta-observatory/ctapipe/pull/2406>`__]

- The ``ctapipe`` source code repository now uses the ``src/``-based layout.
This fixes the editable installation of ctapipe. [`2459 <https://github.com/cta-observatory/ctapipe/pull/2459>`__]

- Fix headings in docs. Change occurrences of ``API Reference`` to ``Reference/API`` for consistency.
Change capitalization of some headings for consistency. [`2474 <https://github.com/cta-observatory/ctapipe/pull/2474>`__]

- The ``from_name`` methods of instrument description classes now raise a warning
that it is better to access instrument information via a ``SubarrayDescription``.

Also improve documentation in instrument module to explain when not to use the
various ``from_name()`` methods. These are provided for the case when no event
data is available, e.g. for unit testing or demos, but do not guarantee that the
returned instrument information corresponds to a particular set of event data. [`2485 <https://github.com/cta-observatory/ctapipe/pull/2485>`__]

- Support and test on python 3.12. [`2486 <https://github.com/cta-observatory/ctapipe/pull/2486>`__]

- Drop support for python 3.9. [`2526 <https://github.com/cta-observatory/ctapipe/pull/2526>`__]


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

- Load data and apply event and column selection in chunks in ``ctapipe-train-*``
before merging afterwards.
This reduces memory usage. [`2423 <https://github.com/cta-observatory/ctapipe/pull/2423>`__]

- Make default ML config files more readable and add comments. [`2455 <https://github.com/cta-observatory/ctapipe/pull/2455>`__]

- Update and add missing docstrings related to the ML functionalities. [`2456 <https://github.com/cta-observatory/ctapipe/pull/2456>`__]

- Add ``true_impact_distance`` to the output of ``CrossValidator``. [`2468 <https://github.com/cta-observatory/ctapipe/pull/2468>`__]

- Add ``cache=True`` to some numba-compiled functions which were missing it. [`2477 <https://github.com/cta-observatory/ctapipe/pull/2477>`__]

- Write cross validation results for each model out immediately after validation to free up memory earlier. [`2483 <https://github.com/cta-observatory/ctapipe/pull/2483>`__]

- Compute deconvolution parameters in FlashCamExtractor only as needed. [`2545 <https://github.com/cta-observatory/ctapipe/pull/2545>`__]

0.20.0

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


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

- The ``ctapipe-dump-triggers`` tool was removed, since it wrote a custom data format
not compatible with e.g. the output of the ``DataWriter`` and ``ctapipe-process``.
If you only want to store trigger and simulation information from simulated / DL0
input files into the ctapipe format HDF5 files, you can now use
``ctapipe-process -i <input> -o <output> --no-write-parameters``. [`2375 <https://github.com/cta-observatory/ctapipe/pull/2375>`__]

- Change the fill value for invalid telescope ids in ``SubarrayDescription.tel_index_array``
from ``-1`` to ``np.iinfo(int).minval`` to prevent ``-1`` being used as an index resulting in the last element being used for invalid telescope ids. [`2376 <https://github.com/cta-observatory/ctapipe/pull/2376>`__]

- Remove ``EventSource.from_config``, simply use ``EventSource(config=config)`` or
``EventSource(parent=parent)``. [`2384 <https://github.com/cta-observatory/ctapipe/pull/2384>`__]


Data Model Changes
------------------

- Added missing fields defined in the CTAO R1 and DL0 data models to the corresponding containers. [`2338 <https://github.com/cta-observatory/ctapipe/pull/2338>`__]

- Remove the ``injection_height`` field from the ``SimulationConfigContainer``,
this field was always empty and is never filled by ``sim_telarray``.

Add the corresponding ``starting_grammage`` field to the ``SimulatedShowerContainer``,
where it is actually available. [`2343 <https://github.com/cta-observatory/ctapipe/pull/2343>`__]

- Added new fields to the ``MuonEfficiencyContainer`` - ``is_valid`` to check if fit converged successfully, ``parameters_at_limit`` to check if parameters were fitted close to a bound and ``likelihood_value`` which represents cost function value atthe minimum. These fields were added to the output of the ``MuonIntensityFitter``. [`2381 <https://github.com/cta-observatory/ctapipe/pull/2381>`__]


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

- Remove writing the full provenance information to the log and instead simply refer the reader to the actual provenance file. [`2328 <https://github.com/cta-observatory/ctapipe/pull/2328>`__]

- Add support for including r1 and r0 waveforms in the ``ctapipe-merge`` tool. [`2386 <https://github.com/cta-observatory/ctapipe/pull/2386>`__]


Bug Fixes
---------

- The HillasIntersection method used to fail when individual events were reconstructed to originate from a FoV offset of more than 90 degrees.
This is now fixed by returning an INVALID container for a reconstructed offset of larger than 45 degrees. [`2265 <https://github.com/cta-observatory/ctapipe/pull/2265>`__]

- Fixed a bug in the calculation of the full numeric pixel likelihood and the corresponding tests. [`2388 <https://github.com/cta-observatory/ctapipe/pull/2388>`__]


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

- Drop support for python 3.8 in accordance with the NEP 29 schedule. [`2342 <https://github.com/cta-observatory/ctapipe/pull/2342>`__]

- * Switched to ``PyData`` theme for docs
* Updated ``Sphinx`` to version 6.2.1
* Updated front page of docs [`2373 <https://github.com/cta-observatory/ctapipe/pull/2373>`__]

0.19.3

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

This is a bugfix release fixing a number of bugs, mainly one preventing the processing of divergent pointing
prod6 data due to a bug in ``SoftwareTrigger``, see below for details.


Bug Fixes
---------

- Fix peak time units of FlashCamExtractor (See https://github.com/cta-observatory/ctapipe/issues/2336) [`#2337 <https://github.com/cta-observatory/ctapipe/pull/2337>`__]

- Fix shape of mask returned by ``NullDataVolumeReducer``. [`2340 <https://github.com/cta-observatory/ctapipe/pull/2340>`__]

- Fix definition of the ``--dl2-subarray`` flag of ``ctapipe-merge``. [`2341 <https://github.com/cta-observatory/ctapipe/pull/2341>`__]

- Fix ``ctapipe-train-disp-reconstructor --help`` raising an exception. [`2352 <https://github.com/cta-observatory/ctapipe/pull/2352>`__]

- Correctly fill ``reference_location`` for ``SubarrayDescription.tel_coords``. [`2354 <https://github.com/cta-observatory/ctapipe/pull/2354>`__]

- Fix ``SoftwareTrigger`` not removing all parts of a removed telescope event
from the array event leading to invalid files produced by ``DataWriter``. [`2357 <https://github.com/cta-observatory/ctapipe/pull/2357>`__]

- Fix that the pixel picker of the matplotlib ``CameraDisplay`` triggers
also for clicks on other ``CameraDisplay`` instances in the same figure. [`2358 <https://github.com/cta-observatory/ctapipe/pull/2358>`__]


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

- Add support for Hillas parameters in ``TelescopeFrame`` to
``CameraDisplay.overlay_moments`` and make sure that the
label text does not overlap with the ellipse. [`2347 <https://github.com/cta-observatory/ctapipe/pull/2347>`__]

- Add support for using ``ctapipe.image.toymodel`` features in ``TelescopeFrame``. [`2349 <https://github.com/cta-observatory/ctapipe/pull/2349>`__]


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

- Improve docstring and validation of parameters of ``CameraGeometry``. [`2361 <https://github.com/cta-observatory/ctapipe/pull/2361>`__]

0.19.2

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

This release contains a critical bugfix for the ``FlashCamExtractor`` that resulted
in non-sensical peak time values in DL1, see below.

Bug Fixes
---------

- Fix a bug in the peak_time estimation of ``FlashCamExtractor`` (See issue `2332 <https://github.com/cta-observatory/ctapipe/issues/2332>`_) [`#2333 <https://github.com/cta-observatory/ctapipe/pull/2333>`__]

0.19.1

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

This release is a small bugfix release for v0.19.0, that also includes a new feature enabling computing different
telescope multiplicities in the machine learning feature generation.

Thanks to the release of numba 0.57 and some minor fixes, ctapipe is now also compatible with Python 3.11.

Bug Fixes
---------

- Fix ``ApplyModels.overwrite``. [`2311 <https://github.com/cta-observatory/ctapipe/pull/2311>`__]

- Fix for config files not being included as inputs in provenance log. [`2312 <https://github.com/cta-observatory/ctapipe/pull/2312>`__]

- Fix calculation of the neighbor matrix of ``CameraGeometry`` for empty and single-pixel geometries. [`2317 <https://github.com/cta-observatory/ctapipe/pull/2317>`__]

- Fix HDF5Writer not working on windows due to using pathlib for hdf5 dataset names. [`2319 <https://github.com/cta-observatory/ctapipe/pull/2319>`__]

- Fix StereoTrigger assuming the wrong data type for ``tels_with_trigger``, resulting in
it not working for actual events read from an EventSource. [`2320 <https://github.com/cta-observatory/ctapipe/pull/2320>`__]

- Allow disabling the cross validation (by setting ``CrossValidator.n_cross_validations = 0``)
for the train tools. [`2310 <https://github.com/cta-observatory/ctapipe/pull/2310>`__]


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

- Add ``SubarrayDescription.multiplicity`` method that can compute
telescope multiplicity for a given telescope boolean mask, either for
all telescope or a given telescope type.

Enable adding additional keyword arguments to ``FeatureGenerator``.

Pass the ``SubarrayDescription`` to ``FeatureGenerator`` in sklearn classes. [`2308 <https://github.com/cta-observatory/ctapipe/pull/2308>`__]


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

- Add support for python 3.11. [`2107 <https://github.com/cta-observatory/ctapipe/pull/2107>`__]

0.19.0

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

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

- Renamed ``GeometryReconstructor`` to ``HillasGeometryReconstructor`` [`2293 <https://github.com/cta-observatory/ctapipe/pull/2293>`__]


Bug Fixes
---------


Data Model Changes
------------------


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

- Add signal extraction algorithm for the FlashCam. [`2188 <https://github.com/cta-observatory/ctapipe/pull/2188>`__]


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

- The ``examples/`` subdirectory was removed as most scripts there were out of date. Useful information in those examples was moved to example notebooks in docs/examples [`2266 <https://github.com/cta-observatory/ctapipe/pull/2266>`__]

- The tools to train ml models now provide better error messages in case
the input files did not contain any events for specific telescope types. [`2295 <https://github.com/cta-observatory/ctapipe/pull/2295>`__]


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

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.