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

MCS did not use correct camera name when writing transformation

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done (View Workflow)
    • Priority: Normal
    • Resolution: Done
    • Component/s: None
    • Labels:
      None

      Description

      def writeTransformToDB(db, frameId, pfiTransform, cameraName):
          """
          write transformation coefficients to database
          """
          trans=pfiTransform.mcsDistort.getArgs()
          res = db.session.execute('select * FROM "mcs_pfi_transformation" where false')
          colnames = tuple(res.keys())
          realcolnames = colnames[0:]
          line = '%d,%f,%f,%f,%e,%e,%f,%s' % (frameId, trans[0].astype('float64'),
                 trans[1], trans[3], trans[4],trans[2],
                 pfiTransform.alphaRot, 'canon50M')
                                                                              
          buf = io.StringIO()
          buf.write(line)
          buf.seek(0, 0)
          _writeData('mcs_pfi_transformation', realcolnames, buf)
      
      
          data = {'mcs_frame_id': [frameId],
                  'x0': [trans[0]],
                  'y0': [trans[1]],
                  'dscale': [trans[2]],
                  'scale2': [trans[3]],
                  'theta': [trans[4]],
                  'alpha_rot': [pfiTransform.alphaRot],
                  'camera_name': [cameraName]}
          df = pd.DataFrame(data=data)
          return df['mcs_frame_id'].values,df['x0'].values,df['y0'].values,df['dscale'].values, \
              df['scale2'].values,df['theta'].values,df['alpha_rot'].values,df['camera_name'].values
      
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: