def main(): parser = argparse.ArgumentParser( description="Find maximum counts of the signal in the specified path") 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 processed') 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 maximum') 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, maxcount=True, first=args.first, last=args.last, overwrite=args.overwrite) if args.queue: reduce.queue() else: reduce.nxmax()
def main(): parser = argparse.ArgumentParser( description="Find maximum counts of the signal in the specified path") parser.add_argument('-d', '--directory', required=True, help='scan directory') parser.add_argument('-e', '--entries', nargs='+', help='names of entries to be processed') 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 maximum') 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, maxcount=True, first=args.first, last=args.last, overwrite=args.overwrite, monitor_progress=args.monitor) if args.queue: reduce.queue('nxmax', args) else: reduce.nxmax()
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()