Exemple #1
0
def main():

    parser = argparse.ArgumentParser(
        description="Find peaks within the NeXus data")
    parser.add_argument('-d', '--directory', required=True,
                        help='scan directory')
    parser.add_argument('-e', '--entries', default=['f1', 'f2', 'f3'],
        nargs='+', help='names of entries to be searched')
    parser.add_argument('-t', '--threshold', type=float,
                        help='peak threshold - defaults to maximum counts/10')
    parser.add_argument('-f', '--first', type=int, help='first frame')
    parser.add_argument('-l', '--last', type=int, help='last frame')
    parser.add_argument('-o', '--overwrite', action='store_true',
                        help='overwrite existing peaks')
    parser.add_argument('-p', '--parent', default=None,
                        help='The parent .nxs file to use')
    parser.add_argument('-q', '--queue', action='store_true',
                        help='add to server task queue')

    args = parser.parse_args()

    for entry in args.entries:
        reduce = NXReduce(entry, args.directory, find=True,
                          threshold=args.threshold,
                          first=args.first, last=args.last,
                          overwrite=args.overwrite)
        if args.queue:
            reduce.queue()
        else:
            reduce.nxfind()
Exemple #2
0
def main():

    parser = argparse.ArgumentParser(
        description="Find peaks within the NeXus data")
    parser.add_argument('-d',
                        '--directory',
                        required=True,
                        help='scan directory')
    parser.add_argument('-e',
                        '--entries',
                        nargs='+',
                        help='names of entries to be searched')
    parser.add_argument('-t', '--threshold', type=float, help='peak threshold')
    parser.add_argument('-f', '--first', type=int, help='first frame')
    parser.add_argument('-l', '--last', type=int, help='last frame')
    parser.add_argument('-P',
                        '--pixels',
                        type=int,
                        help='minimum pixels in a peak')
    parser.add_argument('-o',
                        '--overwrite',
                        action='store_true',
                        help='overwrite existing peaks')
    parser.add_argument('-p',
                        '--parent',
                        default=None,
                        help='The parent .nxs file to use')
    parser.add_argument('-m',
                        '--monitor',
                        action='store_true',
                        help='monitor progress in the command line')
    parser.add_argument('-q',
                        '--queue',
                        action='store_true',
                        help='add to server task queue')

    args = parser.parse_args()

    if args.entries:
        entries = args.entries
    else:
        entries = NXMultiReduce(args.directory).entries

    for entry in entries:
        reduce = NXReduce(entry,
                          args.directory,
                          find=True,
                          threshold=args.threshold,
                          first=args.first,
                          last=args.last,
                          min_pixels=args.pixels,
                          overwrite=args.overwrite,
                          monitor_progress=args.monitor)
        if args.queue:
            reduce.queue('nxfind', args)
        else:
            reduce.nxfind()
Exemple #3
0
def main():

    parser = argparse.ArgumentParser(
        description="Find peaks within the NeXus data")
    parser.add_argument('-d',
                        '--directory',
                        required=True,
                        help='scan directory')
    parser.add_argument('-e',
                        '--entries',
                        default=['f1', 'f2', 'f3'],
                        nargs='+',
                        help='names of entries to be searched')
    parser.add_argument('-t',
                        '--threshold',
                        type=float,
                        help='peak threshold - defaults to maximum counts/10')
    parser.add_argument('-f', '--first', type=int, help='first frame')
    parser.add_argument('-l', '--last', type=int, help='last frame')
    parser.add_argument('-o',
                        '--overwrite',
                        action='store_true',
                        help='overwrite existing peaks')
    parser.add_argument('-p',
                        '--parent',
                        default=None,
                        help='The parent .nxs file to use')
    parser.add_argument('-q',
                        '--queue',
                        action='store_true',
                        help='add to server task queue')

    args = parser.parse_args()

    for entry in args.entries:
        reduce = NXReduce(entry,
                          args.directory,
                          find=True,
                          threshold=args.threshold,
                          first=args.first,
                          last=args.last,
                          overwrite=args.overwrite)
        if args.queue:
            reduce.queue()
        else:
            reduce.nxfind()
Exemple #4
0
def main():

    parser = argparse.ArgumentParser(
        description="Set scan file as parent by creating a symbolic link")
    parser.add_argument('-d', '--directory', required=True, 
                        help='scan directory')
    parser.add_argument('-e', '--entries', default=['f1', 'f2', 'f3'], 
        nargs='+', help='names of entries to be searched')
    parser.add_argument('-t', '--threshold', type=float,
                        help='peak threshold - defaults to maximum counts/10')
    parser.add_argument('-f', '--first', type=int, help='first frame')
    parser.add_argument('-l', '--last', type=int, help='last frame')
    parser.add_argument('-r', '--radius', type=int, default=200, 
                        help='radius of mask around each peak (in pixels)')
    parser.add_argument('-w', '--width', type=int, default=3, 
                        help='width of masked region (in frames)')
    parser.add_argument('-n', '--norm', default=50000, 
                        help='normalization to monitor1')
    parser.add_argument('-s', '--start', action='store_true',
                        help='start data reduction')
    parser.add_argument('-o', '--overwrite', action='store_true', 
                        help='overwrite existing parent')

    args = parser.parse_args()

    reduce = NXReduce(directory=args.directory, overwrite=args.overwrite)
    reduce.make_parent()
    if args.start:
        for entry in args.entries:
            reduce = NXReduce(entry, args.directory, 
                              link=True, maxcount=True, find=True, mask=True,
                              threshold=args.threshold, 
                              first=args.first, last=args.last,
                              radius=args.radius, width=args.width, norm=args.norm,
                              overwrite=args.overwrite)
            reduce.nxlink()
            reduce.nxmax()
            reduce.nxfind()
            reduce.nxmask()
Exemple #5
0
def main():

    parser = argparse.ArgumentParser(
        description="Set scan file as parent by creating a symbolic link")
    parser.add_argument('-d',
                        '--directory',
                        required=True,
                        help='scan directory')
    parser.add_argument('-e',
                        '--entries',
                        default=['f1', 'f2', 'f3'],
                        nargs='+',
                        help='names of entries to be searched')
    parser.add_argument('-t',
                        '--threshold',
                        type=float,
                        help='peak threshold - defaults to maximum counts/10')
    parser.add_argument('-f', '--first', type=int, help='first frame')
    parser.add_argument('-l', '--last', type=int, help='last frame')
    parser.add_argument('-r',
                        '--radius',
                        type=int,
                        default=200,
                        help='radius of mask around each peak (in pixels)')
    parser.add_argument('-w',
                        '--width',
                        type=int,
                        default=3,
                        help='width of masked region (in frames)')
    parser.add_argument('-n',
                        '--norm',
                        default=50000,
                        help='normalization to monitor1')
    parser.add_argument('-s',
                        '--start',
                        action='store_true',
                        help='start data reduction')
    parser.add_argument('-o',
                        '--overwrite',
                        action='store_true',
                        help='overwrite existing parent')

    args = parser.parse_args()

    reduce = NXReduce(directory=args.directory, overwrite=args.overwrite)
    reduce.make_parent()
    if args.start:
        for entry in args.entries:
            reduce = NXReduce(entry,
                              args.directory,
                              link=True,
                              maxcount=True,
                              find=True,
                              mask=True,
                              threshold=args.threshold,
                              first=args.first,
                              last=args.last,
                              radius=args.radius,
                              width=args.width,
                              norm=args.norm,
                              overwrite=args.overwrite)
            reduce.nxlink()
            reduce.nxmax()
            reduce.nxfind()
            reduce.nxmask()