def normalisation() : global first, second, random_seed first=str(nanoseconds())[for_ref:for_ref+decimal_places:1].zfill(8) second=str(nanoseconds())[back_ref+decimal_places:back_ref:-1].zfill(8) random_seed=str(random_seed).zfill(4)[0:4:1] #user seed string, padded to 4 zeros. return
def find_refs() : global for_ref, back_ref, decimal_places samp_zeros=0 ; sample_size=12 decimal_places=8 reference_length=len(str(nanoseconds())) for samp_loops in range(sample_size) : sample1=str(nanoseconds()); sample2=str(nanoseconds()) while sample1==sample2 : sample2=str(nanoseconds()) sample2=sample2.rstrip('0') samp_zeros=samp_zeros+(len(sample1)-len(sample2)) reference_zeros=int(samp_zeros/sample_size) for_ref=reference_length-(decimal_places+reference_zeros) back_ref=-(reference_zeros+decimal_places+1) return
def store_index(self, time, index) : """Store information about: * Time-satmp * Total intensity * Beam center * Estimated Particle Size * Estimated particle nr """ self.tot_t[index] = time.time() self.tot_s[index] = time.seconds() self.tot_ns[index] = time.nanoseconds() self.tot_fd[index] = time.fiducial() self.tot_int[index] = float(self.img.sum()) self.tot_cx[index] = self.cent[0] self.tot_cy[index] = self.cent[1] self.tot_size[index] = self.radius self.tot_score[index] = self.score self.ave += self.img
def store_index(self, time, index, flag = 1) : """Store information about: * Time-stamp * Total intensity * Beam center * Estimated Particle Size * Estimated particle nr """ if not hasattr(self, 'streak_m'): self.streak_m = 0 if not hasattr(self, 'streak_s'): self.streak_s = 0 self.tot_t[index] = time.time() self.tot_s[index] = time.seconds() self.tot_ns[index] = time.nanoseconds() self.tot_fd[index] = time.fiducial() self.tot_int[index] = float(self.img.sum()) if (self.peak is not None): self.tot_peak1_int[index] = self.peak1 self.tot_peak2_int[index] = self.peak2 self.tot_streak_m[index] = self.streak_m self.tot_streak_s[index] = self.streak_s self.tot_cx[index] = self.cent[0] self.tot_cy[index] = self.cent[1] self.tot_size[index] = self.radius self.tot_score[index] = self.score if flag : self.ave += self.img
def store_index2(self, time, index, flag=1): """Store information about: * Time-stamp * Total intensity * Beam center * Estimated Particle Size * Estimated particle nr """ self.tot_t[index] = time.time() self.tot_s[index] = time.seconds() self.tot_ns[index] = time.nanoseconds() self.tot_fd[index] = time.fiducial() self.tot_int[index] = float(self.image.sum()) self.tot_cx[index] = self.cent[0] self.tot_cy[index] = self.cent[1] self.tot_size[index] = self.radius self.tot_score[index] = self.score if flag: self.ave += self.image
def nano_hop() : sample1=str(nanoseconds()); sample2=str(nanoseconds()) while sample1==sample2 : sample2=str(nanoseconds()) return