예제 #1
0
def isochron_regressor(xs,
                       xes,
                       ys,
                       yes,
                       xds,
                       xdes,
                       xns,
                       xnes,
                       yns,
                       ynes,
                       reg='Reed'):
    if reg.lower() in ('newyork', 'new_york'):
        from pychron.core.regression.new_york_regressor import NewYorkRegressor as klass
    else:
        from pychron.core.regression.new_york_regressor import ReedYorkRegressor as klass
    reg = klass(xs=xs,
                ys=ys,
                xserr=xes,
                yserr=yes,
                xds=xds,
                xdes=xdes,
                xns=xns,
                xnes=xnes,
                yns=yns,
                ynes=ynes)
    reg.calculate()
    return reg
예제 #2
0
def isochron_regressor(xs, xes, ys, yes,
                       xds, xdes, xns, xnes, yns, ynes,
                       reg='Reed'):
    if reg.lower() in ('newyork', 'new_york'):
        from pychron.core.regression.new_york_regressor import NewYorkRegressor as klass
    else:
        from pychron.core.regression.new_york_regressor import ReedYorkRegressor as klass
    reg = klass(xs=xs, ys=ys,
                xserr=xes, yserr=yes,
                xds=xds, xdes=xdes,
                xns=xns, xnes=xnes,
                yns=yns, ynes=ynes)
    reg.calculate()
    return reg
예제 #3
0
def calculate_isochron(analyses, reg='Reed'):
    if reg.lower() in ('newyork', 'new_york'):
        from pychron.core.regression.new_york_regressor import NewYorkRegressor as klass
    else:
        from pychron.core.regression.new_york_regressor import ReedYorkRegressor as klass

    ref = analyses[0]
    ans = [(ai.isotopes['Ar39'].get_interference_corrected_value(),
            ai.isotopes['Ar36'].get_interference_corrected_value(),
            ai.isotopes['Ar40'].get_interference_corrected_value())
           for ai in analyses]

    a39, a36, a40 = array(ans).T
    try:
        xx = a39 / a40
        yy = a36 / a40
    except ZeroDivisionError:
        return

    xs, xerrs = zip(*[(xi.nominal_value, xi.std_dev) for xi in xx])
    ys, yerrs = zip(*[(yi.nominal_value, yi.std_dev) for yi in yy])

    reg = klass(xs=xs, ys=ys, xserr=xerrs, yserr=yerrs)
    reg.calculate()

    xint = ufloat(reg.x_intercept, reg.x_intercept_error)
    try:
        R = xint**-1
    except ZeroDivisionError:
        R = 0

    age = ufloat(0, 0)
    if R > 0:
        age = age_equation(ref.j, R, arar_constants=ref.arar_constants)

    return age, reg, (xs, ys, xerrs, yerrs)
예제 #4
0
def calculate_isochron(analyses, reg='Reed'):
    if reg.lower() in ('newyork','new_york'):
        from pychron.core.regression.new_york_regressor import NewYorkRegressor as klass
    else:
        from pychron.core.regression.new_york_regressor import ReedYorkRegressor as klass

    ref=analyses[0]
    ans = [(ai.isotopes['Ar39'].get_interference_corrected_value(),
            ai.isotopes['Ar36'].get_interference_corrected_value(),
            ai.isotopes['Ar40'].get_interference_corrected_value())
           for ai in analyses]

    a39, a36, a40 = array(ans).T
    try:
        xx = a39 / a40
        yy = a36 / a40
    except ZeroDivisionError:
        return

    xs, xerrs = zip(*[(xi.nominal_value, xi.std_dev) for xi in xx])
    ys, yerrs = zip(*[(yi.nominal_value, yi.std_dev) for yi in yy])

    reg = klass(xs=xs, ys=ys, xserr=xerrs, yserr=yerrs)
    reg.calculate()

    xint = ufloat(reg.x_intercept, reg.x_intercept_error)
    try:
        R = xint ** -1
    except ZeroDivisionError:
        R = 0

    age=ufloat(0,0)
    if R > 0:
        age = age_equation(ref.j, R, arar_constants=ref.arar_constants)

    return age, reg, (xs,ys,xerrs,yerrs)