def get_tracerinfo(tracerinfo_file):
widths = [rec.width for rec in tracer_recs]<EOL>col_names = [rec.name for rec in tracer_recs]<EOL>dtypes = [rec.type for rec in tracer_recs]<EOL>usecols = [name for name in col_names if not name.startswith('<STR_LIT:->')]<EOL>tracer_df = pd.read_fwf(tracerinfo_file, widths=widths, names=col_names,<EOL>dtypes=dtypes, comment="<STR_LIT:#>", header=None,<EOL>usecols=usecols)<EOL>na_free = tracer_df.dropna(subset=['<STR_LIT>', '<STR_LIT>'])<EOL>only_na = tracer_df[~tracer_df.index.isin(na_free.index)]<EOL>if len(only_na) > <NUM_LIT:0>:<EOL><INDENT>warn("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(tracerinfo_file)) <EOL><DEDENT>tracer_desc = {tracer.name: tracer.desc for tracer in tracer_recs<EOL>if not tracer.name.startswith('<STR_LIT:->')}<EOL>def _assign_hydrocarbon(row):<EOL><INDENT>if row['<STR_LIT:C>'] != <NUM_LIT:1>:<EOL><INDENT>row['<STR_LIT>'] = True<EOL>row['<STR_LIT>'] = C_MOLECULAR_WEIGHT<EOL><DEDENT>else:<EOL><INDENT>row['<STR_LIT>'] = False<EOL><DEDENT>return row<EOL><DEDENT>tracer_df = (<EOL>tracer_df<EOL>.apply(_assign_hydrocarbon, axis=<NUM_LIT:1>)<EOL>.assign(chemical=lambda x: x['<STR_LIT>'].astype(bool))<EOL>)<EOL>return tracer_df, tracer_desc<EOL>
Read an output's tracerinfo.dat file and parse into a DataFrame for
use in selecting and parsing categories.

Parameters
----------
tracerinfo_file : str
    Path to tracerinfo.dat

Returns
-------
DataFrame containing the tracer information.