Skip to content

Commit

Permalink
Merge branch 'master' into ashkar_pixel_participation
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenain authored Feb 1, 2024
2 parents 04435d1 + a31bad2 commit 0d595d3
Show file tree
Hide file tree
Showing 73 changed files with 4,675 additions and 2,523 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
ctapipe-version: [v0.19.1]
ctapipe-version: [v0.19.3]
install-method: [ "mamba", "pip" ]

defaults:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/deploy-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
apptainer-version: 1.1.7

- name: Build ${{ matrix.deffiles[1] }}
- name: Build ${{ env.container }} container
run: |
echo "Preparing to build ${{ env.container }} from ${{ matrix.deffiles[0] }}"
if [ ! -f "${{ matrix.deffiles[0]}}" ]; then
Expand All @@ -55,7 +55,14 @@ jobs:
run: |
echo ${{ github.token }} | apptainer remote login --username ${{ github.actor }} --password-stdin oras://${{ env.registry }}
- name: Deploy ${{ matrix.deffiles[1] }}
- name: Deploy ${{ env.container }} container ${{ github.ref_name }}
# Assign the release tag to container on release
if: github.event_name == 'release'
run: |
apptainer push ${{ env.container }}.sif oras://${{ env.registry }}/${{ github.repository }}:${{ github.ref_name }}
- name: Deploy ${{ env.container }} container ${{ matrix.deffiles[1] }}
# Otherwise, the container tag is "latest" by default.
# Don't push the container on a pull request.
if: github.event_name != 'pull_request'
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ src/nectarchain/user_scripts/**/test
**.log
**.pdf
**.csv
**.png

#VScode
.vscode/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ or the [container alternative](#note-to-macos-users) as explained above.

All contribution are welcome.

Guidelines are the same as [ctapipe's ones](https://ctapipe.readthedocs.io/en/latest/getting_started/)
See [here](https://ctapipe.readthedocs.io/en/latest/development/pullrequests.html#pullrequests) how to make a pull request to contribute.
Guidelines are the same as [ctapipe's ones](https://ctapipe.readthedocs.io/en/latest/developer-guide/getting-started.html).
See [here](https://ctapipe.readthedocs.io/en/latest/developer-guide/pullrequests.html#pullrequests) how to make a pull request to contribute.


## Report issue / Ask a question
Expand Down
18 changes: 11 additions & 7 deletions Singularity
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ From: condaforge/mambaforge
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
mamba deactivate
mamba activate nectarchain
pip install CTADIRAC COMDIRAC
pip install CTADIRAC

# Since there is no proxy available at build time, manually configure the CTADIRAC client
cat <<EOF > ${CONDA_PREFIX}/etc/dirac.cfg
Expand All @@ -64,9 +64,11 @@ DIRAC
{
Servers = dips://dcta-servers03.pic.es:9135/Configuration/Server
Servers += dips://dcta-agents03.pic.es:9135/Configuration/Server
Servers += dips://ccdcta-server04.in2p3.fr:9135/Configuration/Server
Servers += dips://ccdcta-server05.in2p3.fr:9135/Configuration/Server
Servers += dips://ccdcta-web01.in2p3.fr:9135/Configuration/Server
Servers += dips://ctadirac-01.cscs.cta-observatory.org:9135/Configuration/Server
Servers += dips://ctadirac-02.cscs.cta-observatory.org:9135/Configuration/Server
Servers += dips://ctadirac-03.cscs.cta-observatory.org:9135/Configuration/Server
Servers += dips://ctadirac-04.cscs.cta-observatory.org:9135/Configuration/Server
Servers += dips://ctadirac-05.cscs.cta-observatory.org:9135/Configuration/Server
Servers += dips://cta-dirac.zeuthen.desy.de:9135/Configuration/Server
}
Security
Expand All @@ -79,9 +81,11 @@ LocalInstallation
Setup = CTA
ConfigurationServer = dips://dcta-servers03.pic.es:9135/Configuration/Server
ConfigurationServer += dips://dcta-agents03.pic.es:9135/Configuration/Server
ConfigurationServer += dips://ccdcta-server04.in2p3.fr:9135/Configuration/Server
ConfigurationServer += dips://ccdcta-server05.in2p3.fr:9135/Configuration/Server
ConfigurationServer += dips://ccdcta-web01.in2p3.fr:9135/Configuration/Server
ConfigurationServer += dips://ctadirac-01.cscs.cta-observatory.org:9135/Configuration/Server
ConfigurationServer += dips://ctadirac-02.cscs.cta-observatory.org:9135/Configuration/Server
ConfigurationServer += dips://ctadirac-03.cscs.cta-observatory.org:9135/Configuration/Server
ConfigurationServer += dips://ctadirac-04.cscs.cta-observatory.org:9135/Configuration/Server
ConfigurationServer += dips://ctadirac-05.cscs.cta-observatory.org:9135/Configuration/Server
ConfigurationServer += dips://cta-dirac.zeuthen.desy.de:9135/Configuration/Server
SkipCAChecks = True
}
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- conda-forge
dependencies:
- python=3.11
- ctapipe=0.19.1
- ctapipe=0.19
- ctapipe-io-nectarcam
- jinja2=3.0.1
- jupyterlab
Expand Down
75 changes: 75 additions & 0 deletions notebooks/tool_implementation/tuto_SPE.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.14.6
# kernelspec:
# display_name: nectarchain
# language: python
# name: python3
# ---

# %%
import logging
import os
import pathlib

logging.basicConfig(
format="%(asctime)s %(name)s %(levelname)s %(message)s", level=logging.INFO
)
log = logging.getLogger(__name__)
log.handlers = logging.getLogger("__main__").handlers

from nectarchain.makers.calibration import (
FlatFieldSPEHHVStdNectarCAMCalibrationTool,
FlatFieldSPENominalStdNectarCAMCalibrationTool,
)

# %%
run_number = 3936

# %%

# !ls -lh $NECTARCAMDATA/runs/*

# %%
tool = FlatFieldSPENominalStdNectarCAMCalibrationTool(
progress_bar=True,
method="LocalPeakWindowSum",
extractor_kwargs={"window_width": 12, "window_shift": 4},
multiproc=True,
nproc=10,
run_number=run_number,
max_events=10000,
log_level=20,
reload_events=True,
# events_per_slice = 200,
asked_pixels_id=[52, 48],
output_path=pathlib.Path(os.environ.get("NECTARCAMDATA", "/tmp"))
/ "tutorials/"
/ f"SPEfit_{run_number}.h5",
)

# %%
tool

# %%
tool.initialize()

# %%
tool.setup()

# %%
tool.start()

# %%
output = tool.finish(return_output_component=True, display=True, figpath=os.getcwd())
output

# %%
output[0].resolution

# %%
Loading

0 comments on commit 0d595d3

Please sign in to comment.