Functions | |
def | fromtarfile (filename) |
def | asgenerator (source) |
def | split_text_records (text) |
def | parse_text_record (text) |
def | parse_filename (filename) |
def | load (source, normalization=None, zero_wire_loc=0.0) |
def | toarrays (rflist) |
def | convert (inputfile, outputfile="wire-cell-garfield-fine-response.json.bz2", average=False, shaped=False) |
Process Garfield field response output files to produce Wire Cell field response input files. Garfield input is provided as a tar file. Internal directory structure does not matter much but the files are assumed to be spelled in the form: <impact>_<plane>.dat where <impact> spells the impact position in mm and plane is from the set {"U","V","Y"}. Each .dat file may hold many records. See parse_text_record() for details of the assumptions made when parsing. These quantities must be given explicitly: - speed :: the nominal drift speed
def wirecell.sigproc.garfield.asgenerator | ( | source | ) |
If string, assume file, open proper generator, o.w. just return
Definition at line 42 of file garfield.py.
def wirecell.sigproc.garfield.convert | ( | inputfile, | |
outputfile = "wire-cell-garfield-fine-response.json.bz2" , |
|||
average = False , |
|||
shaped = False |
|||
) |
Convert an input Garfield file pack into an output wire cell field response file. See also wirecell.sigproc.response.persist
Definition at line 262 of file garfield.py.
def wirecell.sigproc.garfield.fromtarfile | ( | filename | ) |
Iterate on tarfile, returning (name,text) pair of each file.
Definition at line 32 of file garfield.py.
def wirecell.sigproc.garfield.load | ( | source, | |
normalization = None , |
|||
zero_wire_loc = 0.0 |
|||
) |
Load Garfield data source (eg, tarball). Return list of response.ResponseFunction objects. The responses will be normalized according to the value of `normalization`: none or 0: no normalization, take Garfield as absolutely normalized less than 0: normalize such that the average of the integrals along an impact position of the central collection wire is this many electrons. greater than 0: simply multiply the responses by this number. The `zero_wire_loc` is the transverse location of the wire to be considered the central wire.
Definition at line 139 of file garfield.py.
def wirecell.sigproc.garfield.parse_filename | ( | filename | ) |
Try to parse whatever data is encoded into the file name.
Definition at line 128 of file garfield.py.
def wirecell.sigproc.garfield.parse_text_record | ( | text | ) |
def wirecell.sigproc.garfield.split_text_records | ( | text | ) |
Return a generator that splits text by record separators.
Definition at line 54 of file garfield.py.
def wirecell.sigproc.garfield.toarrays | ( | rflist | ) |
Return field response current waveforms as 3 2D arrays. Return as tuple (u,v,w) where each is a 2D array shape: (#regions, #responses).
Definition at line 242 of file garfield.py.