Giter Club home page Giter Club logo

spe's Introduction

SPE Acceptance Code

Evan Shockley

email: [email protected]

Overview

This folder contains several scripts (bash and python) and notebooks that are used to calculate/analyze SPE acceptance. To extract the SPE acceptance, we take low intensity LED runs and a 'blank' run, which is externally triggered just as an LED run but with no light emitted. By subtracting the blank amplitude spectrum from the LED amplitude spectrum, we can extract the SPE amplitude distribution and from there easily calculate the acceptance as a function of amplitude (or threshold).

One complication to the code is that, due to non-uniform LED exposure to PMTs, we need to take 3 different SPE acceptance LED runs. Therefore we need to pair runs together in a runlist.txt which is used to submit jobs for each LED run, then kinda splice the results together at the end.

How to run the code

It is preferred to submit to xenon1t nodes from midway2 (ssh <user>@midway2.rcc.uchicago.edu). You must be in a pax environment (pax_head should be fine).

source activate pax_head

You must execute all scripts from inside the spe_acceptance directory since the code uses relative paths currently.

make_runlist.py uses the RunsDB to pair SPE acceptance runs with blank runs and write a text file that is used in various parts of the analysis. It has a dry-run mode, so

python make_runlist.py

can be used to make sure runs are getting paired up correctly, and

python make_runlist.py write

actually writes the files to the runlists directory.

If you want to submit jobs for one runlist, you can do

./submit_jobs.sh <runlist>

or use large_submission.sh to submit jobs for all runlists in a directory (skipping runs who have data directories inside data).

These jobs download the raw data if needed, and then execute the python script spe_acceptance.py, which processes the raw data and writes to csv files in the data directory.

After the jobs finish, you can use the Jupyter notebooks to analyze data (mostly using the analyze.py module) and write to the acceptance_data directory, which contains files with the acceptance fraction for each channel as calculated using the 3 LED runs listed.

email me with any questions or problems, tried to keep this short.

spe's People

Contributors

ershockley avatar awalsh272 avatar katrinamiller avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

skazama

spe's Issues

plotting

Re-add easy plotting functionality. I think it's best to define in a notebook, but could be convinced that it's nice to have in analyze.py.

General cleanup

Should clean up the code so that there are only modules to

  • process the data (including job submission)
  • analyze the data
  • notebook that uses the analyze module to plot data, etc

Statistical errors

We can now propagate systematic uncertainties fairly easily, but we need to work on the statistical uncertainties. This is fairly tricky due to correlated errors, so we will probably have to look up in books/literature how to do it. Steps are as follows:

  • LED and noise run have normal poisson errors for each bin
  • after subtraction LED-noise, can propagate in standard way because the two runs are independent
  • now tricky part, the acceptance. The total error of the integral is doable, but how to propagate something like "integral from x to inf" / "integral of -inf to inf"? These two values are correlated with each other so cannot do standard undergrad error propagation. I've never had to do something like this before... has anyone else?

Shifter notebook issues

As I try to run the shifter notebook i will just make issues here. Will update as i find more.

First, in the cell where the pickle file is loaded I get this error:

NameError: name 'newest_runlist' is not defined

@awalsh272 I'm guessing you never restarted the kernel to test the notebook. Can you fix and test with new kernel?

Keep data in common place

Right now all the spe data is stored in the repo and on midway in /home. We should keep in a common place (/project/lgrandi/ probably). This requires changing the i/o locations and also need to keep in mind permissions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.