コード例 #1
0
def detector_model_observed_counts(timestep, initial_state, external_radon_conc,
                           internal_airt_history,
                           parameters, interpolation_mode=1):
    """just return the observed_counts timeseries"""
    params = fast_detector.parameter_array_from_dict(parameters)
    soln = fast_detector.detector_model(timestep, interpolation_mode,
                                  external_radon_conc, internal_airt_history,
                                  initial_state, params)
    return np.diff(soln[:,-1])
コード例 #2
0
def detector_model_wrapper(timestep, initial_state, external_radon_conc,
                           internal_airt_history,
                           parameters, interpolation_mode=1,
                           return_full_state=False):
    """
    TODO:
    """
    t = np.arange(0, timestep*len(external_radon_conc), timestep, dtype=np.float)
    params = fast_detector.parameter_array_from_dict(parameters)
    soln = fast_detector.detector_model(timestep, interpolation_mode,
                                  external_radon_conc,
                                  internal_airt_history,
                                  initial_state, params)
    df = pd.DataFrame(index=t/60.0, data=soln)
    df.columns = 'Nrnd,Nrnd2,Nrn,Fa,Fb,Fc,Acc_counts'.split(',')
    eff = parameters['eff']
    df['count rate'] = eff*(df.Fa*lama + df.Fc*lamc)
    if return_full_state:
        #TODO
        assert(False)
    return df