Exemple #1
0
            outfile = bank + "_" + tag + "_" + tag1 + ".tof"

            hlr_utils.write_file(outfile, "text/Spec", tSOM,
                                 verbose=config.verbose,
                                 message="intensity sum file",
                                 replace_ext=False)
                    
    data_dst.release_resource()


if __name__ == "__main__":
    import hlr_utils

    # set up the options available
    parser = hlr_utils.BasicOptions("usage: %prog [options] <datafile>", None,
                                    None, hlr_utils.program_version())

    parser.add_option("-u", "--vertical", action="store_true", dest="vertical",
                      help="Flag to slice and sum pixels in the vertical "\
                      +"direction")
    parser.set_defaults(vertical=False)
    
    parser.add_option("-a", "--horizontal", action="store_false",
                      dest="vertical",
                      help="Flag to slice and sum pixels in the horizontal "\
                      +"direction. (Default behavior)")
    
    parser.add_option("", "--pixel-group", dest="pixel_group", type="int",
                      metavar="INT",
                      help="Number of pixels in a grouping. The default "\
                      +"value is 4.")
if __name__ == "__main__":
    import hlr_utils

    # Make description for driver
    result = []
    result.append("This driver runs the data reduction for the inelastic")
    result.append("banks for the BSS instrument. The standard output is a")
    result.append("a *.setr file (3-column ASCII) for S(E) and a *.etr file")
    result.append("(3-column ASCII) for sigma(E). Other intermediate files")
    result.append("can be produced by using the appropriate dump-X flag")
    result.append("described in this help. The file extensions are described")
    result.append("in the option documentation.")
 
    # Set up the options available
    parser = hlr_utils.AmrOptions("usage: %prog [options] <datafile>", None,
                                  hlr_utils.program_version(), 'error',
                                  " ".join(result))

    # Set defaults for imported options
    parser.set_defaults(inst="BSS")
    parser.set_defaults(data_paths="/entry/bank1,1,/entry/bank2,1")
    parser.set_defaults(mon_path="/entry/monitor,1")
    parser.set_defaults(norm_start="6.24")
    parser.set_defaults(norm_end="6.30")

    # Remove unneeded options
    parser.remove_option("--mom-trans-bins")
    
    # Add amorphous_reduction specific options
    parser.add_option("", "--timing", action="store_true", dest="timing",
                      help="Flag to turn on timing of code")
Exemple #3
0
    if tim is not None:
        tim.setOldTime(old_time)
        tim.getTime(msg="Total Running Time")


if __name__ == "__main__":
    import hlr_utils

    # Make description for driver
    description = []
    description.append("This driver runs the data reduction for the Direct")
    description.append("Geometry Spectrometer class of instruments.")

    # Set up the options available
    parser = hlr_utils.DgsRedOptions("usage: %prog [options] <datafile>", None,
                                     None, hlr_utils.program_version(),
                                     'error', " ".join(description))

    # Set defaults for options
    parser.set_defaults(usmon_path="/entry/monitor1,1")
    parser.set_defaults(dsmon_path="/entry/monitor2,1")

    # Remove unneeded options
    parser.remove_option("--norm-int-range")
    parser.remove_option("--norm-trans-coeff")

    # Add dgs_reduction specific options
    parser.add_option("",
                      "--timing",
                      action="store_true",
                      dest="timing",
Exemple #4
0
    )


if __name__ == "__main__":
    import dr_lib
    import hlr_utils

    # Make description for driver
    result = []
    result.append("This driver reads a TOF NeXus file and creates a *.xys")
    result.append("file containing a numeric sum of count values for each")
    result.append("pixel present in the provided detector bank.")

    # set up the options available
    parser = hlr_utils.InstOptions(
        "usage: %prog [options] <datafile>", None, None, hlr_utils.program_version(), "error", " ".join(result)
    )

    parser.set_defaults(data_paths="/entry/bank1,1")

    parser.add_option("-s", "--start", dest="start", type="float", help="Specify the starting TOF for the sum.")

    parser.add_option("-e", "--end", dest="end", type="float", help="Specify the ending TOF for the sum.")

    parser.add_option(
        "-b",
        "--bin",
        dest="bin",
        action="store_true",
        help="Flag to specify that start and end values are " + "bin indicies.",
    )