Commit 1a439271 authored by Lucas Giardino's avatar Lucas Giardino

dummies de dispositivos

parent 52acfe80
import time
from random import normalvariate
import numpy as np
from scipy.stats import poisson
__all__ = ["PMT", "RedPitaya"]
class PMT: #{{{
def __init__(self, mean=50):
self.mean = mean
def count(self):
return poisson.rvs(self.mean)
def change_mean(self, new_mean):
self.mean = new_mean
# }}}
class RedPitaya: #{{{
def __init__(self, mean=10., std=1.):
self.mean = mean
self.std = std
def give_measurement(self):
return self.mean + normalvariate(0, 1)*self.std
#}}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment