2018-10-31 06:43:08 -04:00
|
|
|
from brukeropusreader import read_file
|
2017-10-10 06:20:15 -04:00
|
|
|
|
2017-11-09 03:41:17 -05:00
|
|
|
import sys
|
|
|
|
import argparse
|
2018-10-31 06:43:08 -04:00
|
|
|
import matplotlib.pyplot as plt
|
2017-10-10 06:20:15 -04:00
|
|
|
|
|
|
|
|
2017-11-09 03:41:17 -05:00
|
|
|
def main(path_to_file):
|
2018-10-31 06:43:08 -04:00
|
|
|
print(f'Reading opus file from path'
|
|
|
|
f'{path_to_file}')
|
|
|
|
opus_data = read_file(path_to_file)
|
|
|
|
|
|
|
|
print(f'Dimension of data: '
|
|
|
|
f'{len(opus_data.wave_nums)}')
|
|
|
|
|
|
|
|
print(f'Spectrum range: ['
|
|
|
|
f'{min(opus_data.spectrum)}; '
|
|
|
|
f'{max(opus_data.spectrum)}]')
|
|
|
|
|
|
|
|
print(f'Metadata: '
|
|
|
|
f'{opus_data.meta}')
|
|
|
|
|
|
|
|
plt.plot(opus_data.wave_nums, opus_data.spectrum)
|
|
|
|
plt.title(f'Spectrum {path_to_file}')
|
|
|
|
plt.show()
|
2017-10-10 06:20:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2017-11-09 03:41:17 -05:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument("opus_path",
|
|
|
|
help="Path to opus file",
|
|
|
|
action="store")
|
|
|
|
args = parser.parse_args()
|
2017-10-10 06:20:15 -04:00
|
|
|
main(sys.argv[1])
|