Ejemplo n.º 1
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT+'.')
    modules.append(make_cached_subloader_module(steps.super_load, prefix=INSTRUMENT+'.'))
    modules.append(make_cached_subloader_module(steps.ncnr_load, prefix=INSTRUMENT+'.'))
    
    # Define data types
    refldata = df.DataType(INSTRUMENT+".refldata", ReflData)
    poldata = df.DataType(INSTRUMENT+".poldata", PolarizationData)
    deadtime = df.DataType(INSTRUMENT+".deadtime", DeadTimeData)
    footprint = df.DataType(INSTRUMENT+".footprint.params", FootprintData)

    #import json
    #import os
    #from pkg_resources import resource_string, resource_listdir
    #template_names = [fn for fn in resource_listdir('dataflow', 'templates') if fn.endswith(".json")]
    #templates = [json.loads(resource_string('dataflow', 'templates/' + tn)) for tn in template_names]
    #template_path = resource_path("../dataflow/templates")
    #template_names = [fn for fn in os.listdir(template_path) if fn.endswith(".json")]
    #templates = [json.loads(open(os.path.join(template_path, tn), 'r').read()) for tn in template_names]
    
    # Define instrument
    refl1d = df.Instrument(
        id=INSTRUMENT,
        name='NCNR reflectometer',
        menu=[('steps', modules)],
        datatypes=[refldata, poldata, deadtime, footprint],
        template_defs = templates.get_templates(INSTRUMENT),
        )

    # Register instrument
    df.register_instrument(refl1d)
    return refl1d
Ejemplo n.º 2
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT + '.')

    # Define data types
    vsans_raw = df.DataType(INSTRUMENT + ".raw", RawVSANSData)
    vsans_realspace = df.DataType(INSTRUMENT + ".realspace",
                                  VSansDataRealSpace)
    vsans_qspace = df.DataType(INSTRUMENT + ".qspace", VSansDataQSpace)
    vsans_1d = df.DataType(INSTRUMENT + '.v1d', VSans1dData)
    #vsans_metadata = df.DataType(INSTRUMENT+".metadata", Metadata)
    params = df.DataType(INSTRUMENT + ".params", Parameters)

    # Define instrument
    vsans = df.Instrument(
        id=INSTRUMENT,
        name='NCNR Very Small Angle Neutron Scattering (VSANS) instrument',
        menu=[('steps', modules)],
        datatypes=[vsans_raw, vsans_realspace, vsans_qspace, params, vsans_1d],
        template_defs=df.load_templates(templates),
    )

    # Register instrument
    df.register_instrument(vsans)
    return vsans
Ejemplo n.º 3
0
def define_instrument():
    # Define modules
    actions = get_modules(steps) + get_modules(candor_steps)
    modules = make_modules(actions, prefix=INSTRUMENT + '.')
    modules.append(
        make_cached_subloader_module(steps.super_load,
                                     prefix=INSTRUMENT + '.'))
    modules.append(
        make_cached_subloader_module(steps.ncnr_load, prefix=INSTRUMENT + '.'))
    # Define data types
    refldata = df.DataType(INSTRUMENT + ".refldata", ReflData)
    poldata = df.DataType(INSTRUMENT + ".poldata", PolarizationData)
    psddata = df.DataType(INSTRUMENT + ".psddata", PSDData)
    candordata = df.DataType(INSTRUMENT + ".candordata", Candor)
    deadtime = df.DataType(INSTRUMENT + ".deadtime", DeadTimeData)
    footprint = df.DataType(INSTRUMENT + ".footprint.params", FootprintData)
    flux = df.DataType(INSTRUMENT + ".flux.params", FluxData)
    backgroundfield = df.DataType(INSTRUMENT + ".backgroundfield.params",
                                  BackgroundFieldData)
    plottable = df.DataType(INSTRUMENT + ".plot", Plottable)

    #import json
    #import os
    #from pkg_resources import resource_string, resource_listdir
    #template_names = [fn for fn in resource_listdir('dataflow', 'templates') if fn.endswith(".json")]
    #templates = [json.loads(resource_string('dataflow', 'templates/' + tn)) for tn in template_names]
    #template_path = resource_path("../dataflow/templates")
    #template_names = [fn for fn in os.listdir(template_path) if fn.endswith(".json")]
    #templates = [json.loads(open(os.path.join(template_path, tn), 'r').read()) for tn in template_names]

    # Define instrument
    refl1d = df.Instrument(
        id=INSTRUMENT,
        name='NCNR reflectometer',
        menu=[('steps', modules)],
        datatypes=[
            refldata,
            poldata,
            psddata,
            candordata,
            deadtime,
            footprint,
            flux,
            backgroundfield,
            plottable,
        ],
        template_defs=df.load_templates(templates),
    )

    # Register instrument
    df.register_instrument(refl1d)
    return refl1d
Ejemplo n.º 4
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT+'.')

    # Define data types
    sans2d = df.DataType(INSTRUMENT+".sans2d", SansData)
    sans1d = df.DataType(INSTRUMENT+".sans1d", Sans1dData)
    params = df.DataType(INSTRUMENT+".params", Parameters)
    #offset_data = df.DataType(INSTRUMENT+".offset_data", dict)
    
    # Define instrument
    sans = df.Instrument(
        id=INSTRUMENT,
        name='NCNR SANS',
        menu=[('steps', modules)],
        datatypes=[sans2d, sans1d, params],
        template_defs = templates.get_templates(INSTRUMENT),
        )

    # Register instrument
    df.register_instrument(sans)
    return sans
Ejemplo n.º 5
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT+'.')

    # Define data types
    usansraw = df.DataType(INSTRUMENT+".raw", RawData)
    usansdata = df.DataType(INSTRUMENT+".data", USansData)
    usanscor = df.DataType(INSTRUMENT+".cor", USansCorData)
    params = df.DataType(INSTRUMENT+".params", Parameters)

    # Define instrument
    usans = df.Instrument(
        id=INSTRUMENT,
        name='NCNR Ultra-Small Angle Neutron Scattering Instrument (USANS)',
        menu=[('steps', modules)],
        datatypes=[usansdata, params, usanscor], # usansraw],
        template_defs=df.load_templates(templates),
        )

    # Register instrument
    df.register_instrument(usans)
    return usans
Ejemplo n.º 6
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT + '.')

    # Define data types
    sans2d = df.DataType(INSTRUMENT + ".sans2d", SansData)
    sans1d = df.DataType(INSTRUMENT + ".sans1d", Sans1dData)
    params = df.DataType(INSTRUMENT + ".params", Parameters)
    #offset_data = df.DataType(INSTRUMENT+".offset_data", dict)

    # Define instrument
    sans = df.Instrument(
        id=INSTRUMENT,
        name='NCNR SANS',
        menu=[('steps', modules)],
        datatypes=[sans2d, sans1d, params],
        template_defs=templates.get_templates(INSTRUMENT),
    )

    # Register instrument
    df.register_instrument(sans)
    return sans
Ejemplo n.º 7
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT+'.')

    # Define data types
    ospec2d = df.DataType(INSTRUMENT+".ospec2d", FilterableMetaArray)
    ospec1d = df.DataType(INSTRUMENT+".ospec1d", FilterableMetaArray)
    params = df.DataType(INSTRUMENT+".params", Parameters)
    #offset_data = df.DataType(INSTRUMENT+".offset_data", dict)
    
    # Define instrument
    ospec = df.Instrument(
        id=INSTRUMENT,
        name='NCNR offspecular',
        menu=[('steps', modules)],
        datatypes=[ospec2d, ospec1d, params],
        template_defs = templates.get_templates(INSTRUMENT),
        )

    # Register instrument
    df.register_instrument(ospec)
    return ospec
Ejemplo n.º 8
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT+'.')

    # Define data types
    dcsraw = df.DataType(INSTRUMENT+".raw", RawData)
    eqdata = df.DataType(INSTRUMENT+".eq", EQData)
    ef2thetadata = df.DataType(INSTRUMENT+".ef2th", EfTwoThetaData)
    eq1ddata = df.DataType(INSTRUMENT+".eq1d", DCS1dData)
    #params = df.DataType(INSTRUMENT+".params", Parameters)

    # Define instrument
    dcs = df.Instrument(
        id=INSTRUMENT,
        name='NCNR Disk Chopper Spectrometer',
        menu=[('steps', modules)],
        datatypes=[dcsraw, eqdata, eq1ddata, ef2thetadata], # params],
        template_defs=templates.get_templates(INSTRUMENT),
        )

    # Register instrument
    df.register_instrument(dcs)
    return dcs
Ejemplo n.º 9
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT + '.')

    # Define data types
    dcsraw = df.DataType(INSTRUMENT + ".raw", RawData)
    eqdata = df.DataType(INSTRUMENT + ".eq", EQData)
    ef2thetadata = df.DataType(INSTRUMENT + ".ef2th", EfTwoThetaData)
    eq1ddata = df.DataType(INSTRUMENT + ".eq1d", DCS1dData)
    #params = df.DataType(INSTRUMENT+".params", Parameters)

    # Define instrument
    dcs = df.Instrument(
        id=INSTRUMENT,
        name='NCNR Disk Chopper Spectrometer',
        menu=[('steps', modules)],
        datatypes=[dcsraw, eqdata, eq1ddata, ef2thetadata],  # params],
        template_defs=df.load_templates(templates),
    )

    # Register instrument
    df.register_instrument(dcs)
    return dcs
Ejemplo n.º 10
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT + '.')

    # Define data types
    ospec2d = df.DataType(INSTRUMENT + ".ospec2d", FilterableMetaArray)
    #ospec1d = df.DataType(INSTRUMENT+".ospec1d", FilterableMetaArray)
    ospecnd = df.DataType(INSTRUMENT + ".ospecnd", FilterableMetaArray)
    params = df.DataType(INSTRUMENT + ".params", Parameters)
    #offset_data = df.DataType(INSTRUMENT+".offset_data", dict)

    # Define instrument
    ospec = df.Instrument(
        id=INSTRUMENT,
        name='NCNR offspecular',
        menu=[('steps', modules)],
        datatypes=[ospec2d, ospecnd, params],
        template_defs=df.load_templates(templates),
    )

    # Register instrument
    df.register_instrument(ospec)
    return ospec
Ejemplo n.º 11
0
def define_instrument():
    # Define modules
    modules = make_modules(steps.ALL_ACTIONS, prefix=INSTRUMENT + '.')
    modules.append(
        make_cached_subloader_module(steps.super_load,
                                     prefix=INSTRUMENT + '.'))
    modules.append(
        make_cached_subloader_module(steps.ncnr_load, prefix=INSTRUMENT + '.'))

    # Define data types
    refldata = df.DataType(INSTRUMENT + ".refldata", ReflData)
    poldata = df.DataType(INSTRUMENT + ".poldata", PolarizationData)
    deadtime = df.DataType(INSTRUMENT + ".deadtime", DeadTimeData)
    footprint = df.DataType(INSTRUMENT + ".footprint.params", FootprintData)
    flux = df.DataType(INSTRUMENT + ".flux.params", FluxData)

    #import json
    #import os
    #from pkg_resources import resource_string, resource_listdir
    #template_names = [fn for fn in resource_listdir('dataflow', 'templates') if fn.endswith(".json")]
    #templates = [json.loads(resource_string('dataflow', 'templates/' + tn)) for tn in template_names]
    #template_path = resource_path("../dataflow/templates")
    #template_names = [fn for fn in os.listdir(template_path) if fn.endswith(".json")]
    #templates = [json.loads(open(os.path.join(template_path, tn), 'r').read()) for tn in template_names]

    # Define instrument
    refl1d = df.Instrument(
        id=INSTRUMENT,
        name='NCNR reflectometer',
        menu=[('steps', modules)],
        datatypes=[refldata, poldata, deadtime, footprint, flux],
        template_defs=templates.get_templates(INSTRUMENT),
    )

    # Register instrument
    df.register_instrument(refl1d)
    return refl1d