Skip to content

Quickstart

Here is a quick guide to get started with NXCALS.

Registration

Registration process is described in Getting access.

Timber (extraction web interface)

You can explore data from NXCALS using timber.

Java API

Consult our Java NXCALS examples project. Supported versions you can check on dedicated page.

Important

Running NXCALS bundle and executing NXCALS examples require additional configuration steps.

Python API

To set up you python environment, please check Setting up Python environments page. Currently, NXCALS provides a Python API only for Data Extraction API. There is a possibility of accessing from Python other NXCALS Java APIs such as:

by using Py4J or JPype.

SWAN

Using SWAN is the easiest and recommended way for simple scripting. Everything is configured and up to date. For more details check Using SWAN page.

Instalation on LXPLUS

For instuction how to install and run NXCALS Python package on LXPLUS please consult Using LXPLUS page.

Instalation nxcals package from acc-py repository

Installation

Install Python NXCALS Extraction APIs (pySpark based). To be able to install package, you need Python3, in version at least 3.7. (currently supported version is 3.9.7) Acc-Py is available on machines from the CERN accelerator sector (ACC).

source /acc/local/share/python/acc-py/base/pro/setup.sh
acc-py venv ./venv
source ./venv/bin/activate
python -m pip install nxcals
python3 -m venv ./venv
source ./venv/bin/activate
python -m pip install -U --index-url https://acc-py-repo.cern.ch/repository/vr-py-releases/simple --trusted-host acc-py-repo.cern.ch nxcals

Running

You need a valid kerberos ticket. To init kerberos:

kinit

Activate virtual environment:

source ./venv/bin/activate

And later start python and create spark object:

from nxcals.spark_session_builder import get_or_create
from nxcals.api.extraction.data.builders import DataQuery
spark = get_or_create("My_APP")

df = DataQuery.builder(spark).entities().system('CMW') \
    .keyValuesEq({'device': 'LHC.LUMISERVER', 'property': 'CrossingAngleIP1'}) \
    .timeWindow('2022-04-22 00:00:00.000', '2022-04-23 00:00:00.000') \
    .build()

You can find more examples in Extraction API chapter. Common problems are described in Setting up Python environments.