def horizrad(infn: Path, outfn: Path, c1: dict) -> xarray.Dataset:
if infn is not None:<EOL><INDENT>infn = Path(infn).expanduser()<EOL>if infn.suffix == '<STR_LIT>':<EOL><INDENT>TR = xarray.open_dataset(infn)<EOL>return TR<EOL><DEDENT><DEDENT>c1.update({'<STR_LIT>': <NUM_LIT:0>,  <EOL>'<STR_LIT>': <NUM_LIT:1>,  <EOL>'<STR_LIT>': <NUM_LIT:1>,  <EOL>'<STR_LIT>': <NUM_LIT:1>,    <EOL>'<STR_LIT>': <NUM_LIT:1>,  <EOL>})<EOL><INDENT>read csv file<EOL><DEDENT>if not infn:  <EOL><INDENT>c1['<STR_LIT:p>'] = [<NUM_LIT>, <NUM_LIT>]<EOL>c1['<STR_LIT:t>'] = [<NUM_LIT>, <NUM_LIT>]<EOL>c1['<STR_LIT>'] = [[<NUM_LIT>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>],<EOL>[<NUM_LIT>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:0.>]]<EOL>c1['<STR_LIT:time>'] = [parse('<STR_LIT>'),<EOL>parse('<STR_LIT>')]<EOL><DEDENT>else:  <EOL><INDENT>PTdata = read_csv(infn)<EOL>c1['<STR_LIT:p>'] = PTdata['<STR_LIT:p>']<EOL>c1['<STR_LIT:t>'] = PTdata['<STR_LIT>']<EOL>c1['<STR_LIT>'] = np.zeros((PTdata.shape[<NUM_LIT:0>], <NUM_LIT:12>))<EOL>c1['<STR_LIT>'][:, <NUM_LIT:0>] = PTdata['<STR_LIT>']<EOL>c1['<STR_LIT:time>'] = [parse(t) for t in PTdata['<STR_LIT:time>']]<EOL>
read CSV, simulate, write, plot