Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:16

0001 #!/usr/bin/env python
0002 #
0003 # Copyright (c) 2019 Opticks Team. All Rights Reserved.
0004 #
0005 # This file is part of Opticks
0006 # (see https://bitbucket.org/simoncblyth/opticks).
0007 #
0008 # Licensed under the Apache License, Version 2.0 (the "License"); 
0009 # you may not use this file except in compliance with the License.  
0010 # You may obtain a copy of the License at
0011 #
0012 #   http://www.apache.org/licenses/LICENSE-2.0
0013 #
0014 # Unless required by applicable law or agreed to in writing, software 
0015 # distributed under the License is distributed on an "AS IS" BASIS, 
0016 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0017 # See the License for the specific language governing permissions and 
0018 # limitations under the License.
0019 #
0020 
0021 
0022 import os, logging
0023 import numpy as np
0024 
0025 from opticks.ana.nload import A
0026 from opticks.ana.base import idp_
0027 
0028 class CGDMLDetector(object):
0029     def __init__(self):
0030         self.gtransforms = np.load(idp_("CGDMLDetector/0/gtransforms.npy"))
0031         self.ltransforms = np.load(idp_("CGDMLDetector/0/ltransforms.npy"))
0032 
0033     def __repr__(self):
0034         return "\n".join([
0035               "gtransforms %s " % repr(self.gtransforms.shape),
0036               "ltransforms %s " % repr(self.ltransforms.shape)
0037               ])
0038 
0039     def getGlobalTransform(self, frame):
0040         return self.gtransforms[frame]
0041 
0042 if __name__ == '__main__':
0043 
0044     logging.basicConfig(level=logging.INFO)
0045     frame = 3153
0046 
0047     det = CGDMLDetector()
0048     print det
0049     mat = det.getGlobalTransform(frame)
0050     print "mat %s " % repr(mat)
0051 
0052