Example #1
0
    def __init__(self, 
                 coordSystemLocal,
                 stdevUseApriori=True,
                 confProb=0.95,
                 reliabProb=0.95,
                 testId=None,
                 duplicateIdFix=DUPLICATE_ID.compare,
                 duplicateIdAdj=DUPLICATE_ID.compare,
                 textTable=None):
        """
        stdevUseApriori: use apriori/aposteriori standard deviation
        confProb: confidence probability
        reliabProb: reliability probability
        testId: Ids of point for testing (currently only for output)
        duplicateFixId: what to do with duplicate fixed points in epoch
        textTable: text table instance for epochPointList
        """

        NetworkList.__init__(self, 
                             coordSystemLocal,
                             stdevUseApriori=stdevUseApriori,
                             confProb=confProb,
                             #reliabProb=reliabProb,
                             #duplicateIdFix=duplicateIdFix,
                             duplicateIdAdj=duplicateIdAdj)
        
        self.pointListAdj = PointList(textTable=gama_coor_table(), 
                                      duplicateId=duplicateIdFix)
            # list of fixed points for all epochs

        self.epochPointList = EpochPointList(idList=testId)
            # list of coordinates, displacements and test results
            # PointLocalGamaDisplTest instances

        self.stdevList = []
            # list of StandardDeviation instances
            # handles degrees of freedom from GamaLocalData instance

        ##self.testType = None

        if textTable is None:
            from gizela.stat.displ_test_text_table import displ_test_text_table
            self._textTable = displ_test_text_table()
        else:
            self._textTable = textTable

        self._reliabProb = reliabProb
Example #2
0
    def __init__(self, 
                 coordSystemLocal,
                 prefix=None,
                 suffix=None,
                 #duplicateIdFix=DUPLICATE_ID.compare,
                 duplicateIdAdj=DUPLICATE_ID.overwrite):
        """
        prefix: format string for one number (epoch index) usefull for joined
                adjustment of multiple epoch. As prefix of point id.
        suffix: almost the same as prefix
        duplicateIdFix, duplicateIdAdj: handling of duplicit point
        """

        NetworkList.__init__(self, 
                             coordSystemLocal,
                             #duplicateIdFix=duplicateIdFix,
                             duplicateIdAdj=duplicateIdAdj)
        self.set_prefix(prefix)
        self.set_suffix(suffix)
Example #3
0
    def append(self, net):
        """
        adds GamaLocalData instance to list of nets
        """

        if not isinstance(net, Network):
            raise NetworkAdjListError, "Network instance expected"

        NetworkList.append(self, net)

        # standard deviation
        net.stdev.set_use_apriori(self._stdevUseApriori)
        net.stdev.set_conf_prob(self._confProb)
        net.pointListAdjCovMat.covmat.useApriori = self._stdevUseApriori
        self.stdevList.append(net.stdev)

        # change textTable of pointList
        net.pointListAdjCovMat.textTable = self._textTable

        # compute displacements of net added
        #
        # compute differences from "zero" epoch
        for pp in net.pointListAdjCovMat:
            # change type of point
            p = PointLocalGamaDisplTest(pp)
            #p.epochIndex = len(self)# - 1
            p.epochIndex = len(self) - 1

            #import sys
            #from gizela.data.point_text_table import gama_coor_stdev_table
            #print >>sys.stderr, pp.with_text_table(gama_coor_stdev_table())
            #print >>sys.stderr, p.with_text_table(gama_coor_stdev_table())
            
            # find point in "zero" epoch
            
            p0 = None
            if p.id in self.epochPointList.iter_id():
                for pp in self.epochPointList.iter_point(p.id):
                    if p.is_set_xyz() and pp.is_set_xyz():
                        p0 = pp
                        break
                    elif p.is_set_xy() and pp.is_set_xy():
                        p0 = pp
                        break
                    elif p.is_set_z() and pp.is_set_z():
                        p0 = pp
                        break
                if p0 is not None:
                    #print "type p", type(p)
                    #print "minus", type((p - p0).covmat)
                    #from gizela.data.point_text_table import gama_coor_stdev_table
                    #print (p-p0).with_text_table(gama_coor_stdev_table())
                    p.set_displacement(p - p0)

            net.pointListAdjCovMat.replace_point(p)

        # compute differences - previous epoch
        #if self.numEpoch > 1:
        #    lastEpoch = self.epochPointList.get_epoch(-1)
        #    for p in pl:
        #        if p.id in lastEpoch:
        #            # compute displacement
        #            pd = p - lastEpoch.get_point(p.id)
        #            #print pd.id, pd.covmat.data
        #            # add displacement 
        #            p.set_displacement(pd)
        #from gizela.stat.displ_test_text_table import point_displ_text_table
        #pl.textTable = point_displ_text_table()
        #print pl


        # add adjusted points with displacements
        self.epochPointList.add_(net.pointListAdjCovMat)
        #for p in self.epochPointList.get_epoch(-1):
        #    print p.id,"covmat", p.covmat.make_gama_xml()
        #    print p.id,"var", p.var

        # add fixed points
        self.pointListAdj.extend(net.pointListAdj)