Uploaded image for project: 'Instrument control development'
  1. Instrument control development
  2. INSTRM-2102

Reduce the overhead of geometry loading

    XMLWordPrintable

    Details

    • Sprint:
      Gen3 transition

      Description

      After using the multi-processing, the centroid time is much faster than before. Now. the first iteration still require ~4 seconds to load the geometry. We need to think about how to reduce the overhead

          def getGeometry(self, cmd):
      
              db = self.connectToDB(cmd)
      
              cmd.inform(f'text="getting geometry"')
      
              if(self.geometrySet == True):
                  cmd.inform('text="geometry is already set"')
                  return
      
              # boresight centre in pixels
              self.rotCent = dbTools.loadBoresightFromDB(db, int(self.visitId))
              cmd.inform(f'text="boresight={self.rotCent[0]},{self.rotCent[1]}"')
      
              # read xmlFile
              instPath = os.path.join(os.environ['PFS_INSTDATA_DIR'])
              #if(self.geomFile == None):
              #    self.geomFile = os.path.join(instPath, 'data/pfi/modules/ALL/ALL_final_20210920_mm.xml')
              if(self.dotFile == None):
                  self.dotFile = os.path.join(
                      instPath, "data/pfi/dot/black_dots_mm.csv")
      
              pfi = self.butler.get("moduleXml", moduleName="ALL", version="")
              dots = self.butler.get("black_dots", moduleName="ALL", version="")
      
              cmd.inform(f'text="loading XML from butler"')
              cmd.inform(f'text="loading DOT location from butler"')
              self.centrePos, self.armLength, self.dotPos, self.goodIdx, self.calibModel = mcsTools.readCobraGeometry(
                  pfi, dots)
              
              fids = self.butler.get('fiducials')
              self.outerRingIds, self.badFidIds = mcsTools.readFiducialMasks(fids)
              cmd.inform('text="cobra geometry read"')
              self.geometrySet = True
       
      

        Attachments

          Activity

            People

            • Assignee:
              karr karr
              Reporter:
              chyan chyan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: