Skip to content

Commit

Permalink
modiy 'live' function --- wavelengths are saved at the end now, while…
Browse files Browse the repository at this point in the history
… statement modified
  • Loading branch information
SarthakJariwala committed May 6, 2019
1 parent c639079 commit ef24a75
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,18 @@ def save_single_spec(self):

def live(self):
save_array = np.zeros(shape=(2048,2))
save_array[:,0] = self.spec.wavelengths()

self.ui.plot.setLabel('left', 'Intensity', units='a.u.')
self.ui.plot.setLabel('bottom', 'Wavelength', units='nm')
j = 0
while self.ui.connect_checkBox.isChecked(): # this while loop works!
while self.spec is not None:#self.ui.connect_checkBox.isChecked(): # this while loop works!
self._read_spectrometer()
save_array[:,1] = self.y

self.ui.plot.plot(self.spec.wavelengths(), self.y, pen='r', clear=True)

if self.ui.save_every_spec_checkBox.isChecked():
save_array[:,0] = self.spec.wavelengths()
np.savetxt(self.save_folder+"/"+self.ui.lineEdit.text()+str(j)+".txt", save_array, fmt = '%.5f',
header = 'Wavelength (nm), Intensity (counts)', delimiter = ' ')

Expand Down

0 comments on commit ef24a75

Please sign in to comment.