Skip to content

jmosbacher/xepmts

Repository files navigation

xepmts

A helper package for managing the PMT database used by the XENONnT Dark Matter Experiment.

image

image

Documentation Status

Basic Usage

import xepmts

# If you are using a notebook:
xepmts.notebook()

# use v1 client
db = xepmts.login("v1", token='YOUR-API-TOKEN')

# or the v2 client
db = xepmts.login("v2")

# set the number of items to pull per page
db.tpc.installs.items_per_page = 25

# get the next page 
page = db.tpc.installs.next_page()

# iterate over pages:
for page in db.tpc.installs.pages():
    df = page.df
    # do something with data

# select only top array
top_array = db.tpc.installs.filter(array="top")

# iterate over top array pages
for page in top_array.pages():
    df = page.df
    # do something with data

query = dict(pmt_index=4)
# get the first page of results for this query as a list of dictionaries
docs = db.tpc.installs.find(query, max_results=25, page_number=1)

# same as find, but returns a dataframe 
df = db.tpc.installs.find_df(query)


# insert documents into the database
docs = [{"pmt_index": 1, "position_x": 0, "position_y": 0}]
db.tpc.installs.insert_documents(docs)

Features

  • TODO

Credits

This package was created with Cookiecutter and the briggySmalls/cookiecutter-pypackage project template.

About

PMT management tools for the XENON experiment

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages