def initialize_measurement(acton_port, exposure_time=50): print("Starting..") print("Pixis...") p = Pixis(debug=1) p.StartUp() print("Acton...") act = Acton(port=acton_port, debug=1) print("Done...") pacton = Pacton(pixis=p, acton=act) print("Measuring...") p.SetExposureTime(exposure_time) return pacton
def initialize_measurement(acton_port, exposure_time=100): print("Starting..") print("Pixis...") p = Pixis(debug=1) p.StartUp() print("Acton...") act = Acton(port=acton_port, debug=1) print("Done...") pacton = Pacton(pixis=p, acton=act) print("Measuring...") p.SetExposureTime(exposure_time) # print pacton.acton.read_grating() pacton.acton.set_grating(1) # print "New grating",pacton.acton.read_grating_name() return pacton
def initialize_measurement(): f = df.DataFile("ir_calibration.hdf5", "a") g = f.require_group("calibration") print("Starting..") print("Pixis...") p = Pixis(debug=1) p.StartUp() print("Acton...") act = Acton("COM7", debug=1) print("Done...") pacton = Pacton(pixis=p, acton=act) print("Measuring...") fig, ax = plt.subplots(1) p.SetExposureTime(500) pacton.get_pixel_response_calibration_spectrum() return pacton, g
ax.plot(spectrum) plt.show() if __name__ == "__main__": f = df.DataFile("ir_calibration_1200gmm.hdf5", "a") g = f.require_group("calibration") print("Starting..") print("Pixis...") p = Pixis(debug=0) p.StartUp() print("Acton...") act = Acton("COM5", debug=0) print("Done...") pacton = Pacton(pixis=p, acton=act) print("Setting grating...") pacton.acton.set_grating(1) # 1 : 1200g/mm, 2: 300g/mm # print pacton.acton.read_grating() p.SetExposureTime(200) pacton.get_pixel_response_calibration_spectrum() # tune(wl,laser) # measured = get_wavelength(laser) # print wl, measured center_wavelengths = list(range(870, 890, 10)) p.SetExposureTime(200)
ax.plot(spectrum) plt.show() if __name__ == "__main__": f = df.DataFile("ir_calibration.hdf5", "a") g = f.require_group("calibration") print("Starting..") print("Pixis...") p = Pixis(debug=1) p.StartUp() print("Acton...") act = Acton("COM7", debug=1) print("Done...") pacton = Pacton(pixis=p, acton=act) print("Measuring...") fig, ax = plt.subplots(1) p.SetExposureTime(500) pacton.get_pixel_response_calibration_spectrum() center_wavelength = 895 laser_wavelength = 905.0 # make_measurement(g,laser_wavelength,center_wavelength) # spectrum,_ = pacton.get_spectrum(center_wavelength,subtract_background=True,roi=[0,1024,600,800],debug=1) # ax.plot(spectrum) # plt.show()
import matplotlib.pyplot as plt import numpy as np from nplab import datafile as df from nplab.analysis.smoothing import convex_smooth from nplab.instrument.spectrometer.acton_2300i import Acton from nplab.instrument.camera.Picam.pixis import Pixis from .Pacton import Pacton print("Starting..") print("Pixis...") p = Pixis(debug=0) p.StartUp() print("Acton...") act = Acton("COM6", debug=0) print("Done...") pacton = Pacton(pixis=p, acton=act, debug=0) print("Measuring...") from nplab import datafile as df output_file = df.DataFile("measured_spectrum.hdf5", "w") dg = output_file.require_group("spectra") fig, axarr = plt.subplots(3) p.SetExposureTime(500) pacton.get_pixel_response_calibration_spectrum() measured_ys = [] measured_xs = [] from nplab.analysis.signal_alignment import correlation_align