{ "cells": [ { "cell_type": "markdown", "id": "86a5df32-2d0e-4de1-a7c1-5dff2d96d39e", "metadata": {}, "source": [ "### How to access Strax data" ] }, { "cell_type": "markdown", "id": "af3ab6b7-9d20-47aa-9e5c-fb096a5b6853", "metadata": {}, "source": [ "Start with a conda environment {conda env:2022.11.1}\n", "Data is scattered in stor0, stor1 and stor2, most of the new data downloaded should be in stor2" ] }, { "cell_type": "markdown", "id": "01caea8b-f022-44d1-8a05-d42f2dcb030d", "metadata": {}, "source": [ "There might be an error when you import some of the following modules, you can ignore that." ] }, { "cell_type": "markdown", "id": "3c589d1a-41b3-4853-aaff-db112ca146cd", "metadata": {}, "source": [ "NOTE: Cutax does not come with the environments provided, you will have to downloaded an appropriate version of cutax (if you even need to use cutax/want to use it) at https://github.com/XENONnT/cutax" ] }, { "cell_type": "code", "execution_count": null, "id": "01aed115-c586-41a3-84b8-d988b1a0b51a", "metadata": {}, "outputs": [], "source": [ "import strax \n", "import straxen \n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import cutax # download cutax version 1.13.0\n" ] }, { "cell_type": "code", "execution_count": null, "id": "e3a2c4b5-924b-4ebe-9d94-ccd9ea9cdc9f", "metadata": {}, "outputs": [], "source": [ "run_id = '049047' #" ] }, { "cell_type": "markdown", "id": "c88bfbc2-c108-45fa-9778-dc67b709e783", "metadata": {}, "source": [ "You can set the environment to either use cutax or straxen, the functionality will be the same. The main difference is that cutax allows you to use data cuts." ] }, { "cell_type": "code", "execution_count": null, "id": "4156373e-f0a3-4fa4-a6ae-e02ea6e50120", "metadata": {}, "outputs": [], "source": [ "# For Cutax\n", "st = cutax.contexts.xenonnt_offline(cmt_version = 'global_v9',\n", " _raw_path = '/stor2/data/raw_recrods', \n", " _processed_path = '/stor2/data/processed_data', \n", " output_folder = '/stor2/data/processed_data')" ] }, { "cell_type": "code", "execution_count": null, "id": "34cb5b29-dcb9-4fac-887c-5f80c6a6cac7", "metadata": {}, "outputs": [], "source": [ "# For Straxen\n", "st = straxen.contexts.xenonnt(xedocs_version = 'global_v10',\n", " _raw_paths = '/stor2/data/raw_recrods', \n", " _processed_paths = '/stor2/data/processed_data', \n", " output_folder = '/stor2/data/processed_data')" ] }, { "cell_type": "code", "execution_count": null, "id": "28b19e98-5e0d-4b5d-98fb-2f23c004cf71", "metadata": {}, "outputs": [], "source": [ "st.is_stored(run_id, 'raw_records')" ] }, { "cell_type": "code", "execution_count": null, "id": "4bcbdff3-0c69-4c7d-8e4b-2c7fb653025d", "metadata": {}, "outputs": [], "source": [ "rn_peaks = st.get_array(run_id, 'peaks') # get peak level data! this might take a while if the data has not been generated" ] }, { "cell_type": "code", "execution_count": null, "id": "95f38754-8823-43e7-890b-ae5c192571e2", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:2022.11.1]", "language": "python", "name": "conda-env-2022.11.1-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.13" } }, "nbformat": 4, "nbformat_minor": 5 }