Пример #1
0
    def setUp(self):
        #         self.t = LoadingTask()
        db = isotope_manager_factory().db
        lm = LoadingManager(db=db)

        #         lm.irradiation = 'NM-251'
        #         lm.level = 'H'
        self.t = LoadingTask(manager=lm)
Пример #2
0
    def setUp(self):
    #         self.t = LoadingTask()
        db = isotope_manager_factory().db
        lm = LoadingManager(db=db)

        #         lm.irradiation = 'NM-251'
        #         lm.level = 'H'
        self.t = LoadingTask(manager=lm)
Пример #3
0
def run():
    hp = hpy()

    globalv.experiment_debug = True
    #     t = ExperimentEditorTask()
    #     p = os.path.join(paths.experiment_dir, 'demo.txt')
    #     t._open_experiment(p)

    q = ExperimentQueue(delay_before_analyses=0, delay_between_analyses=0)
    q.automated_runs = [
        AutomatedRunSpec(labnumber='61312',
                         duration=2.0,
                         extraction_script='pause',
                         measurement_script='air',
                         mass_spectrometer='jan'),
        AutomatedRunSpec(labnumber='61312',
                         duration=2.0,
                         extraction_script='pause',
                         measurement_script='air',
                         mass_spectrometer='jan'),
        AutomatedRunSpec(labnumber='61312',
                         duration=2.0,
                         extraction_script='pause',
                         measurement_script='air',
                         mass_spectrometer='jan'),
        AutomatedRunSpec(labnumber='61312',
                         duration=2.0,
                         extraction_script='pause',
                         measurement_script='air',
                         mass_spectrometer='jan'),
        AutomatedRunSpec(labnumber='61312',
                         duration=2.0,
                         extraction_script='pause',
                         measurement_script='air',
                         mass_spectrometer='jan')
    ]

    dbman = isotope_manager_factory()
    specman = SpectrometerManager()
    specman.load()

    ex = ExperimentExecutor(
        db=dbman.db,
        spectrometer_manager=specman,
        extraction_line_manager='',
        executable=True,
    )
    ex.monitor = None
    ex.experiment_queues = [
        q,
    ]
    ex.experiment_queue = q
    hp.setrelheap()
    t = ex.execute()
    t.join()
    #     count_instances(group='sqlalchemy')

    return hp
Пример #4
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()

        expected_filtered_56954_01A = dict(Ar40bs_c=2.20831,
                                           Ar39bs_c=4.96090e-3,
                                           Ar38bs_c=0.0014621,
                                           Ar37bs_c=1.34848e-3,
                                           Ar36bs_c=7.40844e-3,

                                           Ar40bs=7.50865e-5,
                                           bs_fil=[44],
                                           Ar40_fil=[1, 9, 43],
                                           Ar39_fil=[11, 16],
                                           Ar40bl=0.0328504,

                                           #Ar39_Ar40=0.002255
                                           Ar39_Ar40=1 / 443.1534341,
                                           Ar39_Ar40e=0.000023

        )

        expected_nonfiltered = dict(Ar40bs_c=2.20908914,
                                    Ar39bs_c=4.96081e-3,
                                    Ar38bs_c=0.0014706,
                                    Ar37bs_c=0.001349,
                                    Ar36bs_c=0.0074384,

                                    Ar40bs=7.50865e-5,
                                    bs_fil=[],
                                    Ar40_fil=[])

        expected_filtered = dict(
            Ar40bs_c=0.159394,
            Ar40bs_ce=2.67938e-4,
            Ar39bs_c=1.58288e-2,
            Ar39bs_ce=7.9423e-5,

            Ar40bl_c=0.129651,
            Ar40bl_ce=0.003811,

            Ar40bl=0.031794,
            Ar40ble=0.0038013,

            Ar39_Ar40=0.1226,
            Ar39_Ar40e=0.0037,
            ar37df=3.348
        )
        cls.expected = expected_nonfiltered
        cls.expected = expected_filtered
        man = cls.isotope_man
        db = man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses(['AF-72', ], ['Minna Bluff'])
            an = man.make_analysis(ans[4])

            cls.analysis = an
Пример #5
0
    def setUp(self):
        self.experimentor = Experimentor(connect=False,
                                         unique_executor_db=False)
        self.experimentor.db = db = isotope_manager_factory().db

        self._experiment_file = './data/experiment2.txt'

        self.exp_task = ExperimentEditorTask()
        self._load_queues()
Пример #6
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()

        expected_filtered_56954_01A = dict(Ar40bs_c=2.20831,
                                           Ar39bs_c=4.96090e-3,
                                           Ar38bs_c=0.0014621,
                                           Ar37bs_c=1.34848e-3,
                                           Ar36bs_c=7.40844e-3,

                                           Ar40bs=7.50865e-5,
                                           bs_fil=[44],
                                           Ar40_fil=[1, 9, 43],
                                           Ar39_fil=[11, 16],
                                           Ar40bl=0.0328504,

                                           #Ar39_Ar40=0.002255
                                           Ar39_Ar40=1 / 443.1534341,
                                           Ar39_Ar40e=0.000023

        )

        expected_nonfiltered = dict(Ar40bs_c=2.20908914,
                                    Ar39bs_c=4.96081e-3,
                                    Ar38bs_c=0.0014706,
                                    Ar37bs_c=0.001349,
                                    Ar36bs_c=0.0074384,

                                    Ar40bs=7.50865e-5,
                                    bs_fil=[],
                                    Ar40_fil=[])

        expected_filtered = dict(
            Ar40bs_c=0.159394,
            Ar40bs_ce=2.67938e-4,
            Ar39bs_c=1.58288e-2,
            Ar39bs_ce=7.9423e-5,

            Ar40bl_c=0.129651,
            Ar40bl_ce=0.003811,

            Ar40bl=0.031794,
            Ar40ble=0.0038013,

            Ar39_Ar40=0.1226,
            Ar39_Ar40e=0.0037,
            ar37df=3.348
        )
        cls.expected = expected_nonfiltered
        cls.expected = expected_filtered
        man = cls.isotope_man
        db = man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses(['AF-72', ], ['Minna Bluff'])
            an = man.make_analysis(ans[4])

            cls.analysis = an
Пример #7
0
    def setUp(self):
        self.experimentor = Experimentor(connect=False,
                                         unique_executor_db=False
        )
        self.experimentor.db = db = isotope_manager_factory().db

        self._experiment_file = './data/experiment2.txt'

        self.exp_task = ExperimentEditorTask()
        self._load_queues()
Пример #8
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_dev')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses(['MB06-674', ], ['Minna Bluff'])

            an = man.make_analysis(ans[4])
            cls._id=ans[4].id
            cls.analysis_no_pc = an
Пример #9
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses(['AF-72', ], ['Minna Bluff'])
            cls.analyses=man.make_analyses(ans)
            cls.analysis = ans[0]

        cls.pkg=Packager()
Пример #10
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_dev')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses(['MB06-674', ], ['Minna Bluff'])

            an = man.make_analysis(ans[4])
            cls._id=ans[4].id
            cls.analysis_no_pc = an
Пример #11
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db

        cls.sample_id = sid = 'AF-72'
        #cls.analysis_id = aid = string.ascii_uppercase.index('A')

        with db.session_ctx():
            ans, tc = db.get_sample_analyses([sid, ], ['Minna Bluff'])
            cls.analyses = man.make_analyses(ans)
Пример #12
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(
            name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses([
                'AF-72',
            ], ['Minna Bluff'])
            cls.analyses = man.make_analyses(ans)
            cls.analysis = ans[0]

        cls.pkg = Packager()
Пример #13
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(
            name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db

        cls.sample_id = sid = 'AF-72'
        #cls.analysis_id = aid = string.ascii_uppercase.index('A')

        with db.session_ctx():
            ans, tc = db.get_sample_analyses([
                sid,
            ], ['Minna Bluff'])
            cls.analyses = man.make_analyses(ans)
Пример #14
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db

        cls.sample_id = sid = 'AF-72'
        cls.analysis_id = aid = string.ascii_uppercase.index('A')

        with db.session_ctx():
            ans, tc = db.get_sample_analyses([sid, ], ['Minna Bluff'])
            an = man.make_analysis(ans[aid])

            cls.analysis = an

        p = '../data/autoupdate_AF_72_1'
        cls.parser = AutoupdateParser()
        cls.parser.parse(p)
Пример #15
0
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(
            name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db

        cls.sample_id = sid = 'AF-72'
        cls.analysis_id = aid = string.ascii_uppercase.index('A')

        with db.session_ctx():
            ans, tc = db.get_sample_analyses([
                sid,
            ], ['Minna Bluff'])
            an = man.make_analysis(ans[aid])

            cls.analysis = an

        p = '../data/autoupdate_AF_72_1'
        cls.parser = AutoupdateParser()
        cls.parser.parse(p)
Пример #16
0
 def setUp(self):
     db = isotope_manager_factory().db
     self.le = LabnumberEntry(db=db)
Пример #17
0
from pychron.core.helpers.logger_setup import logging_setup


__author__ = 'ross'

import unittest

from pychron.core.ui import set_toolkit

set_toolkit('qt4')

from pychron.processing.autoupdate_parser import AutoupdateParser
from test.database import isotope_manager_factory

ISOTOPE_MANAGER = isotope_manager_factory(name='pychrondata_minnabluff')
ISOTOPE_MANAGER.connect()

SKIP_BLANKS = False, 'skip blanks'
SKIP_SIGNALS = False, 'skip signals'
SKIP_FITS = False, 'skip fits'

logging_setup('arar_diff')


class MassSpecPychronIsotopeTestCase(object):
    def setUp(self):
        pass

    def get_expected_value(self, k):
        p = self.parser
Пример #18
0
def run():
    hp = hpy()

    globalv.experiment_debug = True
#     t = ExperimentEditorTask()
#     p = os.path.join(paths.experiment_dir, 'demo.txt')
#     t._open_experiment(p)


    q = ExperimentQueue(delay_before_analyses=0,
                        delay_between_analyses=0)
    q.automated_runs = [
                        AutomatedRunSpec(
                                         labnumber='61312',
                                         duration=2.0,
                                         extraction_script='pause',
                                         measurement_script='air',
                                         mass_spectrometer='jan'
                                         ),
                        AutomatedRunSpec(
                                         labnumber='61312',
                                         duration=2.0,
                                         extraction_script='pause',
                                         measurement_script='air',
                                         mass_spectrometer='jan'
                                         ),
                        AutomatedRunSpec(
                                         labnumber='61312',
                                         duration=2.0,
                                         extraction_script='pause',
                                         measurement_script='air',
                                         mass_spectrometer='jan'
                                         ),
                        AutomatedRunSpec(
                                         labnumber='61312',
                                         duration=2.0,
                                         extraction_script='pause',
                                         measurement_script='air',
                                         mass_spectrometer='jan'
                                         ),
                        AutomatedRunSpec(
                                         labnumber='61312',
                                         duration=2.0,
                                         extraction_script='pause',
                                         measurement_script='air',
                                         mass_spectrometer='jan'
                                         )

                        ]

    dbman = isotope_manager_factory()
    specman = ArgusSpectrometerManager()
    specman.load()

    ex = ExperimentExecutor(db=dbman.db,
                            spectrometer_manager=specman,
                            extraction_line_manager='',
                            executable=True,

                            )
    ex.monitor = None
    ex.experiment_queues = [q, ]
    ex.experiment_queue = q
    hp.setrelheap()
    t = ex.execute()
    t.join()
#     count_instances(group='sqlalchemy')

    return hp
Пример #19
0
import math
import os

from pychron.core.ui import set_toolkit

set_toolkit('qt4')

from pychron.processing.autoupdate_parser import AutoupdateParser
from test.database import isotope_manager_factory

isotope_man=isotope_manager_factory(name='pychron_dataset')
isotope_man.db.connect(test=True)

pp = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data', 'massspec_dataset_nofilter')
# pp = '../data/massspec_dataset_nofilter'
parser = AutoupdateParser()
parser.parse(pp)

msid='Unknown'
sid='MB06-507'
pid='Minna Bluff'

class IntensityMixin(object):
    @classmethod
    def setUpClass(cls):
        aid=cls.analysis_id
        cls.sample_id = msid
        cls.analysis_id = aid
        db=isotope_man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses([sid, ], [pid])
Пример #20
0
 def setUp(self):
     man = isotope_manager_factory()
     self.processor = Processor(bind=False, db=man.db)
Пример #21
0
#============= standard library imports ========================
#============= local library imports  ==========================
@profile
def main(db):
    labn = db.get_labnumber('61311',
#                             options='analyses'
                            )

    print '------------------------- got labnunmber'
    an = labn.analyses[0]
    print '------------------------- got analysis'
    a = IsotopeRecord(_dbrecord=an)
    load(a)
    print '------------------------- loaded'

# @profile
def load(a):
    a.load_isotopes()
    print '------------------------- isotopes loaded'
    a.calculate_age()

if __name__ == '__main__':
    man = isotope_manager_factory()
    db = man.db
    db.connect()

#     db.sess.bind.echo = True

    main(db)
#============= EOF =============================================
Пример #22
0
 def setUp(self):
     man = isotope_manager_factory()
     self.processor = Processor(bind=False,
                                db=man.db
     )
Пример #23
0
@profile
def main(db):
    labn = db.get_labnumber('61311',
                            #                             options='analyses'
                            )

    print '------------------------- got labnunmber'
    an = labn.analyses[0]
    print '------------------------- got analysis'
    a = IsotopeRecord(_dbrecord=an)
    load(a)
    print '------------------------- loaded'


# @profile
def load(a):
    a.load_isotopes()
    print '------------------------- isotopes loaded'
    a.calculate_age()


if __name__ == '__main__':
    man = isotope_manager_factory()
    db = man.db
    db.connect()

    #     db.sess.bind.echo = True

    main(db)
#============= EOF =============================================
Пример #24
0
import math
import os

from pychron.core.ui import set_toolkit

set_toolkit('qt4')

from pychron.processing.autoupdate_parser import AutoupdateParser
from test.database import isotope_manager_factory

isotope_man = isotope_manager_factory(name='pychron_dataset')
isotope_man.db.connect(test=True)

pp = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data',
                  'massspec_dataset_nofilter')
# pp = '../data/massspec_dataset_nofilter'
parser = AutoupdateParser()
parser.parse(pp)

msid = 'Unknown'
sid = 'MB06-507'
pid = 'Minna Bluff'


class IntensityMixin(object):
    @classmethod
    def setUpClass(cls):
        aid = cls.analysis_id
        cls.sample_id = msid
        cls.analysis_id = aid
        db = isotope_man.db
Пример #25
0
 def setUp(self):
     self.manager = isotope_manager_factory()
     self.manager.db.connect()
Пример #26
0
 def setUp(self):
     db = isotope_manager_factory().db
     self.le = LabnumberEntry(db=db)