Exemple #1
0
    def __init__(self):
        self.idealOverlapsPath = Path('input') / Path(
            'detectorOverlapsIdeal.json')
        self.idealOverlapInfos = mi.loadMatrices(self.idealOverlapsPath, False)

        self.idealDetectorMatrixPath = Path('input') / Path(
            'detectorMatricesIdeal.json')
        self.idealDetectorMatrices = mi.loadMatrices(
            self.idealDetectorMatrixPath)

        self.availableOverlapIDs = self.getOverlapsFromJSON()
        self.overlapMatrices = {}
        self.alignmentMatrices = {}
        self.maxPairs = 6e5
        self.dCut = 1.0  # dictionary overlapID: matrix
        self.lock = Lock()
Exemple #2
0
    def combineAlignmentMatrices(self):

        if self.externalMatrices == None:
            raise Exception('Error! Please set externally measured matrices!')

        # these are important! the combiner MUST only get the overlap matrices
        sortedMatrices = collections.defaultdict(dict)
        sortedOverlaps = collections.defaultdict(dict)

        if len(self.overlapMatrices) < 360:
            raise Exception(f'Error! Not all overlap matrices could be found!')

        # sort overlap matrices by module they are on
        for overlapID in self.availableOverlapIDs:
            modulePath = self.idealOverlapInfos[overlapID]['pathModule']
            sortedMatrices[modulePath].update(
                {overlapID: self.overlapMatrices[overlapID]})

        print(f'found {len(sortedMatrices)}, modules, should be 40.')

        # sort overlapInfos to dict by module path
        for modulePath in sortedMatrices:
            for overlapID in self.idealOverlapInfos:
                if self.idealOverlapInfos[overlapID][
                        'pathModule'] == modulePath:
                    sortedOverlaps[modulePath].update(
                        {overlapID: self.idealOverlapInfos[overlapID]})

        idealMatrices = mi.loadMatrices(self.idealDetectorMatrixPath)

        for modulePath in sortedMatrices:
            combiner = alignmentMatrixCombiner(modulePath)

            combiner.setIdealDetectorMatrices(idealMatrices)
            combiner.setOverlapMatrices(sortedMatrices[modulePath])
            combiner.setExternallyMeasuredMatrices(self.externalMatrices)

            combiner.combineMatrices()

            resultMatrices = combiner.getAlignmentMatrices()
            self.alignmentMatrices.update(resultMatrices)

        print(
            f'combined for all sensors on all modules. length: {len(self.alignmentMatrices)}'
        )
Exemple #3
0
 def loadExternalMatrices(self, fileName):
     self.externalMatrices = mi.loadMatrices(fileName)
 def __init__(self):
     self.logger = None
     self.idealDetectorMatrixPath = Path('input') / Path('detectorMatricesIdeal.json')
     self.idealDetectorMatrices = mi.loadMatrices(self.idealDetectorMatrixPath)
Exemple #5
0
 def readAnchorPoints(self, fileName):
     self.anchorPoints = mi.loadMatrices(fileName, False)
Exemple #6
0
 def readAverageMisalignments(self, fileName):
     self.avgMisalignments = mi.loadMatrices(fileName)
Exemple #7
0
 def loadAlignerMatrices(self, filename):
     print(f'loading align matrices from:\n{filename}')
     self.alignerResults = mi.loadMatrices(filename)
Exemple #8
0
 def loadDesignMisalignments(self, filename):
     print(f'loading design misalignments from:\n{filename}')
     self.misalignMatrices = mi.loadMatrices(filename)
Exemple #9
0
 def loadIdealDetectorMatrices(self, filename):
     print(f'loading ideal detector matrices from:\n{filename}')
     self.idealDetectorMatrices = mi.loadMatrices(filename)
Exemple #10
0
 def loadSensorAlignerOverlapMatrices(self, filename):
     self.overlapMatrices = mi.loadMatrices(filename)
Exemple #11
0
 def loadPerfectDetectorOverlaps(self, fileName):
     self.overlaps = mi.loadMatrices(fileName, False)