[INSTRM-1977] MCS did not use correct camera name when writing transformation Created: 12/May/23  Updated: 12/May/23  Resolved: 12/May/23

Status: Done
Project: Instrument control development
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: chyan Assignee: chyan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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



 Comments   
Comment by chyan [ 12/May/23 ]

Fixed and tested. Merged to master.

Generated at Sat Feb 10 16:41:41 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.