Ejemplo n.º 1
0
def unpolarized_template():
    from dataflow.automod import make_template
    from dataflow.core import lookup_instrument
    refl1d = lookup_instrument(INSTRUMENT)
    diagram = [
        # Load the data
        ["ncnr_load", {}],

        # Preprocessing common to all data sets
        #["monitor_saturation", {"data": "-.output"}],
        #["detector_saturation", {"data": "-.output"}],
        ["divergence", {"data": "-.output"}],
        ["normalize", {"data": "-.output", "base": "auto"}],
        ["mark_intent", {"data": "-.output", "intent": ["auto"]}],
        ["group_by_intent => split", {"data": "-.output"}],

        # Preprocessing particular to each data type
        # Use nop to restart pipeline after split so that it is easier to
        # add/remove/rearrange steps for the different data types.
        ["nop", {"data": "split.specular"}],
        ["join => spec", {"data": "-.output"}],

        ["nop", {"data": "split.backp"}],
        ["mask_specular",  {"data": "-.output"}],
        ["align_background",  {"data": "-.output", "offset": "auto"}],
        ["join => backp",  {"data": "-.output"},],

        ["nop", {"data": "split.backm"}],
        ["mask_specular",  {"data": "-.output"}],
        ["align_background",  {"data": "-.output", "offset": "auto"}],
        ["join => backm",  {"data": "-.output"}],

        ["nop", {"data": "split.intensity"}],
        ["rescale",  {"data": "-.output", "scale": [1.0], "dscale": [0.0]}],
        ["join => intensity",  {"data": "-.output", "tolerance": 0.0001}],

        # Operate on the combined data for the final reduction
        ["subtract_background", {
            "data": "spec.output",
            "backp": "backp.output",
            "backm": "backm.output"}],
        ["divide_intensity",  {"data": "-.output", "base": "intensity.output"}],
        #["footprint",  {"data": "-.output")}],
    ]
    #for m in refl1d.modules: print m.__dict__
    #for m in refl1d.modules: print m.terminals[0]
    template = make_template(
        name="unpolarized",
        description="standard unpolarized reduction",
        diagram=diagram,
        instrument=refl1d,
        version=1.0,
        )
    return template
Ejemplo n.º 2
0
def loader_template():
    refl1d = df.lookup_instrument(INSTRUMENT)
    diagram = [
            ["ncnr_load", {}],
            ["divergence", {"data": "-.output"}],
    ]
    template = make_template(
        name="loader",
        description="loader only",
        diagram=diagram,
        instrument=refl1d,
        version=1.0,
        )
    return template
Ejemplo n.º 3
0
def loader_template():
    refl1d = df.lookup_instrument(INSTRUMENT)
    diagram = [
        ["ncnr_load", {}],
        ["divergence", {
            "data": "-.output"
        }],
    ]
    template = make_template(
        name="loader",
        description="loader only",
        diagram=diagram,
        instrument=refl1d,
        version=1.0,
    )
    return template
Ejemplo n.º 4
0
def loader_template():
    from dataflow.automod import make_template
    from dataflow.core import lookup_instrument
    refl1d = lookup_instrument(INSTRUMENT)
    diagram = [
            ["ncnr_load", {}],
            ["divergence", {"data": "-.output"}],
    ]
    template = make_template(
        name="loader",
        description="loader only",
        diagram=diagram,
        instrument=refl1d,
        version=1.0,
        )
    return template
Ejemplo n.º 5
0
def unpolarized_template():
    refl1d = df.lookup_instrument(INSTRUMENT)
    diagram = [
        # Load the data
        ["ncnr_load", {}],

        # Preprocessing common to all data sets
        #["monitor_saturation", {"data": "-.output"}],
        #["detector_saturation", {"data": "-.output"}],
        ["divergence", {
            "data": "-.output"
        }],
        ["normalize", {
            "data": "-.output",
            "base": "auto"
        }],
        ["mark_intent", {
            "data": "-.output",
            "intent": ["auto"]
        }],
        ["group_by_intent => split", {
            "data": "-.output"
        }],

        # Preprocessing particular to each data type
        # Use nop to restart pipeline after split so that it is easier to
        # add/remove/rearrange steps for the different data types.
        ["nop", {
            "data": "split.specular"
        }],
        ["join => spec", {
            "data": "-.output"
        }],
        ["nop", {
            "data": "split.backp"
        }],
        ["mask_specular", {
            "data": "-.output"
        }],
        ["align_background", {
            "data": "-.output",
            "offset": "auto"
        }],
        ["join => backp", {
            "data": "-.output"
        }],
        ["nop", {
            "data": "split.backm"
        }],
        ["mask_specular", {
            "data": "-.output"
        }],
        ["align_background", {
            "data": "-.output",
            "offset": "auto"
        }],
        ["join => backm", {
            "data": "-.output"
        }],
        ["nop", {
            "data": "split.intensity"
        }],
        ["rescale", {
            "data": "-.output",
            "scale": [1.0],
            "dscale": [0.0]
        }],
        ["join => intensity", {
            "data": "-.output",
            "tolerance": 0.0001
        }],

        # Operate on the combined data for the final reduction
        [
            "subtract_background", {
                "data": "spec.output",
                "backp": "backp.output",
                "backm": "backm.output"
            }
        ],
        ["divide_intensity", {
            "data": "-.output",
            "base": "intensity.output"
        }],
        #["footprint",  {"data": "-.output")}],
    ]
    #for m in refl1d.modules: print m.__dict__
    #for m in refl1d.modules: print m.terminals[0]
    template = make_template(
        name="unpolarized",
        description="standard unpolarized reduction",
        diagram=diagram,
        instrument=refl1d,
        version=1.0,
    )
    return template