def main(): for name in ("sp", "line", "depth", "mapping"): filename = curdir / "spectra_files" / "{0}.wdf".format(name) print("Testing: ", filename.as_posix()) # if debug=True, debug information will show in stderr reader = WDFReader(filename, debug=True) # Explicitly print into stdout reader.print_info() return
not background subtracion performed in this program """ from renishawWiRE import WDFReader import matplotlib.pyplot as plt # input file path and file name IN_PATH = r'Z:\Trumann\Renishaw\20210304 PVSe33' FNAME = r'\PVSe33.4_3 Au side raman map0.wdf' # import wdf file filename = IN_PATH+FNAME reader = WDFReader(filename) reader.print_info() # get x-axis of spectral data # keep in mind the units you specified for the measurement # here, raman shift (cm-1) was specified and would be the x-axis of the spectrum shift = reader.xdata # get the spectral data # if .wdf file is a map, 'spectra' is 3D (y_pixel, x_pixel, intensity) # if .wdf file is spot, 'spectra' is 1D (intensity) # if .wdf file is aborted map, 'spectra' is 2D (y_pix*x_pix, intensity) spectra = reader.spectra # check the spectrum of the first pixel # this will not work if the map was aborted first_pixel = spectra[0,0,:]