Example #1
0
def insertModel(alignerdata, results):
    # general protmo parameters
    q = appiondata.ApProtomoModelData()
    q['aligner'] = alignerdata
    q['psi'] = results[-2]['psi']
    q['theta'] = results[-2]['theta']
    q['phi'] = results[-2]['phi']
    q['azimuth'] = results[-2]['azimuth']
    modeldata = apTomo.publish(q)
    return modeldata
Example #2
0
def insertModel2(alignerdata, geometrydict):
    # general protomo2 model data
    q = appiondata.ApProtomoModelData()
    q['aligner'] = alignerdata
    q['psi'] = geometrydict['psi']
    q['theta'] = geometrydict['theta']
    q['phi'] = geometrydict['phi']
    q['azimuth'] = geometrydict['azimuth']
    modeldata = apTomo.publish(q)
    return modeldata
def getAlignmentFromDB(alignerdata, center):
    q = appiondata.ApProtomoModelData(aligner=alignerdata)
    results = q.query(results=1)
    model = results[0]
    specimen_euler = {
        'psi': model['psi'],
        'theta': model['theta'],
        'phi': model['phi']
    }
    tiltaz = model['azimuth']
    q = appiondata.ApProtomoAlignmentData(aligner=alignerdata)
    results = q.query()
    results.reverse()
    origins = []
    rotations = []
    for r in results:
        origins.append(
            (r['shift']['x'] + center['x'], r['shift']['y'] + center['y']))
        rotations.append(r['rotation'])
    return specimen_euler, tiltaz, origins, rotations