@@ -768,16 +768,6 @@ def stop_experiment(self):
768768
769769 self .experiment_on = False
770770
771- # IDEA: N/B introduce possibility to im/export ascii from/to disk id:35
772- # Mambu38
773- 774- # https://github.com/Mambu38/CALOA/issues/46
775-
776- # IDEA: In the end, write N/B as default, to be red at next start. id:34
777- # Mambu38
778- 779- # https://github.com/Mambu38/CALOA/issues/45
780-
781771 def set_black (self ):
782772 self .processing_text ["text" ] = "Preparing black-setting..."
783773 self .pause_live_display .set ()
@@ -944,7 +934,7 @@ def experiment(self):
944934 self .avh .prepareAll (
945935 intTime = p_T ,
946936 triggerred = True ,
947- nrAverages = p_N_c
937+ nrAverages = 1
948938 )
949939
950940 experiment_logger .info ("Starting observation." )
@@ -961,10 +951,11 @@ def experiment(self):
961951 self .processing_text ["text" ] = "Processing experiment :\n " \
962952 + "\t Average : {}/{}\n " .format (n_c , p_N_c )\
963953 + "\t Delay : {}/{}" .format (n_d , p_N_d )
954+ self .update ()
955+
964956 self .avh .startAll (1 )
965957 self ._bnc .sendtrig ()
966958 self .after (int (p_T_tot ))
967- self .update ()
968959
969960 n_c += 1
970961
@@ -991,13 +982,10 @@ def experiment(self):
991982 self ._bnc .stop ()
992983 n_d += 1
993984
994- for pulse in self ._bnc :
995- if pulse [BNC .STATE ] == "1" :
996- pulse [BNC .DELAY ] = \
997- float (pulse .experimentTuple [BNC .DELAY ].get ()) \
998- + n_d * \
999- float (pulse .experimentTuple [BNC .dPHASE ].get ())
1000- # tp_scopes = self.avh.getScopes()
985+ # Correct error caused by adding spectra
986+ for key in tp_scopes :
987+ tp_scopes [key ] /= p_N_c
988+
1001989 self .avh .stopAll ()
1002990 self .spectra_storage .putSpectra (raw_timestamp , n_d , tp_scopes )
1003991 self .liveDisplay .putSpectrasAndUpdate (
@@ -1058,6 +1046,14 @@ def experiment(self):
10581046 ]
10591047 )
10601048
1049+ for pulse in self ._bnc :
1050+ if pulse [BNC .STATE ] == "1" :
1051+ pulse [BNC .DELAY ] = \
1052+ float (pulse .experimentTuple [BNC .DELAY ].get ()) \
1053+ + n_d * \
1054+ float (pulse .experimentTuple [BNC .dPHASE ].get ())
1055+
1056+ del tp_scopes
10611057 if not self .experiment_on :
10621058 experiment_logger .info ("Experiment stopped." )
10631059 tMsg .showinfo ("Experiment stopped" ,
0 commit comments