示例#1
0
from pprint import pprint
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
from matplotlib.colors import LogNorm
from scipy.integrate import quad
import tinydb as db
import argparse

from pygama import DataSet
from pygama.analysis.calibration import *
from pygama.analysis.histograms import *
import pygama.utils as pgu
from matplotlib.lines import Line2D
from pygama.utils import set_plot_style
set_plot_style("clint")


def main():
    """
    Code for varying bias runs: 1174-1176
    """

    run_db, cal_db = "runDB.json", "calDB.json"

    par = argparse.ArgumentParser(description="A/E cut for MJ60")
    arg, st, sf = par.add_argument, "store_true", "store_false"
    arg("-ds", nargs='*', action="store", help="load runs for a DS")
    arg("-r", "--run", nargs=1, help="load a single run")
    arg("-db", "--writeDB", action=st, help="store results in DB")
    args = vars(par.parse_args())
示例#2
0
#!/usr/bin/env python3
import argparse
import numpy as np
import pandas as pd
import tinydb as db
import matplotlib.pyplot as plt
import itertools as it
from scipy.stats import mode
from pprint import pprint
from pygama import DataSet
from pygama.utils import set_plot_style, peakdet
set_plot_style('clint')


def main():
    """
    perform automatic calibration of pygama DataSets.
    command line options to specify the DataSet are the same as in processing.py
    save results in a JSON database for access by other routines.
    """
    run_db, cal_db = "runDB.json", "calDB.json"

    par = argparse.ArgumentParser(description="calibration suite for MJ60")
    arg, st, sf = par.add_argument, "store_true", "store_false"
    arg("-ds", nargs='*', action="store", help="load runs for a DS")
    arg("-r", "--run", nargs=1, help="load a single run")
    arg("-s", "--spec", action=st, help="print simple spectrum")
    arg("-p1", "--pass1", action=st, help="run pass-1 (linear) calibration")
    arg("-p2", "--pass2", action=st, help="run pass-2 (peakfit) calibration")
    arg("-e",
        "--etype",