def make_wires_onesided(ctx, **kwds): ''' Generate a WCT wires file. The named detector sets initial defaults. If other options are given they overwride. ''' output_file = kwds.pop("output_file") detector = kwds.pop("detector") import wirecell.util.wires.generator as wgen params = dict(getattr(wgen, f'{detector}_params')) for key, val in kwds.items(): if val is None: continue if isinstance(val, str): val = unitify_parse(val) if len(val) == 1: val = val[0] params[key] = val import wirecell.util.wires.persist as wpersist s = wgen.onesided_wrapped(params) wpersist.dump(output_file, s)
def make_wires_onesided(ctx, output_file): ''' Generate a WCT wires file. ''' import wirecell.util.wires.generator as wgen import wirecell.util.wires.persist as wpersist s = wgen.onesided_wrapped() # fixme, expose different algs to CLI wpersist.dump(output_file, s)
def gen_plot_wires(ctx, output_file): ''' Generate wires and plot them. ''' import wirecell.util.wires.plot as wplot import wirecell.util.wires.generator as wgen s = wgen.onesided_wrapped() fig, ax = wplot.oneplane(s, 0) #fig,ax = wplot.allplanes(s) #fig,ax = wplot.allwires(s) fig.savefig(output_file)