Docstrings updates

这个提交包含在:
Craig Warren
2022-11-26 16:52:36 +00:00
父节点 e77a4b01f5
当前提交 1a8a65960b
共有 4 个文件被更改,包括 132 次插入81 次删除

查看文件

@@ -30,7 +30,7 @@ logger = logging.getLogger(__name__)
def mpl_plot(filename, outputdata, dt, rxnumber, rxcomponent, save=False):
"""Creates a plot (with matplotlib) of the B-scan.
"""Creates a plot of the B-scan.
Args:
filename: string of filename (including path) of output file.
@@ -101,28 +101,19 @@ if __name__ == "__main__":
logger.exception(f'No receivers found in {args.outputfile}')
raise ValueError
rxsgather = []
for rx in range(1, nrx + 1):
outputdata, dt = get_output_data(args.outputfile, rx, args.rx_component)
print(outputdata.shape)
if args.gather:
rxsgather.append(outputdata)
if rx == 1:
rxsgather = outputdata
rxsgather = np.column_stack((rxsgather, outputdata))
else:
plthandle = mpl_plot(args.outputfile, outputdata, dt, rx,
args.rx_component, save=args.save)
# Plot all receivers from single output file together if required
if args.gather:
rxsgather = np.array(rxsgather).transpose()
plthandle = mpl_plot(args.outputfile, rxsgather, dt, rx,
args.rx_component, save=args.save)
if args.save:
# Save a PDF of the figure
plthandle.savefig(args.outputfile[:-3] + '.pdf', dpi=None,
format='pdf', bbox_inches='tight', pad_inches=0.1)
# # Save a PNG of the figure
# plthandle.savefig(args.outputfile[:-3] + '.png', dpi=150,
# format='png', bbox_inches='tight', pad_inches=0.1)
else:
plthandle.show()
plthandle.show()