Exemplo n.º 1
0
    def setDistanceFromMapCenter(self, mapCenterL, mapCenterB):

        if self.multiAnalysis.multiDate["value"] is not None:
            sourceL = self.multiAnalysis.multiL["value"]
            sourceB = self.multiAnalysis.multiB["value"]
            if sourceL == -1:
                sourceL = self.multiAnalysis.multiStartL["value"]
            if sourceB == -1:
                sourceB = self.multiAnalysis.multiStartB["value"]
        else:
            sourceL = self.spatialModel.pos["value"][0]
            sourceB = self.spatialModel.pos["value"][1]

        self.spatialModel.dist["value"] = AstroUtils.distance(
            sourceL, sourceB, mapCenterL, mapCenterB)
Exemplo n.º 2
0
    def getSourceDistance(self, source):

        mapCenterL = float(self.config.getOptionValue("glon"))
        mapCenterB = float(self.config.getOptionValue("glat"))

        if source.multi:
            sourceL = source.multi.get("multiL")
            sourceB = source.multi.get("multiB")

            if sourceL == -1:
                sourceL = source.multi.get("multiStartL")

            if sourceB == -1:
                sourceB = source.multi.get("multiStartB")

        else:
            pos = source.spatialModel.get("pos")
            sourceL = pos[0]
            sourceB = pos[1]


        self.logger.debug(self, "sourceL %f, sourceB %f, mapCenterL %f, mapCenterB %f", sourceL, sourceB, mapCenterL, mapCenterB)

        return AstroUtils.distance(sourceL, sourceB, mapCenterL, mapCenterB)