Skip to main content

Analysis chain for the CTA MSTN NectarCAM prototype

Project description

nectarchain Build Status

Repository for the high level analysis of the NectarCAM data. The analysis is heavily based on ctapipe, adding custom code for NectarCAM calibration.

Installation

nectarchain is available as a PyPI or conda package, or as a Singularity/Apptainer container.

Using conda/mamba

conda is a package manager, distributed e.g. within Anaconda. Use of its re-implementation in C++, mamba, is strongly advised instead. mamba is shipped e.g. within Mambaforge which can advantageously replace Anaconda altogether (lighter and faster).

mamba create -n nectarchain -c conda-forge nectarchain

Using pip

nectarchain can also be manually installed as a PyPI package, albeit following specific requirements which are automatically accounted for through a conda/mamba installation.

mamba create -n nectarchain python=3.8
mamba activate nectarchain
pip install nectarchain

As a container

nectarchain is planned to be pushed on each release on the GitHub Container Registry as an Apptainer image. Such a container can be instantiated with:

apptainer shell oras://ghcr.io/cta-observatory/nectarchain:latest

The nectarchain code is then available under /opt/cta/nectarchain.

DIRAC support is fully available and configured within such a container.

Note to macOS users

macOS users may experience errors when trying to initialize a proxy to DIRAC when the DIRAC support is enabled, especially with recent hardware equipped with M1 or M2 Apple CPU chips. The container alternative can then help having an environment with CTADIRAC fully configured. However, Apptainer is not readily available on macOS, but there is a workaround using lima virtualization technology on a Mac.

TL;DR

brew install qemu lima
limactl start template://apptainer
limactl shell apptainer apptainer run --bind $HOME:/home/$USER.linux oras://ghcr.io/cta-observatory/nectarchain:latest

If you are running a Mac which CPU is based on ARM architecture (M1 or M2 Apple chips), when starting the apptainer container (second line above), please select the Open an editor to review or modify the current configuration option and add the following line at the beginning of the configuration file:

arch: "x86_64"

otherwise, please proceed with the Proceed with the current configuration option.

The mount point /tmp/lima is shared between the host machine and the apptainer container, and writable from both.

Manual installation (for developers)

This is the recommended installation procedure for developers. nectarchain should be pip-installed in development (aka editable) mode.

git clone https://github.com/cta-observatory/nectarchain.git
cd nectarchain
mamba env create --name nectarchain --file environment.yml
mamba activate nectarchain
pip install -e .

Enable pre-commit hooks, which enforces adherence to PEP8 coding style:

pre-commit install

Please follow the same conventions as ctapipe regarding settings of Git remotes, and how to contribute to the code with pull requests.

Optional DIRAC support

Note: this is not needed if you are using nectarchain as a container, as DIRAC is already fully installed and configured within.

To enable support for DIRAC within the same environment, do the following after the installation of nectarchain described above:

mamba activate nectarchain 
mamba install dirac-grid
conda env config vars set X509_CERT_DIR=${CONDA_PREFIX}/etc/grid-security/certificates X509_VOMS_DIR=${CONDA_PREFIX}/etc/grid-security/vomsdir X509_VOMSES=${CONDA_PREFIX}/etc/grid-security/vomses
# The following is needed for the environment variables, used for DIRAC configuration, to be available:
mamba deactivate
mamba activate nectarchain
pip install CTADIRAC
dirac-configure

Some Mac OS users (running on M1 chip) may experience a M2Crypto.SSL.SSLError error when trying to initiate a DIRAC proxy with dirac-proxy-init. Instead of:

mamba install dirac-grid

one may try:

mamba install dirac-grid "voms=2.1.0rc2=h7a71a8a_7"

or the container alternative as explained above.

nectarchain is currently pinned to ctapipe version 0.19.

Contributing

All contribution are welcome.

Guidelines are the same as ctapipe's ones. See here how to make a pull request to contribute.

Report issue / Ask a question

Please use GitHub Issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nectarchain-0.1.7.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

nectarchain-0.1.7-py3-none-any.whl (188.2 kB view details)

Uploaded Python 3

File details

Details for the file nectarchain-0.1.7.tar.gz.

File metadata

  • Download URL: nectarchain-0.1.7.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for nectarchain-0.1.7.tar.gz
Algorithm Hash digest
SHA256 ad830de7540dd021852ccd24b11391d40eda7e3989ef32ed8ed0a90a9eb3a2d9
MD5 eb185762ecc4c350612557f2a6a1891f
BLAKE2b-256 11b06b6b57a77f12163a244c06f33f1b3d0480fbc035f7592311fdbf04696206

See more details on using hashes here.

File details

Details for the file nectarchain-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: nectarchain-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 188.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for nectarchain-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 27da814b451331da5cd34c6361c19f316fdbbdd2626da9bfec15d6e22422e7a4
MD5 cd94ddda71a59f223bc7bb88668e1296
BLAKE2b-256 d1b628cb79e87005778ed6d5d81eb8d919e01bb96fa5367e0a3632a231feb661

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page