-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwvr_reader.py
More file actions
32 lines (25 loc) · 1007 Bytes
/
wvr_reader.py
File metadata and controls
32 lines (25 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
"""
Functions for reading Output from MatLab Program 'WaterVapRemover'
"""
#M.Rabe , 2018
import numpy as _np
from specage.ascii_magic import readASCII_table as _readascii
from specage.spcl import Spectrum
def singleascii(Filename, blcorr = False):
"""Return Spectrum object from 'WaterVapRemover' ascii file. For
blcorr = true the baseline corrected spectrum is read"""
datatable = _readascii(Filename, headlines=7, delim = None)
wvl = _np.array(datatable[0][:,0])
if blcorr:
Abs = _np.array(datatable[0][:,2])
else:
Abs = _np.array(datatable[0][:,1])
return Spectrum(wvl, Abs,FileName=Filename, ylabel='absorbance / au',
xlabel='\wavenumber / cm^{-1}')
def filelist(Filelist, blcorr = False):
"""Return list of Spectrum object from list of 'WaterVapRemover' ascii files"""
Speclist=[]
for File in Filelist:
Speclist.append(singleascii(File, blcorr))
return Speclist