parameters: (self)
docstring: Parses the choppers list to determine how to handle resolution and flux calculations
docstring_summary: Parses the choppers list to determine how to handle resolution and flux calculations
docstring_tokens: Parses the choppers list to determine how to handle resolution and flux calculations
function: def _parse_choppers(self):
          """Parses the choppers list to determine how to handle resolution and flux calculations"""
          if not self.choppers:
              return
          self.distance = []
          self.nslot = []
          self.slot_ang_pos = []
          self.slot_width = []
          self.guide_width = []
          self.radius = []
          self.numDisk = []
          self.isFermi = False
          self.isPhaseIndependent = []
          self.defaultPhase = []
          self.phaseNames = []
          for idx, chopper in enumerate(self.choppers):
              self.distance.append(chopper['distance'])
              if 'packages' in chopper:
                  self.isFermi = True
                  self.idxFermi = idx
                  self.packages = {key: FermiChopper(val) for key, val in list(chopper['packages'].items())}
                  self.nslot.append(1)    # Assume Fermi chopper is curved, will not transmit PI pulse.
                  self.slot_ang_pos.append(None)
                  self.slot_width.append(10.)
                  self.guide_width.append(10.)
                  self.radius.append(290.)
                  self.numDisk.append(1)
              else:
                  self.nslot.append(
                      chopper['nslot'] if ('nslot' in chopper and chopper['nslot']) else len(chopper['slot_ang_pos']))
                  self.slot_ang_pos.append(chopper['slot_ang_pos'] if ('slot_ang_pos' in chopper) else None)
                  self.slot_width.append(chopper['slot_width'])
                  self.guide_width.append(chopper['guide_width'])
                  self.radius.append(chopper['radius'])
                  self.numDisk.append(2 if ('isDouble' in chopper and chopper['isDouble']) else 1)
                  self.isPhaseIndependent.append(
                      True if ('isPhaseIndependent' in chopper and chopper['isPhaseIndependent']) else False)
                  self.defaultPhase.append(chopper['defaultPhase'] if 'defaultPhase' in chopper else 0)
                  self.phaseNames.append(chopper['phaseName'] if 'phaseName' in chopper else 'Chopper %d phase delay time' % (idx))
          if not any(self.slot_ang_pos):
              self.slot_ang_pos = None
          self.isPhaseIndependent = [ii for ii in range(len(self.isPhaseIndependent)) if self.isPhaseIndependent[ii]]
          self.defaultPhase = [self.defaultPhase[ii] for ii in self.isPhaseIndependent]
          self.phaseNames = [self.phaseNames[ii] for ii in self.isPhaseIndependent]
          source_rep = self.source_rep if (not hasattr(self, 'n_frame') or self.n_frame == 1) else [self.source_rep, self.n_frame]
          self._instpar = [self.distance, self.nslot, self.slot_ang_pos, self.slot_width, self.guide_width, self.radius,
                           self.numDisk, self.sam_det, self.chop_sam, source_rep, self.emission_time,
                           self.overlap_ei_frac, self.isPhaseIndependent]
          if self.isFermi:
              self.package = list(self.packages.keys())[0]
function_tokens: def _parse_choppers ( self ) : if not self . choppers : return self . distance = [ ] self . nslot = [ ] self . slot_ang_pos = [ ] self . slot_width = [ ] self . guide_width = [ ] self . radius = [ ] self . numDisk = [ ] self . isFermi = False self . isPhaseIndependent = [ ] self . defaultPhase = [ ] self . phaseNames = [ ] for idx , chopper in enumerate ( self . choppers ) : self . distance . append ( chopper [ 'distance' ] ) if 'packages' in chopper : self . isFermi = True self . idxFermi = idx self . packages = { key : FermiChopper ( val ) for key , val in list ( chopper [ 'packages' ] . items ( ) ) } self . nslot . append ( 1 ) # Assume Fermi chopper is curved, will not transmit PI pulse. self . slot_ang_pos . append ( None ) self . slot_width . append ( 10. ) self . guide_width . append ( 10. ) self . radius . append ( 290. ) self . numDisk . append ( 1 ) else : self . nslot . append ( chopper [ 'nslot' ] if ( 'nslot' in chopper and chopper [ 'nslot' ] ) else len ( chopper [ 'slot_ang_pos' ] ) ) self . slot_ang_pos . append ( chopper [ 'slot_ang_pos' ] if ( 'slot_ang_pos' in chopper ) else None ) self . slot_width . append ( chopper [ 'slot_width' ] ) self . guide_width . append ( chopper [ 'guide_width' ] ) self . radius . append ( chopper [ 'radius' ] ) self . numDisk . append ( 2 if ( 'isDouble' in chopper and chopper [ 'isDouble' ] ) else 1 ) self . isPhaseIndependent . append ( True if ( 'isPhaseIndependent' in chopper and chopper [ 'isPhaseIndependent' ] ) else False ) self . defaultPhase . append ( chopper [ 'defaultPhase' ] if 'defaultPhase' in chopper else 0 ) self . phaseNames . append ( chopper [ 'phaseName' ] if 'phaseName' in chopper else 'Chopper %d phase delay time' % ( idx ) ) if not any ( self . slot_ang_pos ) : self . slot_ang_pos = None self . isPhaseIndependent = [ ii for ii in range ( len ( self . isPhaseIndependent ) ) if self . isPhaseIndependent [ ii ] ] self . defaultPhase = [ self . defaultPhase [ ii ] for ii in self . isPhaseIndependent ] self . phaseNames = [ self . phaseNames [ ii ] for ii in self . isPhaseIndependent ] source_rep = self . source_rep if ( not hasattr ( self , 'n_frame' ) or self . n_frame == 1 ) else [ self . source_rep , self . n_frame ] self . _instpar = [ self . distance , self . nslot , self . slot_ang_pos , self . slot_width , self . guide_width , self . radius , self . numDisk , self . sam_det , self . chop_sam , source_rep , self . emission_time , self . overlap_ei_frac , self . isPhaseIndependent ] if self . isFermi : self . package = list ( self . packages . keys ( ) ) [ 0 ]